Permalink
Browse files

Cleaned up whitespace and added utf-8 tags.

  • Loading branch information...
1 parent 04dfb6e commit b4ecbc8c7b1c4006d48ce8b3d35bef5de9da8f0f Michael van Rooijen committed May 4, 2011
View
@@ -9,9 +9,9 @@ module HireFire
autoload :Version, 'hirefire/version'
class << self
-
+
attr_writer :configuration
-
+
##
# This method is used to configure HireFire
#
@@ -50,7 +50,7 @@ def configure
def configuration
@configuration ||= HireFire::Configuration.new
end
-
+
end
end
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module HireFire
module Backend
module DelayedJob
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module HireFire
module Backend
module Resque
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module HireFire
module Workers
autoload :DelayedJob, 'hirefire/workers/delayed_job'
View
@@ -197,10 +197,10 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :jobs => 5, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 0
-
+
HireFire::Logger.expects(:message).with('Hiring more workers so we have 3 in total.').once
base.expects(:workers).with(3).once
base.hire
@@ -213,7 +213,7 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :jobs => 5, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 3
@@ -229,7 +229,7 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :jobs => 5, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 0
@@ -328,7 +328,7 @@ def jobs=(amount)
config.max_workers = 3
base.jobs = 100
base.workers = 0
-
+
HireFire::Logger.expects(:message).with('Hiring more workers so we have 3 in total.').once
base.expects(:workers).with(3).once
base.hire
@@ -341,13 +341,13 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :when => lambda { |jobs| jobs < 5 }, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 0
-
+
HireFire::Logger.expects(:message).with('Hiring more workers so we have 3 in total.').once
base.expects(:workers).with(3).once
- base.hire
+ base.hire
end
end
@@ -357,10 +357,10 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :when => lambda { |jobs| jobs < 5 }, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 3
-
+
HireFire::Logger.expects(:message).with('Hiring more workers so we have 3 in total.').never
base.expects(:workers).with(3).never
base.hire
@@ -373,7 +373,7 @@ def jobs=(amount)
config.job_worker_ratio = [
{ :when => lambda { |jobs| jobs < 5 }, :workers => 5 }
]
-
+
base.jobs = 100
base.workers = 0
@@ -1,23 +1,25 @@
+# encoding: utf-8
+
module ConfigurationHelper
def configure(&block)
HireFire.configure(&block)
end
-
+
def with_configuration(&block)
old_configuration = HireFire.configuration
HireFire.configuration = HireFire::Configuration.new
yield(HireFire.configuration)
ensure
HireFire.configuration = old_configuration
end
-
+
def with_max_workers(workers, &block)
with_configuration do |config|
config.max_workers = workers
yield
end
end
-
+
def with_min_workers(workers, &block)
with_configuration do |config|
config.min_workers = workers

0 comments on commit b4ecbc8

Please sign in to comment.