Sha256: 8336a7f813c034234dbd90f7acc5d4fe1d94db32bcb69a8bb37cdecd8786fb96

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

module SpecInfra
  module Helper
    ['Exec', 'Ssh', 'Cmd', 'WinRM'].each do |backend|
      eval <<-EOF
        module #{backend}
          def backend(commands_object=nil)
            if ! respond_to?(:commands)
              commands_object = self.class.const_get(SPEC_TYPE).const_get('Commands').const_get('Base').new
            end
            instance = self.class.const_get('SpecInfra').const_get('Backend').const_get('#{backend}').instance
            instance.set_commands(commands_object || commands)
            instance
          end
        end
      EOF
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
specinfra-0.0.2 lib/specinfra/helper/backend.rb