use bundler, rails 3 style

This commit is contained in:
John Bintz 2011-08-27 15:20:59 -04:00
parent 94b73ee426
commit 06387cb1e6
3 changed files with 6 additions and 5 deletions

View File

@ -12,7 +12,7 @@ begin
gem.authors = ["Nick Gauthier"] gem.authors = ["Nick Gauthier"]
gem.add_development_dependency "shoulda", "= 2.10.3" gem.add_development_dependency "shoulda", "= 2.10.3"
gem.add_development_dependency "rspec", "~> 2.6.0" gem.add_development_dependency "rspec", "~> 2.6.0"
gem.add_development_dependency "rspec-core", ">= 2.6.4" gem.add_development_dependency "rspec-core", "= 2.6.4"
gem.add_development_dependency "cucumber", "= 0.9.2" gem.add_development_dependency "cucumber", "= 0.9.2"
gem.add_development_dependency "therubyracer", "= 0.7.4" gem.add_development_dependency "therubyracer", "= 0.7.4"
end end

View File

@ -101,7 +101,6 @@ Gem::Specification.new do |s|
s.specification_version = 3 s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<hydra>, [">= 0"])
s.add_development_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_development_dependency(%q<cucumber>, ["= 0.9.2"]) s.add_development_dependency(%q<cucumber>, ["= 0.9.2"])
s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
@ -115,7 +114,6 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<cucumber>, ["= 0.9.2"]) s.add_development_dependency(%q<cucumber>, ["= 0.9.2"])
s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
else else
s.add_dependency(%q<hydra>, [">= 0"])
s.add_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_dependency(%q<cucumber>, ["= 0.9.2"]) s.add_dependency(%q<cucumber>, ["= 0.9.2"])
s.add_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
@ -130,7 +128,6 @@ Gem::Specification.new do |s|
s.add_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
end end
else else
s.add_dependency(%q<hydra>, [">= 0"])
s.add_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_dependency(%q<cucumber>, ["= 0.9.2"]) s.add_dependency(%q<cucumber>, ["= 0.9.2"])
s.add_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_dependency(%q<therubyracer>, ["= 0.7.4"])

View File

@ -177,7 +177,7 @@ module Hydra #:nodoc:
if sync.result == 0 if sync.result == 0
runners = worker.fetch('runners') { raise "You must specify the number of runners" } runners = worker.fetch('runners') { raise "You must specify the number of runners" }
command = worker.fetch('command') { command = worker.fetch('command') {
"RAILS_ENV=#{@environment} bundle exec ruby -e \"load 'config/application.rb'; require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose}, :runner_listeners => \'#{@string_runner_event_listeners}\', :runner_log_file => \'#{@runner_log_file}\', :options => {} );\"" "RAILS_ENV=#{@environment} #{bundler? ? "bundle exec" : ""} ruby -e \"require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose}, :runner_listeners => \'#{@string_runner_event_listeners}\', :runner_log_file => \'#{@runner_log_file}\', :options => {} );\""
} }
trace "Booting SSH worker" trace "Booting SSH worker"
@ -189,6 +189,10 @@ module Hydra #:nodoc:
end end
end end
def bundler?
File.file?('Gemfile')
end
def shutdown_all_workers def shutdown_all_workers
trace "Shutting down all workers" trace "Shutting down all workers"
@workers.each do |worker| @workers.each do |worker|