net-ssh-askpass 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Joe Khoobyar
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ = net-ssh-askpass
2
+
3
+ Allows Net:SSH to use an external program to prompt for passwords, via the
4
+ SSH_ASKPASS environment variable.
5
+
6
+ == Usage
7
+
8
+ Simply set the SSH_ASKPASS environment variable and require 'net/ssh/askpass'.
9
+
10
+ == Copyright
11
+
12
+ Copyright (c) 2009 Joe Khoobyar. See LICENSE for details.
@@ -0,0 +1,93 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |s|
7
+ s.name = "net-ssh-askpass"
8
+ s.summary = %Q{Adds SSH_ASKPASS support to Net::SSH}
9
+ s.description = <<-EOTEXT
10
+ Allows Net:SSH to use an external program to prompt for passwords, via the
11
+ SSH_ASKPASS environment variable.
12
+ EOTEXT
13
+ s.email = "joe@ankhcraft.com"
14
+ s.homepage = "http://github.com/joekhoobyar/net-ssh-askpass"
15
+ s.authors = ["Joe Khoobyar"]
16
+ s.rubyforge_project = "net-ssh-askpass"
17
+
18
+ s.add_runtime_dependency(%q<net-ssh>, [">= 2.0"])
19
+
20
+ # s is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
+ end
22
+ rescue LoadError
23
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
24
+ end
25
+
26
+ require 'rake/testtask'
27
+ Rake::TestTask.new(:test) do |test|
28
+ test.libs << 'lib' << 'test'
29
+ test.pattern = 'test/**/*_test.rb'
30
+ test.verbose = true
31
+ end
32
+
33
+ begin
34
+ require 'rcov/rcovtask'
35
+ Rcov::RcovTask.new do |test|
36
+ test.libs << 'test'
37
+ test.pattern = 'test/**/*_test.rb'
38
+ test.verbose = true
39
+ end
40
+ rescue LoadError
41
+ task :rcov do
42
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
43
+ end
44
+ end
45
+
46
+ # These are new tasks
47
+ begin
48
+ require 'rake/contrib/sshpublisher'
49
+ namespace :rubyforge do
50
+
51
+ desc "Release gem and RDoc documentation to RubyForge"
52
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
53
+
54
+ namespace :release do
55
+ desc "Publish RDoc to RubyForge."
56
+ task :docs => [:rdoc] do
57
+ config = YAML.load(
58
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
59
+ )
60
+
61
+ host = "#{config['username']}@rubyforge.org"
62
+ remote_dir = "/var/www/gforge-projects/net-ssh-askpass/"
63
+ local_dir = 'doc'
64
+
65
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
66
+ end
67
+ end
68
+ end
69
+ rescue LoadError
70
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
71
+ end
72
+
73
+
74
+ task :default => :test
75
+
76
+ require 'rake/rdoctask'
77
+ Rake::RDocTask.new do |rdoc|
78
+ if File.exist?('VERSION.yml')
79
+ config = YAML.load(File.read('VERSION.yml'))
80
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
81
+ else
82
+ version = ""
83
+ end
84
+ rdoc.options << '--line-numbers' << '--inline-source' <<
85
+ '--main' << 'README.rdoc' <<
86
+ '--charset' << 'utf-8'
87
+
88
+ rdoc.rdoc_dir = 'doc'
89
+ rdoc.title = "Net::SSH::AskPass #{version}"
90
+ rdoc.rdoc_files.include('README*')
91
+ rdoc.rdoc_files.include('lib/**/*.rb')
92
+ end
93
+
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 3
@@ -0,0 +1,24 @@
1
+ require 'net/ssh'
2
+ require 'net/ssh/authentication/methods/keyboard_interactive'
3
+
4
+ module Net
5
+ module SSH
6
+ module AskPass
7
+ module Prompt
8
+ def prompt(text, echo=true)
9
+ if ssh_askpass = ENV['SSH_ASKPASS']
10
+ `#{ssh_askpass} "#{text}"`.strip
11
+ else
12
+ prompt_console text, echo
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ Authentication::Methods::KeyboardInteractive.class_eval do
19
+ alias :prompt_console :prompt
20
+ include Net::SSH::AskPass::Prompt
21
+ alias :prompt_askpass :prompt
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class NetSshAskpassTest < Test::Unit::TestCase
4
+ def test_bogus
5
+ assert true
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
6
+ require 'net/ssh/askpass'
7
+
8
+ class Test::Unit::TestCase
9
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: net-ssh-askpass
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Joe Khoobyar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-29 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: net-ssh
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "2.0"
24
+ version:
25
+ description: |
26
+ Allows Net:SSH to use an external program to prompt for passwords, via the
27
+ SSH_ASKPASS environment variable.
28
+
29
+ email: joe@ankhcraft.com
30
+ executables: []
31
+
32
+ extensions: []
33
+
34
+ extra_rdoc_files:
35
+ - LICENSE
36
+ - README.rdoc
37
+ files:
38
+ - LICENSE
39
+ - README.rdoc
40
+ - Rakefile
41
+ - VERSION.yml
42
+ - lib/net/ssh/askpass.rb
43
+ - test/net_ssh_askpass_test.rb
44
+ - test/test_helper.rb
45
+ has_rdoc: true
46
+ homepage: http://github.com/joekhoobyar/net-ssh-askpass
47
+ licenses: []
48
+
49
+ post_install_message:
50
+ rdoc_options:
51
+ - --charset=UTF-8
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ version:
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: "0"
65
+ version:
66
+ requirements: []
67
+
68
+ rubyforge_project: net-ssh-askpass
69
+ rubygems_version: 1.3.3
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Adds SSH_ASKPASS support to Net::SSH
73
+ test_files:
74
+ - test/net_ssh_askpass_test.rb
75
+ - test/test_helper.rb