Class: PipelineToolkit::Cucumber::Machine

Inherits:
IOProcess
  • Object
show all
Includes:
PipelineIO
Defined in:
lib/pipeline_toolkit/cucumber/machine.rb

Overview

Provides an interface for running and interacting with a pipeline_toolkit machine.

Instance Attribute Summary collapse

Attributes included from PipelineIO

#all_messages

Instance Method Summary collapse

Methods included from PipelineIO

#get_messages, #input_messages

Methods inherited from IOProcess

#get_output, #pid, #running?

Instance Attribute Details

#use_acknowledgementsObject (readonly)

Returns the value of attribute use_acknowledgements.



11
12
13
# File 'lib/pipeline_toolkit/cucumber/machine.rb', line 11

def use_acknowledgements
  @use_acknowledgements
end

Instance Method Details

#get_acknowledged_messages(number, timeout = 5) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/pipeline_toolkit/cucumber/machine.rb', line 25

def get_acknowledged_messages(number, timeout = 5)
  output_msgs = []
  get_lines(@sys_pipe, number, timeout) do |line|
    msg = MessageCoder.decode(line)
    output_msgs << msg
  end
  output_msgs
  @messages_to_ack.values_at( *output_msgs.map { |msg| msg[:ack_id] } )
end

#killObject



20
21
22
23
# File 'lib/pipeline_toolkit/cucumber/machine.rb', line 20

def kill
  destroy_sys_pipe
  super
end

#run(command, use_acknowledgements = true, path = "bin") ⇒ Object



13
14
15
16
17
18
# File 'lib/pipeline_toolkit/cucumber/machine.rb', line 13

def run(command, use_acknowledgements = true, path = "bin")
  super(command, path)

  @use_acknowledgements = use_acknowledgements
  setup_system        
end