aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/runner.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #19404 from dmathieu/remove_rack_env"Jeremy Kemper2015-03-201-1/+1
| | | | | | | Preserving RACK_ENV behavior. This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
* don't fallback to RACK_ENV when RAILS_ENV is not presentDamien Mathieu2015-03-191-1/+1
|
* No need of requiring `rbconfig`, it is by-default loadedKuldeep Aggarwal2015-01-101-1/+0
|
* Make `rails runner` command options more obviousschneems2013-12-191-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're surrounding the options in angle brackets `<>` as is convention in `curl`: ``` $ curl --help Usage: curl [options...] <url> ``` And then in square brackets `[]` with bars `|` as in `tar`: ``` $ tar --help ... Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ] ``` To further clarify that the command can be used with both, we now show examples: ``` Examples: rails runner 'puts Rails.env' This runs the code `puts Rails.env` after loading the app rails runner path/to/filename.rb This runs the Ruby file located at `path/to/filename.rb` after loading the app ``` This format was taken from the `find` man pages: ``` EXAMPLES The following examples are shown as given to the shell: find / \! -name "*.c" -print Print out a list of all the files whose names do not end in .c. find / -newer ttt -user wnj -print Print out a list of all the files owned by user ``wnj'' that are newer than the file ttt. ``` The the text at the bottom is also shifted to improve readability.
* Add positional information to eval call so that this information willPrathamesh Sonpatki2013-11-201-1/+1
| | | | | | | | | | be used in printing correct location where the exception occurred. Closes #12885 - Without this the location of exception is always the line on which 'eval' is called - But if the exception occurs in a gem outside of Rails, then that location is not printed in stacktrace
* load the file rather than evalingAaron Patterson2013-06-171-1/+1
|
* Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. ↵Jeremy Kemper2013-01-061-1/+1
| | | | Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
* Add ENV['RACK_ENV'] support to rake runner/console/server.kennyj2012-12-061-1/+1
|
* Refactor config abort message a bit for dbconsoleCarlos Antonio da Silva2012-11-181-1/+1
| | | | | | Remove not used variable. Remove config attr_reader causing warning. Fix indent in runner file.
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-1/+1
|
* Add support runner hook.kennyj2012-05-291-0/+1
|
* Fix `rails db -h` and cosmetic fixes in usage bannersAlexey Vakhov2012-05-221-1/+1
| | | | | | | Ruby tries to use '-h' as short version of '--header' by default https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1372-1381. To force `rails db -h` prints an usage message we should add the `-h` options explicitly.
* Remove unused assignmentsMark Rushakoff2012-04-291-1/+0
|
* make 'rails runner' show usage when run without any optionsVijay Dev2011-06-101-0/+4
|
* Use all in place of find(:all)Vijay Dev2011-05-101-1/+1
|
* Always flush logger at exitJason Rudolph2011-05-061-14/+8
| | | | | | | | | | | | | | Prior to this change, running code via script/runner would demonstrate different logging behavior than running the same code via a rake task. In production mode the script/runner approach would always flush the logger, but the rake-based approach would not automatically flush the logger. This discrepancy violates the principle of least surprise, and it could lead to the loss of important production logging data. This change removes special-case code in the "runner" command, and replaces it with a general solution to ensure that the logger gets flushed at exit. This solution works for "runner", "console", "server", rake tasks, and any other process that loads the Rails environment.
* Send 'rails runner' help message to stdout instead of stderr.rohit2010-09-191-1/+1
| | | | | | [#5661 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Fix output of 'rails runner --help' [#4249 state:open]rohit2010-09-181-1/+1
|
* Config is deprecated on 1.8.8 and 1.9.3 use RbConfigSantiago Pastorino2010-08-231-1/+1
|
* Avoid calls to Rails::Application since this is not the official API.José Valim2010-07-011-1/+1
| | | | Your application should *always* reference your application const (as Blog::Application) and Rails.application should be used just internally.
* Rails Runner now sets $0 and $PROGRAM_NAME to name of file being run [#2244 ↵rohit2010-06-221-0/+1
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* The rake task :environment now loads config/environment.rb instead of ↵José Valim2010-04-291-1/+2
| | | | initializing the application on its own. This fixes [#4492 state:resolved] and also avoids the application being initialized twice in some rake tasks.
* Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [#4477 state:resolved]Anil Wadghule2010-04-261-1/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix regexp typoJeremy Kemper2010-04-131-1/+1
|
* Make RUBY_PLATFORM windows regex consistent [#4345 state:resolved]Anil Wadghule2010-04-121-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* rails runner loads environment after parsing command-line optionsJeremy Kemper2010-02-091-0/+2
|
* Rename usage path to command to just the command nameDavid Heinemeier Hansson2010-02-021-1/+1
|
* Get everyone running on Rails.env and fix the broken environment settings ↵David Heinemeier Hansson2010-01-111-1/+0
| | | | for script/console and script/dbconsole
* script/runner should require environmentJoshua Peek2009-10-161-2/+0
|
* Use Rails.initialize! where we just want to run the initializers and aren't ↵Joshua Peek2009-10-161-1/+1
| | | | concerned about the config
* Have config/application.rb contain the application definition and require ↵Carl Lerche2009-10-151-1/+1
| | | | that file instead of config/boot.rb or config/environment.rb in script/*.
* Move railties/lib/* into railties/lib/*Yehuda Katz + Carl Lerche2009-09-241-0/+54