{"id":14955924,"url":"https://github.com/walkersumida/senro","last_synced_at":"2025-10-06T11:19:03.433Z","repository":{"id":51296830,"uuid":"231743720","full_name":"walkersumida/senro","owner":"walkersumida","description":"gem for RESTful API","archived":false,"fork":false,"pushed_at":"2021-05-17T07:13:06.000Z","size":94,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T14:17:58.498Z","etag":null,"topics":["gem","rails","restful-api","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/senro","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walkersumida.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-04T10:16:34.000Z","updated_at":"2021-08-19T01:50:33.000Z","dependencies_parsed_at":"2022-09-24T14:02:10.588Z","dependency_job_id":null,"html_url":"https://github.com/walkersumida/senro","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkersumida%2Fsenro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkersumida%2Fsenro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkersumida%2Fsenro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkersumida%2Fsenro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walkersumida","download_url":"https://codeload.github.com/walkersumida/senro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237944038,"owners_count":19391588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","rails","restful-api","ruby"],"created_at":"2024-09-24T13:12:01.357Z","updated_at":"2025-10-06T11:18:58.407Z","avatar_url":"https://github.com/walkersumida.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Senro\n\n![Build Status](https://github.com/walkersumida/senro/workflows/build/badge.svg?branch=master)\n[![Gem Version](https://badge.fury.io/rb/senro.svg)](https://badge.fury.io/rb/senro)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'senro'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install senro\n\n## Usage\n### in Rails\n#### format sort\n\n```ruby\nclass ApplicationController \u003c ActionController::Base # or ::API class\n  include Senro::Controller\n  before_action :query_params_formatter_sort\nend\n\n\npp params['sort']\n# =\u003e { id: 'asc', name: 'desc' }\npp params['original_sort']\n# =\u003e 'id,-name'\n\n# e.g. in ActiveRecord\n@items = Item.all.order(params['sort'])\n\n# e.g. in Mongoid\n@items = Item.all.order_by(params['sort'])\n```\n\n#### format query\n\n```ruby\nclass ApplicationController \u003c ActionController::Base # or ::API class\n  include Senro::Controller\n  before_action :query_params_formatter_query\nend\n\n\npp params['q']\n# =\u003e { 'query' =\u003e 'senro gem', 'status' =\u003e { 'type' =\u003e ['pr'], 'is' =\u003e ['open'], 'label' =\u003e ['bug', 'ready'] } }\npp params['original_q']\n# =\u003e 'type:pr is:open label:bug label:ready senro gem'\n\n# e.g.\n@items = Item.where(title: params['q']['query'],\n                    type: params['q']['status']['type'],\n                    status: params['q']['status']['is'])\n```\n\n## Development\n\n- Run `docker-compose up --build` to set up.\n- Run `docker-compose run ruby bundle exec rake spec` to run the tests.\n- You can also run `docker-compose run ruby bin/console` for an interactive prompt that will allow you to experiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/senro. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Senro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/senro/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkersumida%2Fsenro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalkersumida%2Fsenro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkersumida%2Fsenro/lists"}