aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/commands/runner/USAGE
blob: 24b60037f0b81c875b3c6ba4c2b161bc548753a9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                         


                                                          
                              





                                                                           
Examples:

Run `puts Rails.env` after loading the app:

  <%= executable %> 'puts Rails.env'

Run the Ruby file located at `path/to/filename.rb` after loading the app:

  <%= executable %> path/to/filename.rb

Run the Ruby script read from stdin after loading the app:
  <%= executable %> -

<% unless Gem.win_platform? %>
You can also use the runner command as a shebang line for your executables:

  #!/usr/bin/env <%= File.expand_path(executable) %>

  Product.all.each { |p| p.price *= 2 ; p.save! }
<% end %>