Sha256: f336e3194e484a8d7e251ec1df512f704ef87be05ca51224dfd0ca2ba54c1fc6

Contents?: true

Size: 698 Bytes

Versions: 137

Compression:

Stored size: 698 Bytes

Contents

# TODO: Send patches to Specinfra

module Specinfra
  module Backend
    class Base
      def receive_file(from, to = nil)
        raise NotImplementedError
      end
    end

    class Exec < Base
      def receive_file(from, to = nil)
        if to
          FileUtils.cp(from, to)
        else
          ::File.read(from)
        end
      end
    end

    class Ssh < Exec
      def receive_file(from, to = nil)
        scp_download!(from, to)
      end

      private

      def scp_download!(from, to, opt={})
        if get_config(:scp).nil?
          set_config(:scp, create_scp)
        end

        scp = get_config(:scp)
        scp.download!(from, to, opt)
      end
    end
  end
end

Version data entries

137 entries across 94 versions & 2 rubygems

Version Path
itamae-1.9.6.pre lib/itamae/ext/specinfra.rb
itamae-mitsurin-0.24 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.24 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.23 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.23 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.22 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.22 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.21 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.21 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.20 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.20 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.19 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.19 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.18 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.18 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.17 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.17 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.16 test/test_itamae-mitsurin/ext/test_specinfra.rb
itamae-mitsurin-0.16 lib/itamae-mitsurin/ext/specinfra.rb
itamae-mitsurin-0.15 lib/itamae-mitsurin/ext/specinfra.rb