Sha256: a403c31b9bda27bf2ae7f22e6d91ecfe72e5bb8ce63dc61f89aaf03a0dda3c7e

Contents?: true

Size: 321 Bytes

Versions: 14

Compression:

Stored size: 321 Bytes

Contents

require "foreman"

class Foreman::Utils

  def self.parse_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

14 entries across 14 versions & 1 rubygems

Version Path
foreman-0.34.1 lib/foreman/utils.rb
foreman-0.34.0 lib/foreman/utils.rb
foreman-0.33.1 lib/foreman/utils.rb
foreman-0.33.0 lib/foreman/utils.rb
foreman-0.32.0 lib/foreman/utils.rb
foreman-0.31.0 lib/foreman/utils.rb
foreman-0.30.1 lib/foreman/utils.rb
foreman-0.30.0 lib/foreman/utils.rb
foreman-0.29.0 lib/foreman/utils.rb
foreman-0.28.0.pre2 lib/foreman/utils.rb
foreman-0.28.0.pre1 lib/foreman/utils.rb
foreman-0.27.0 lib/foreman/utils.rb
foreman-0.26.1 lib/foreman/utils.rb
foreman-0.26.0 lib/foreman/utils.rb