Sha256: 9002677fba70f6b6b59a69a016084eea83fdde6321589df8b11f5da856a32517

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

require 'net/ssh'
require 'net/ssh/authentication/methods/keyboard_interactive'

module Net
  module SSH
    module AskPass
      module Prompt
        def prompt(text, echo=true)
          if ssh_askpass = ENV['SSH_ASKPASS']
            `#{ssh_askpass} "#{text}"`.strip
          else
            prompt_console text, echo
          end
        end
      end    
    end

    Authentication::Methods::KeyboardInteractive.class_eval do
      alias :prompt_console :prompt
      include Net::SSH::AskPass::Prompt
      alias :prompt_askpass :prompt
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
joekhoobyar-net-ssh-askpass-0.0.2 lib/net/ssh/askpass.rb
joekhoobyar-net-ssh-askpass-0.0.3 lib/net/ssh/askpass.rb
net-ssh-askpass-0.0.3 lib/net/ssh/askpass.rb