Merge branch 'master' of https://github.com/michaeldwan/foreman into feature/concurrency

Conflicts:
	spec/foreman/engine_spec.rb
	spec/foreman/export/bluepill_spec.rb
	spec/resources/export/bluepill/app.pill
This commit is contained in:
Matt Griffin
2012-01-16 17:18:14 -05:00
6 changed files with 76 additions and 29 deletions
+4 -1
View File
@@ -5,7 +5,10 @@ class Foreman::Utils
def self.parse_concurrency(concurrency)
begin
pairs = concurrency.to_s.gsub(/\s/, "").split(",")
pairs.inject(Hash.new(1)) do |hash, pair|
default = concurrency.nil? ? 1 : 0
pairs.inject(Hash.new(default)) do |hash, pair|
process, amount = pair.split("=")
hash.update(process => amount.to_i)
end