Sha256: 06a99b8baf7c275cd70319ffe500999ea483f2b9d67aac08e4ac6380de88554f

Contents?: true

Size: 444 Bytes

Versions: 6

Compression:

Stored size: 444 Bytes

Contents

module Keyrack
  module Store
    class SSH
      def initialize(options)
        @host = options['host']
        @user = options['user']
        @path = options['path']
      end

      def read
        begin
          Net::SCP.download!(@host, @user, @path)
        rescue Net::SCP::Error
          nil
        end
      end

      def write(data)
        Net::SCP.upload!(@host, @user, StringIO.new(data), @path)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
keyrack-0.2.2 lib/keyrack/store/ssh.rb
keyrack-0.2.1 lib/keyrack/store/ssh.rb
keyrack-0.2.0 lib/keyrack/store/ssh.rb
keyrack-0.1.3 lib/keyrack/store/ssh.rb
keyrack-0.1.2 lib/keyrack/store/ssh.rb
keyrack-0.1.1 lib/keyrack/store/ssh.rb