Skip to content

Commit

Permalink
ddollarGH-268 Added parsing of ports variables while initialzing process
Browse files Browse the repository at this point in the history
  • Loading branch information
padcom committed Sep 26, 2012
1 parent 8998e9a commit 434e282
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/foreman/process.rb
Expand Up @@ -5,6 +5,7 @@ class Foreman::Process

attr_reader :command
attr_reader :env
attr_reader :ports

# Create a Process
#
Expand All @@ -19,6 +20,11 @@ def initialize(command, options={})
@options = options.dup

@options[:env] ||= {}

# parse list of ports needed for this command
@ports = @command.scan(/\$(PORT[0-9]?)/)
@ports = [ "PORT" ] if @ports.length == 0
@ports = @ports.flatten.uniq
end

# Get environment-expanded command for a +Process+
Expand Down

0 comments on commit 434e282

Please sign in to comment.