Sha256: 68387ff358bc7db56c4ad97e7665dc3cc33a72b1ae6a1cc7bff27bb29b9240ed

Contents?: true

Size: 906 Bytes

Versions: 4

Compression:

Stored size: 906 Bytes

Contents

require 'rspec-system'

module RSpecSystem::Helpers
  # Helper object behind RSpecSystem::Helpers#shell
  class Rcp < RSpecSystem::Helper
    name 'rcp'
    properties :success

    def initialize(opts, clr, &block)
      ns = rspec_system_node_set
      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)

      super(opts, clr, &block)
    end

    # Gathers new results by executing the resource action
    def execute
      ns = rspec_system_node_set
      d = opts[:d]
      sp = opts[:sp]
      dp = opts[:dp]

      log.info("rcp from #{sp} to #{d.name}:#{dp} executed")
      result = ns.rcp(opts)
      { :success => result }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-system-2.1.2 lib/rspec-system/helpers/rcp.rb
rspec-system-2.1.1 lib/rspec-system/helpers/rcp.rb
rspec-system-2.1.0 lib/rspec-system/helpers/rcp.rb
rspec-system-2.0.0 lib/rspec-system/helpers/rcp.rb