Sha256: 082217c8769562a272e9498e704b5692b1996ebf2449bc690c2dd5507d858399

Contents?: true

Size: 338 Bytes

Versions: 32

Compression:

Stored size: 338 Bytes

Contents

require "foreman"

class Foreman::Utils

  def self.parse_concurrency(concurrency)
    @concurrency ||= begin
      pairs = concurrency.to_s.gsub(/\s/, "").split(",")
      pairs.inject(Hash.new(1)) do |hash, pair|
        process, amount = pair.split("=")
        hash.update(process => amount.to_i)        
      end
    end
  end

end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
foreman-0.25.0 lib/foreman/utils.rb
foreman-0.24.0 lib/foreman/utils.rb
foreman-0.23.1 lib/foreman/utils.rb
foreman-0.22.0 lib/foreman/utils.rb
foreman-0.21.0 lib/foreman/utils.rb
HeSYINUvSBZfxqA-foreman-0.20.0 lib/foreman/utils.rb
foreman-0.20.0 lib/foreman/utils.rb
foreman-0.19.0 lib/foreman/utils.rb
foreman-0.18.0 lib/foreman/utils.rb
foreman-0.17.0 lib/foreman/utils.rb
foreman-0.16.0 lib/foreman/utils.rb
foreman-0.15.0 lib/foreman/utils.rb
foreman-0.14.0 lib/foreman/utils.rb
foreman-0.13.1 lib/foreman/utils.rb
foreman-0.13.0 lib/foreman/utils.rb
foreman-0.12.0 lib/foreman/utils.rb
foreman-0.12.0.pre1 lib/foreman/utils.rb
foreman-0.11.1 lib/foreman/utils.rb
foreman-0.11.0 lib/foreman/utils.rb
foreman-0.10.1 lib/foreman/utils.rb