Finish Rails-ifying the tree. Adds missing files and directories and
brings a few miscellaneous files up to date.
This commit is contained in:
parent
503aa99c63
commit
50343b79e8
15 changed files with 2776 additions and 338 deletions
29
script/runner
Executable file
29
script/runner
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/ruby1.8
|
||||
require 'optparse'
|
||||
|
||||
options = { :environment => "development" }
|
||||
|
||||
ARGV.options do |opts|
|
||||
script_name = File.basename($0)
|
||||
opts.banner = "Usage: runner 'puts Person.find(1).name' [options]"
|
||||
|
||||
opts.separator ""
|
||||
|
||||
opts.on("-e", "--environment=name", String,
|
||||
"Specifies the environment for the runner to operate under (test/development/production).",
|
||||
"Default: development") { |options[:environment]| }
|
||||
|
||||
opts.separator ""
|
||||
|
||||
opts.on("-h", "--help",
|
||||
"Show this help message.") { puts opts; exit }
|
||||
|
||||
opts.parse!
|
||||
end
|
||||
|
||||
ENV["RAILS_ENV"] = options[:environment]
|
||||
|
||||
#!/usr/local/bin/ruby
|
||||
|
||||
require File.dirname(__FILE__) + '/../config/environment'
|
||||
eval(ARGV.first)
|
Loading…
Add table
Add a link
Reference in a new issue