https://github.com/rails/commands
Run Rake/Rails commands through the console
https://github.com/rails/commands
Last synced: 7 months ago
JSON representation
Run Rake/Rails commands through the console
- Host: GitHub
- URL: https://github.com/rails/commands
- Owner: rails
- License: mit
- Created: 2012-12-20T21:35:00.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2017-03-14T00:13:58.000Z (almost 9 years ago)
- Last Synced: 2025-04-02T11:52:07.039Z (9 months ago)
- Language: Ruby
- Size: 26.4 KB
- Stars: 338
- Watchers: 21
- Forks: 19
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
Commands
========
Run Rake and Rails commands during a development console session and run tests during a test console session. This side-steps the need to load the entire environment over and over again when you run these commands from the shell. This constant reloading of the environment is what causes slow boot time on big applications. Think of this like a baby Zeus or the Turbolinks of commands.
Installation
------------
Add this line to your application's Gemfile:
gem 'commands'
And then execute:
$ bundle
Usage
-----
When your console boots, it'll automatically have a `commander` object instantiated. The following methods are delegated to this object: rake, generate, destroy, update. It's used like this:
> generate "scaffold post title:string"
> rake "db:migrate"
To use a persistent console for testing, be sure to first start it in the test environment, like so `./script/rails console test`. Then you can run tests like this:
> test "models"
> test "controllers"
> test "models/person"
You can see the options available for all the commands by running them with no parameters.