class IIB::Node::CLI

Attributes

name[R]

Public Class Methods

new(options) click to toggle source
# File lib/iib/node/CLI.rb, line 26
def initialize(options)
  @name = options[:name]
end

Public Instance Methods

==(other_object) click to toggle source
# File lib/iib/node/CLI.rb, line 53
def ==(other_object)
  return name == other_object.name
end
is_running() click to toggle source
# File lib/iib/node/CLI.rb, line 30
def is_running
  IIB.check_local_iib_environment
  iib_list = Mixlib::ShellOut.new("iib list")
  iib_list.run_command

  iib_list.stdout.lines.each do |line|
    return true if line =~ /^BIP1325I.*'#{name}'.*$/
    return false if line =~ /^BIP1326I.*'#{name}'.*$/
  end
end
start() click to toggle source
# File lib/iib/node/CLI.rb, line 41
def start 
  IIB.check_local_iib_environment
  iib_start = Mixlib::ShellOut.new("iib start #{name}")
  iib_start.run_command
end
stop() click to toggle source
# File lib/iib/node/CLI.rb, line 47
def stop
  IIB.check_local_iib_environment
  iib_stop = Mixlib::ShellOut.new("iib stop #{name}")
  iib_stop.run_command
end

Private Instance Methods

strip_mqsi_command_response(stdout) click to toggle source
# File lib/iib/node/CLI.rb, line 59
def strip_mqsi_command_response(stdout)
  matches = stdout =~ /^.*\n(.*)\n.*$/
end