Class: Devup::Compose::V1::Processes
- Inherits:
-
Object
- Object
- Devup::Compose::V1::Processes
- Defined in:
- lib/devup/compose/v1/processes.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(output) ⇒ Processes
constructor
A new instance of Processes.
- #port_mapping(port) ⇒ Object
- #up? ⇒ Boolean
Constructor Details
#initialize(output) ⇒ Processes
Returns a new instance of Processes.
8 9 10 |
# File 'lib/devup/compose/v1/processes.rb', line 8 def initialize(output) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/devup/compose/v1/processes.rb', line 7 def output @output end |
Instance Method Details
#port_mapping(port) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/devup/compose/v1/processes.rb', line 18 def port_mapping(port) m = output.match(/\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}:(\d+)->#{port}\/tcp/) return PortMapping.new(port, nil) if m.nil? PortMapping.new(port, m[1].to_i) end |
#up? ⇒ Boolean
12 13 14 15 16 |
# File 'lib/devup/compose/v1/processes.rb', line 12 def up? service_lines.map { |line| line.match(/Up/) && !line.match(/Exit/) }.all? end |