HeSYINUvSBZfxqA-foreman 0.20.0 → 0.20.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/foreman/cli.rb CHANGED
@@ -12,6 +12,7 @@ class Foreman::CLI < Thor
12
12
 
13
13
  method_option :env, :type => :string, :aliases => "-e", :desc => "Specify an environment file to load, defaults to .env"
14
14
  method_option :port, :type => :numeric, :aliases => "-p"
15
+ method_option :min, :type => :numeric, :aliases => "-m"
15
16
  method_option :concurrency, :type => :string, :aliases => "-c", :banner => '"alpha=5,bar=3"'
16
17
 
17
18
  def start(process=nil)
@@ -85,7 +85,7 @@ class Foreman::Engine
85
85
  private ######################################################################
86
86
 
87
87
  def fork(process, options={}, environment={})
88
- concurrency = Foreman::Utils.parse_concurrency(options[:concurrency])
88
+ concurrency = Foreman::Utils.parse_concurrency(options[:concurrency], options[:min] || 1)
89
89
 
90
90
  1.upto(concurrency[process.name]) do |num|
91
91
  fork_individual(process, num, port_for(process, num, options[:port]), environment)
data/lib/foreman/utils.rb CHANGED
@@ -2,12 +2,12 @@ require "foreman"
2
2
 
3
3
  class Foreman::Utils
4
4
 
5
- def self.parse_concurrency(concurrency)
5
+ def self.parse_concurrency(concurrency, min=1)
6
6
  @concurrency ||= begin
7
7
  pairs = concurrency.to_s.gsub(/\s/, "").split(",")
8
- pairs.inject(Hash.new(1)) do |hash, pair|
8
+ pairs.inject(Hash.new(min)) do |hash, pair|
9
9
  process, amount = pair.split("=")
10
- hash.update(process => amount.to_i)
10
+ hash.update(process => amount.to_i)
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.20.0"
3
+ VERSION = "0.20.0.1"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HeSYINUvSBZfxqA-foreman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 79
4
+ hash: 237
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 20
9
9
  - 0
10
- version: 0.20.0
10
+ - 1
11
+ version: 0.20.0.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - David Dollar