From 06387cb1e6b240298703b6fa4b865e7dde3e846b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sat, 27 Aug 2011 15:20:59 -0400 Subject: [PATCH] use bundler, rails 3 style --- Rakefile | 2 +- hydra.gemspec | 3 --- lib/hydra/master.rb | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index a010308..2e390d2 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ begin gem.authors = ["Nick Gauthier"] gem.add_development_dependency "shoulda", "= 2.10.3" 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 "therubyracer", "= 0.7.4" end diff --git a/hydra.gemspec b/hydra.gemspec index 01c9784..2c3b2b7 100644 --- a/hydra.gemspec +++ b/hydra.gemspec @@ -101,7 +101,6 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) s.add_development_dependency(%q, ["= 2.10.3"]) s.add_development_dependency(%q, ["= 0.9.2"]) s.add_development_dependency(%q, ["= 0.7.4"]) @@ -115,7 +114,6 @@ Gem::Specification.new do |s| s.add_development_dependency(%q, ["= 0.9.2"]) s.add_development_dependency(%q, ["= 0.7.4"]) else - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, ["= 2.10.3"]) s.add_dependency(%q, ["= 0.9.2"]) s.add_dependency(%q, ["= 0.7.4"]) @@ -130,7 +128,6 @@ Gem::Specification.new do |s| s.add_dependency(%q, ["= 0.7.4"]) end else - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, ["= 2.10.3"]) s.add_dependency(%q, ["= 0.9.2"]) s.add_dependency(%q, ["= 0.7.4"]) diff --git a/lib/hydra/master.rb b/lib/hydra/master.rb index a0e6365..9820f78 100644 --- a/lib/hydra/master.rb +++ b/lib/hydra/master.rb @@ -177,7 +177,7 @@ module Hydra #:nodoc: if sync.result == 0 runners = worker.fetch('runners') { raise "You must specify the number of runners" } 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" @@ -189,6 +189,10 @@ module Hydra #:nodoc: end end + def bundler? + File.file?('Gemfile') + end + def shutdown_all_workers trace "Shutting down all workers" @workers.each do |worker|