{"id":22753198,"url":"https://github.com/nebulab/rails_console_toolkit","last_synced_at":"2025-07-27T09:11:58.386Z","repository":{"id":56890495,"uuid":"194290207","full_name":"nebulab/rails_console_toolkit","owner":"nebulab","description":"Configurable Rails Console Helpers","archived":false,"fork":false,"pushed_at":"2020-12-31T09:57:57.000Z","size":59,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T07:02:44.455Z","etag":null,"topics":["console","rails","solidus","toolkit"],"latest_commit_sha":null,"homepage":null,"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/nebulab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T14:49:42.000Z","updated_at":"2025-01-11T08:50:14.000Z","dependencies_parsed_at":"2022-08-20T15:20:50.639Z","dependency_job_id":null,"html_url":"https://github.com/nebulab/rails_console_toolkit","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/nebulab/rails_console_toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Frails_console_toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Frails_console_toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Frails_console_toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Frails_console_toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebulab","download_url":"https://codeload.github.com/nebulab/rails_console_toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Frails_console_toolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266489130,"owners_count":23937360,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["console","rails","solidus","toolkit"],"created_at":"2024-12-11T06:09:34.625Z","updated_at":"2025-07-27T09:11:58.370Z","avatar_url":"https://github.com/nebulab.png","language":"Ruby","readme":"# RailsConsoleToolkit 🔧🧰\n\n*Configurable Rails Console Helpers*\n\nFind records faster, add custom helpers, improve your console life by 100%.\n\n[![Build](https://github.com/nebulab/rails_console_toolkit/workflows/build/badge.svg)](https://github.com/nebulab/rails_console_toolkit/actions?query=workflow%3Abuild)\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rails_console_toolkit'\n```\n\nAnd then generate the initializer:\n\n```\n$ bin/rails generate rails_console_toolkit:install\n```\n\nor write it manually:\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  # helper definitions go here...\n  #\n  # config.use_pack :aliases\n  # config.use_pack :utils\n  # config.use_pack :solidus if defined? Spree\nend\n```\n\n## Helper packs\n\n### Aliases\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.use_pack :aliases\nend\n```\n\n```\n\u003e x # alias exit\n\u003e r # alias reload!\n```\n\n\n### Utils\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.use_pack :utils\nend\n```\n\n```\n\u003e benchmark(\"foo\") { sleep 3 }\nfoo (3000.6ms)\n=\u003e 3\n\n\u003e bm # alias benchmark\n```\n\n\n### [Solidus](https://solidus.io)\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.use_pack :solidus\nend\n```\n\n```\n\u003e load_factories # will load solidus factories, useful to create dummy data in development\n\u003e product(...) # =\u003e will look for Spree::Product records by :id, :slug, :name\n\u003e variant(...) # =\u003e will look for Spree::Variant records by :id, :sku\n\u003e taxon(...)   # =\u003e will look for Spree::Taxon   records by :id, :permalink\n\u003e order(...)   # =\u003e will look for Spree::Order   records by :id, :number\n\u003e user(...)    # =\u003e will look for Spree::User    records by :id, :email\n\u003e country(...) # =\u003e will look for Spree::Country records by :id, :iso, :iso3, :iso_name, :name\n```\n\n## Custom Helpers\n\n### Generic helpers\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.helper :foo do\n    :bar\n  end\nend\n```\n\n```\n# bin/rails console\n\n\u003e foo # =\u003e :bar\n```\n\n### Aliases\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.alias :r, :reload!\nend\n```\n\n```\n# bin/rails console\n\n\u003e r # The same as typing \"reload!\"\n```\n\n### Model helpers\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  config.model_helper 'Spree::Product', as: :product, by: %i[name slug]\nend\n```\n\n\n```\n# bin/rails console\n\n\u003e product('black-tshirt') # =\u003e #\u003cSpree::Product id: 123, name: \"Black T-Shirt\", slug: \"black-tshirt\", …\u003e\n\u003e product.slug            # =\u003e \"black-tshirt\"\n\u003e product 456             # =\u003e #\u003cSpree::Product id: 456, name: \"Red T-Shirt\", slug: \"red-tshirt\", …\u003e\n\u003e product.slug            # =\u003e \"red-tshirt\"\n```\n\n### Removing unwanted helpers\n\n```ruby\n# config/initializers/console.rb\n\nRailsConsoleToolkit.configure do |config|\n  # Will define an alias :x for \"exit\"\n  config.use_pack :aliases\n  config.remove_helper :x\nend\n```\n\n```\n# bin/rails console\n\n\u003e x # NameError (undefined local variable or method \\`x' for main:Object)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/elia/rails_console_toolkit.\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## About\n\n[![Nebulab][nebulab-logo]][nebulab]\n\nThis project is funded and maintained by the [Nebulab][nebulab] team.\n\nWe firmly believe in the power of open-source. [Contact us][contact-us] if you\nlike our work and you need help with your project design or development.\n\n[nebulab]: https://nebulab.it/\n[nebulab-logo]: https://nebulab.it/assets/images/public/logo.svg\n[contact-us]: https://nebulab.it/contact-us/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Frails_console_toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebulab%2Frails_console_toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Frails_console_toolkit/lists"}