class RSpecSystem::Helpers::Rcp

Helper object behind RSpecSystem::Helpers#shell

Public Class Methods

new(opts, clr, &block) click to toggle source
Calls superclass method RSpecSystem::Helper::new
# File lib/rspec-system/helpers/rcp.rb, line 9
def initialize(opts, clr, &block)
  ns = RSpecSystem::NodeSet.create
  opts = {
    :source_path => opts[:sp],
    :destination_path => opts[:dp],
    :dp => opts[:destination_path],
    :sp => opts[:source_path],
    :destination_node => ns.default_node,
    :d => ns.default_node,
    :source_node => nil,
    :s => nil,
  }.merge(opts)

  # Try to figure out :*_node using the node helper if a string is passed
  if opts[:destination_node].is_a? String
    opts[:d] = opts[:destination_node] = get_node_by_name(opts[:destination_node])
  end
  if opts[:source_node].is_a? String
    opts[:s] = opts[:source_node] = get_node_by_name(opts[:source_node])
  end

  super(opts, clr, &block)
end

Public Instance Methods

execute() click to toggle source

Gathers new results by executing the resource action

# File lib/rspec-system/helpers/rcp.rb, line 34
def execute
  ns = RSpecSystem::NodeSet.create

  result = ns.rcp(opts)
  { :success => result }
end