Skip to content

Commit

Permalink
[BUG] ARGV was not passed into config.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex P committed Mar 8, 2008
1 parent 1d5e9e5 commit a2f38c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/backgroundrb/bdrb_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module BackgrounDRb
end

class BackgrounDRb::Config
def self.parse_cmd_options
def self.parse_cmd_options(argv)
require 'optparse'
options = { :environment => (ENV['RAILS_ENV'] || "development").dup }

Expand All @@ -19,7 +19,7 @@ def self.parse_cmd_options
opts.separator ""
opts.on("-v","--version",
"Show version.") { $stderr.puts "1.0.3"; exit }
end.parse!
end.parse!(argv)

ENV["RAILS_ENV"] = options[:environment]
RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV)
Expand Down
2 changes: 1 addition & 1 deletion script/backgroundrb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require RAILS_HOME + '/config/boot.rb'

# parse CLI options and set RAILS_ENV before loading RoR environment
require "bdrb_config.rb"
BackgrounDRb::Config.parse_cmd_options
BackgrounDRb::Config.parse_cmd_options ARGV

require RAILS_HOME + '/config/environment'
require "rubygems"
Expand Down

0 comments on commit a2f38c9

Please sign in to comment.