net-ssh-net-ssh 2.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +137 -0
- data/Manifest +104 -0
- data/README.rdoc +110 -0
- data/Rakefile +79 -0
- data/THANKS.rdoc +16 -0
- data/lib/net/ssh.rb +215 -0
- data/lib/net/ssh/authentication/agent.rb +176 -0
- data/lib/net/ssh/authentication/constants.rb +18 -0
- data/lib/net/ssh/authentication/key_manager.rb +193 -0
- data/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
- data/lib/net/ssh/authentication/methods/password.rb +39 -0
- data/lib/net/ssh/authentication/methods/publickey.rb +92 -0
- data/lib/net/ssh/authentication/pageant.rb +183 -0
- data/lib/net/ssh/authentication/session.rb +134 -0
- data/lib/net/ssh/buffer.rb +340 -0
- data/lib/net/ssh/buffered_io.rb +149 -0
- data/lib/net/ssh/config.rb +181 -0
- data/lib/net/ssh/connection/channel.rb +625 -0
- data/lib/net/ssh/connection/constants.rb +33 -0
- data/lib/net/ssh/connection/session.rb +596 -0
- data/lib/net/ssh/connection/term.rb +178 -0
- data/lib/net/ssh/errors.rb +85 -0
- data/lib/net/ssh/key_factory.rb +102 -0
- data/lib/net/ssh/known_hosts.rb +129 -0
- data/lib/net/ssh/loggable.rb +61 -0
- data/lib/net/ssh/packet.rb +102 -0
- data/lib/net/ssh/prompt.rb +93 -0
- data/lib/net/ssh/proxy/errors.rb +14 -0
- data/lib/net/ssh/proxy/http.rb +94 -0
- data/lib/net/ssh/proxy/socks4.rb +70 -0
- data/lib/net/ssh/proxy/socks5.rb +129 -0
- data/lib/net/ssh/ruby_compat.rb +7 -0
- data/lib/net/ssh/service/forward.rb +267 -0
- data/lib/net/ssh/test.rb +89 -0
- data/lib/net/ssh/test/channel.rb +129 -0
- data/lib/net/ssh/test/extensions.rb +152 -0
- data/lib/net/ssh/test/kex.rb +44 -0
- data/lib/net/ssh/test/local_packet.rb +51 -0
- data/lib/net/ssh/test/packet.rb +81 -0
- data/lib/net/ssh/test/remote_packet.rb +38 -0
- data/lib/net/ssh/test/script.rb +157 -0
- data/lib/net/ssh/test/socket.rb +59 -0
- data/lib/net/ssh/transport/algorithms.rb +384 -0
- data/lib/net/ssh/transport/cipher_factory.rb +84 -0
- data/lib/net/ssh/transport/constants.rb +30 -0
- data/lib/net/ssh/transport/hmac.rb +31 -0
- data/lib/net/ssh/transport/hmac/abstract.rb +78 -0
- data/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/lib/net/ssh/transport/kex.rb +13 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
- data/lib/net/ssh/transport/openssl.rb +128 -0
- data/lib/net/ssh/transport/packet_stream.rb +230 -0
- data/lib/net/ssh/transport/server_version.rb +69 -0
- data/lib/net/ssh/transport/session.rb +276 -0
- data/lib/net/ssh/transport/state.rb +206 -0
- data/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/lib/net/ssh/verifiers/null.rb +12 -0
- data/lib/net/ssh/verifiers/strict.rb +53 -0
- data/lib/net/ssh/version.rb +62 -0
- data/net-ssh.gemspec +128 -0
- data/setup.rb +1585 -0
- data/test/authentication/methods/common.rb +28 -0
- data/test/authentication/methods/test_abstract.rb +51 -0
- data/test/authentication/methods/test_hostbased.rb +114 -0
- data/test/authentication/methods/test_keyboard_interactive.rb +98 -0
- data/test/authentication/methods/test_password.rb +50 -0
- data/test/authentication/methods/test_publickey.rb +127 -0
- data/test/authentication/test_agent.rb +205 -0
- data/test/authentication/test_key_manager.rb +105 -0
- data/test/authentication/test_session.rb +93 -0
- data/test/common.rb +106 -0
- data/test/configs/eqsign +3 -0
- data/test/configs/exact_match +8 -0
- data/test/configs/wild_cards +14 -0
- data/test/connection/test_channel.rb +452 -0
- data/test/connection/test_session.rb +488 -0
- data/test/test_all.rb +6 -0
- data/test/test_buffer.rb +336 -0
- data/test/test_buffered_io.rb +63 -0
- data/test/test_config.rb +84 -0
- data/test/test_key_factory.rb +67 -0
- data/test/transport/hmac/test_md5.rb +39 -0
- data/test/transport/hmac/test_md5_96.rb +25 -0
- data/test/transport/hmac/test_none.rb +34 -0
- data/test/transport/hmac/test_sha1.rb +34 -0
- data/test/transport/hmac/test_sha1_96.rb +25 -0
- data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/test/transport/test_algorithms.rb +302 -0
- data/test/transport/test_cipher_factory.rb +171 -0
- data/test/transport/test_hmac.rb +34 -0
- data/test/transport/test_identity_cipher.rb +40 -0
- data/test/transport/test_packet_stream.rb +435 -0
- data/test/transport/test_server_version.rb +68 -0
- data/test/transport/test_session.rb +315 -0
- data/test/transport/test_state.rb +173 -0
- metadata +162 -0
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
=== (unreleased)
|
2
|
+
|
3
|
+
* Use unbuffered reads when negotiating the protocol version [Steven Hazel]
|
4
|
+
|
5
|
+
|
6
|
+
=== 2.0.12 / 08 Jun 2009
|
7
|
+
|
8
|
+
* Applied patch for arcfour128 and arcfour256 support [Denis Bernard]
|
9
|
+
|
10
|
+
|
11
|
+
=== 2.0.11 / 24 Feb 2009
|
12
|
+
|
13
|
+
* Add :key_data option for specifying raw private keys in PEM format [Alex Holems, Andrew Babkin]
|
14
|
+
|
15
|
+
|
16
|
+
=== 2.0.10 / 4 Feb 2009
|
17
|
+
|
18
|
+
* Added Net::SSH.configuration_for to make it easier to query the SSH configuration file(s) [Jamis Buck]
|
19
|
+
|
20
|
+
|
21
|
+
=== 2.0.9 / 1 Feb 2009
|
22
|
+
|
23
|
+
* Specifying non-nil user argument overrides user in .ssh/config [Jamis Buck]
|
24
|
+
|
25
|
+
* Ignore requests for non-existent channels (workaround ssh server bug) [Jamis Buck]
|
26
|
+
|
27
|
+
* Add terminate! method for hard shutdown scenarios [Jamis Buck]
|
28
|
+
|
29
|
+
* Revert to pre-2.0.7 key-loading behavior by default, but load private-key if public-key doesn't exist [Jamis Buck]
|
30
|
+
|
31
|
+
* Make sure :passphrase option gets passed to key manager [Bob Cotton]
|
32
|
+
|
33
|
+
|
34
|
+
=== 2.0.8 / 29 December 2008
|
35
|
+
|
36
|
+
* Fix private key change from 2.0.7 so that keys are loaded just-in-time, avoiding unecessary prompts from encrypted keys. [Jamis Buck]
|
37
|
+
|
38
|
+
|
39
|
+
=== 2.0.7 / 29 December 2008
|
40
|
+
|
41
|
+
* Make key manager use private keys instead of requiring public key to exist [arilerner@mac.com]
|
42
|
+
|
43
|
+
* Fix failing tests [arilerner@mac.com]
|
44
|
+
|
45
|
+
* Don't include pageant when running under JRuby [Angel N. Sciortino]
|
46
|
+
|
47
|
+
|
48
|
+
=== 2.0.6 / 6 December 2008
|
49
|
+
|
50
|
+
* Update the Manifest file so that the gem includes all necessary files [Jamis Buck]
|
51
|
+
|
52
|
+
|
53
|
+
=== 2.0.5 / 6 December 2008
|
54
|
+
|
55
|
+
* Make the Pageant interface comply with more of the Socket interface to avoid related errors [Jamis Buck]
|
56
|
+
|
57
|
+
* Don't busy-wait on session close for remaining channels to close [Will Bryant]
|
58
|
+
|
59
|
+
* Ruby 1.9 compatibility [Jamis Buck]
|
60
|
+
|
61
|
+
* Fix Cipher#final to correctly flag a need for a cipher reset [Jamis Buck]
|
62
|
+
|
63
|
+
|
64
|
+
=== 2.0.4 / 27 Aug 2008
|
65
|
+
|
66
|
+
* Added Connection::Session#closed? and Transport::Session#closed? [Jamis Buck]
|
67
|
+
|
68
|
+
* Numeric host names in .ssh/config are now parsed correct [Yanko Ivanov]
|
69
|
+
|
70
|
+
* Make sure the error raised when a public key file is malformed is more informative than a MethodMissing error [Jamis Buck]
|
71
|
+
|
72
|
+
* Cipher#reset is now called after Cipher#final, with the last n bytes used as the next initialization vector [Jamis Buck]
|
73
|
+
|
74
|
+
|
75
|
+
=== 2.0.3 / 27 Jun 2008
|
76
|
+
|
77
|
+
* Make Net::SSH::Version comparable [Brian Candler]
|
78
|
+
|
79
|
+
* Fix errors in port forwarding when a channel could not be opened due to a typo in the exception name [Matthew Todd]
|
80
|
+
|
81
|
+
* Use #chomp instead of #strip when cleaning the version string reported by the remote host, so that trailing whitespace is preserved (this is to play nice with servers like Mocana SSH) [Timo Gatsonides]
|
82
|
+
|
83
|
+
* Correctly parse ssh_config entries with eq-sign delimiters [Jamis Buck]
|
84
|
+
|
85
|
+
* Ignore malformed ssh_config entries [Jamis Buck]
|
86
|
+
|
87
|
+
=== 2.0.2 / 29 May 2008
|
88
|
+
|
89
|
+
* Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
|
90
|
+
|
91
|
+
* Fixed key truncation bug that caused hmacs other than SHA1 to fail with "corrupt hmac" errors [Jamis Buck]
|
92
|
+
|
93
|
+
* Fix detection and loading of public keys when the keys don't actually exist [David Dollar]
|
94
|
+
|
95
|
+
|
96
|
+
=== 2.0.1 / 5 May 2008
|
97
|
+
|
98
|
+
* Teach Net::SSH about a handful of default key names [Jamis Buck]
|
99
|
+
|
100
|
+
|
101
|
+
=== 2.0.0 / 1 May 2008
|
102
|
+
|
103
|
+
* Allow the :verbose argument to accept symbols (:debug, etc.) as well as Logger level constants (Logger::DEBUG, etc.) [Jamis Buck]
|
104
|
+
|
105
|
+
|
106
|
+
=== 2.0 Preview Release 4 (1.99.3) / 19 Apr 2008
|
107
|
+
|
108
|
+
* Make sure HOME is set to something sane, even on OS's that don't set it by default [Jamis Buck]
|
109
|
+
|
110
|
+
* Add a :passphrase option to specify the passphrase to use with private keys [Francis Sullivan]
|
111
|
+
|
112
|
+
* Open a new auth agent connection for every auth-agent channel request [Jamis Buck]
|
113
|
+
|
114
|
+
|
115
|
+
=== 2.0 Preview Release 3 (1.99.2) / 10 Apr 2008
|
116
|
+
|
117
|
+
* Session properties [Jamis Buck]
|
118
|
+
|
119
|
+
* Make channel open failure work with a callback so that failures can be handled similarly to successes [Jamis Buck]
|
120
|
+
|
121
|
+
|
122
|
+
=== 2.0 Preview Release 2 (1.99.1) / 22 Mar 2008
|
123
|
+
|
124
|
+
* Partial support for ~/.ssh/config (and related) SSH configuration files [Daniel J. Berger, Jamis Buck]
|
125
|
+
|
126
|
+
* Added Net::SSH::Test to facilitate testing complex SSH state machines [Jamis Buck]
|
127
|
+
|
128
|
+
* Reworked Net::SSH::Prompt to use conditionally-selected modules [Jamis Buck, suggested by James Rosen]
|
129
|
+
|
130
|
+
* Added Channel#eof? and Channel#eof! [Jamis Buck]
|
131
|
+
|
132
|
+
* Fixed bug in strict host key verifier on cache miss [Mike Timm]
|
133
|
+
|
134
|
+
|
135
|
+
=== 2.0 Preview Release 1 (1.99.0) / 21 Aug 2007
|
136
|
+
|
137
|
+
* First preview release of Net::SSH v2
|
data/Manifest
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
CHANGELOG.rdoc
|
2
|
+
Manifest
|
3
|
+
README.rdoc
|
4
|
+
Rakefile
|
5
|
+
THANKS.rdoc
|
6
|
+
lib/net/ssh.rb
|
7
|
+
lib/net/ssh/authentication/agent.rb
|
8
|
+
lib/net/ssh/authentication/constants.rb
|
9
|
+
lib/net/ssh/authentication/key_manager.rb
|
10
|
+
lib/net/ssh/authentication/methods/abstract.rb
|
11
|
+
lib/net/ssh/authentication/methods/hostbased.rb
|
12
|
+
lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
13
|
+
lib/net/ssh/authentication/methods/password.rb
|
14
|
+
lib/net/ssh/authentication/methods/publickey.rb
|
15
|
+
lib/net/ssh/authentication/pageant.rb
|
16
|
+
lib/net/ssh/authentication/session.rb
|
17
|
+
lib/net/ssh/buffer.rb
|
18
|
+
lib/net/ssh/buffered_io.rb
|
19
|
+
lib/net/ssh/config.rb
|
20
|
+
lib/net/ssh/connection/channel.rb
|
21
|
+
lib/net/ssh/connection/constants.rb
|
22
|
+
lib/net/ssh/connection/session.rb
|
23
|
+
lib/net/ssh/connection/term.rb
|
24
|
+
lib/net/ssh/errors.rb
|
25
|
+
lib/net/ssh/key_factory.rb
|
26
|
+
lib/net/ssh/known_hosts.rb
|
27
|
+
lib/net/ssh/loggable.rb
|
28
|
+
lib/net/ssh/packet.rb
|
29
|
+
lib/net/ssh/prompt.rb
|
30
|
+
lib/net/ssh/proxy/errors.rb
|
31
|
+
lib/net/ssh/proxy/http.rb
|
32
|
+
lib/net/ssh/proxy/socks4.rb
|
33
|
+
lib/net/ssh/proxy/socks5.rb
|
34
|
+
lib/net/ssh/ruby_compat.rb
|
35
|
+
lib/net/ssh/service/forward.rb
|
36
|
+
lib/net/ssh/test.rb
|
37
|
+
lib/net/ssh/test/channel.rb
|
38
|
+
lib/net/ssh/test/extensions.rb
|
39
|
+
lib/net/ssh/test/kex.rb
|
40
|
+
lib/net/ssh/test/local_packet.rb
|
41
|
+
lib/net/ssh/test/packet.rb
|
42
|
+
lib/net/ssh/test/remote_packet.rb
|
43
|
+
lib/net/ssh/test/script.rb
|
44
|
+
lib/net/ssh/test/socket.rb
|
45
|
+
lib/net/ssh/transport/algorithms.rb
|
46
|
+
lib/net/ssh/transport/cipher_factory.rb
|
47
|
+
lib/net/ssh/transport/constants.rb
|
48
|
+
lib/net/ssh/transport/hmac.rb
|
49
|
+
lib/net/ssh/transport/hmac/abstract.rb
|
50
|
+
lib/net/ssh/transport/hmac/md5.rb
|
51
|
+
lib/net/ssh/transport/hmac/md5_96.rb
|
52
|
+
lib/net/ssh/transport/hmac/none.rb
|
53
|
+
lib/net/ssh/transport/hmac/sha1.rb
|
54
|
+
lib/net/ssh/transport/hmac/sha1_96.rb
|
55
|
+
lib/net/ssh/transport/identity_cipher.rb
|
56
|
+
lib/net/ssh/transport/kex.rb
|
57
|
+
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
58
|
+
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
59
|
+
lib/net/ssh/transport/openssl.rb
|
60
|
+
lib/net/ssh/transport/packet_stream.rb
|
61
|
+
lib/net/ssh/transport/server_version.rb
|
62
|
+
lib/net/ssh/transport/session.rb
|
63
|
+
lib/net/ssh/transport/state.rb
|
64
|
+
lib/net/ssh/verifiers/lenient.rb
|
65
|
+
lib/net/ssh/verifiers/null.rb
|
66
|
+
lib/net/ssh/verifiers/strict.rb
|
67
|
+
lib/net/ssh/version.rb
|
68
|
+
net-ssh.gemspec
|
69
|
+
setup.rb
|
70
|
+
test/authentication/methods/common.rb
|
71
|
+
test/authentication/methods/test_abstract.rb
|
72
|
+
test/authentication/methods/test_hostbased.rb
|
73
|
+
test/authentication/methods/test_keyboard_interactive.rb
|
74
|
+
test/authentication/methods/test_password.rb
|
75
|
+
test/authentication/methods/test_publickey.rb
|
76
|
+
test/authentication/test_agent.rb
|
77
|
+
test/authentication/test_key_manager.rb
|
78
|
+
test/authentication/test_session.rb
|
79
|
+
test/common.rb
|
80
|
+
test/configs/eqsign
|
81
|
+
test/configs/exact_match
|
82
|
+
test/configs/wild_cards
|
83
|
+
test/connection/test_channel.rb
|
84
|
+
test/connection/test_session.rb
|
85
|
+
test/test_all.rb
|
86
|
+
test/test_buffer.rb
|
87
|
+
test/test_buffered_io.rb
|
88
|
+
test/test_config.rb
|
89
|
+
test/test_key_factory.rb
|
90
|
+
test/transport/hmac/test_md5.rb
|
91
|
+
test/transport/hmac/test_md5_96.rb
|
92
|
+
test/transport/hmac/test_none.rb
|
93
|
+
test/transport/hmac/test_sha1.rb
|
94
|
+
test/transport/hmac/test_sha1_96.rb
|
95
|
+
test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
96
|
+
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
97
|
+
test/transport/test_algorithms.rb
|
98
|
+
test/transport/test_cipher_factory.rb
|
99
|
+
test/transport/test_hmac.rb
|
100
|
+
test/transport/test_identity_cipher.rb
|
101
|
+
test/transport/test_packet_stream.rb
|
102
|
+
test/transport/test_server_version.rb
|
103
|
+
test/transport/test_session.rb
|
104
|
+
test/transport/test_state.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
= Net::SSH
|
2
|
+
|
3
|
+
* http://net-ssh.rubyforge.org/ssh
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.
|
8
|
+
|
9
|
+
== FEATURES:
|
10
|
+
|
11
|
+
* Execute processes on remote servers and capture their output
|
12
|
+
* Run multiple processes in parallel over a single SSH connection
|
13
|
+
* Support for SSH subsystems
|
14
|
+
* Forward local and remote ports via an SSH connection
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
In a nutshell:
|
19
|
+
|
20
|
+
require 'net/ssh'
|
21
|
+
|
22
|
+
Net::SSH.start('host', 'user', :password => "password") do |ssh|
|
23
|
+
# capture all stderr and stdout output from a remote process
|
24
|
+
output = ssh.exec!("hostname")
|
25
|
+
|
26
|
+
# capture only stdout matching a particular pattern
|
27
|
+
stdout = ""
|
28
|
+
ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
|
29
|
+
stdout << data if stream == :stdout
|
30
|
+
end
|
31
|
+
puts stdout
|
32
|
+
|
33
|
+
# run multiple processes in parallel to completion
|
34
|
+
ssh.exec "sed ..."
|
35
|
+
ssh.exec "awk ..."
|
36
|
+
ssh.exec "rm -rf ..."
|
37
|
+
ssh.loop
|
38
|
+
|
39
|
+
# open a new channel and configure a minimal set of callbacks, then run
|
40
|
+
# the event loop until the channel finishes (closes)
|
41
|
+
channel = ssh.open_channel do |ch|
|
42
|
+
ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
|
43
|
+
raise "could not execute command" unless success
|
44
|
+
|
45
|
+
# "on_data" is called when the process writes something to stdout
|
46
|
+
ch.on_data do |c, data|
|
47
|
+
$STDOUT.print data
|
48
|
+
end
|
49
|
+
|
50
|
+
# "on_extended_data" is called when the process writes something to stderr
|
51
|
+
ch.on_extended_data do |c, type, data|
|
52
|
+
$STDERR.print data
|
53
|
+
end
|
54
|
+
|
55
|
+
ch.on_close { puts "done!" }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
channel.wait
|
60
|
+
|
61
|
+
# forward connections on local port 1234 to port 80 of www.capify.org
|
62
|
+
ssh.forward.local(1234, "www.capify.org", 80)
|
63
|
+
ssh.loop { true }
|
64
|
+
end
|
65
|
+
|
66
|
+
See Net::SSH for more documentation, and links to further information.
|
67
|
+
|
68
|
+
== REQUIREMENTS:
|
69
|
+
|
70
|
+
The only requirement you might be missing is the OpenSSL bindings for Ruby. These are built by default on most platforms, but you can verify that they're built and installed on your system by running the following command line:
|
71
|
+
|
72
|
+
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
73
|
+
|
74
|
+
If that spits out something like "OpenSSL 0.9.8g 19 Oct 2007", then you're set. If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support, or (if your platform supports it) installing the OpenSSL bindings separately.
|
75
|
+
|
76
|
+
Additionally: if you are going to be having Net::SSH prompt you for things like passwords or certificate passphrases, you'll want to have either the Highline (recommended) or Termios (unix systems only) gem installed, so that the passwords don't echo in clear text.
|
77
|
+
|
78
|
+
Lastly, if you want to run the tests or use any of the Rake tasks, you'll need:
|
79
|
+
|
80
|
+
* Echoe (for the Rakefile)
|
81
|
+
* Mocha (for the tests)
|
82
|
+
|
83
|
+
== INSTALL:
|
84
|
+
|
85
|
+
* gem install net-ssh (might need sudo privileges)
|
86
|
+
|
87
|
+
== LICENSE:
|
88
|
+
|
89
|
+
(The MIT License)
|
90
|
+
|
91
|
+
Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
|
92
|
+
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
94
|
+
a copy of this software and associated documentation files (the
|
95
|
+
'Software'), to deal in the Software without restriction, including
|
96
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
97
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
98
|
+
permit persons to whom the Software is furnished to do so, subject to
|
99
|
+
the following conditions:
|
100
|
+
|
101
|
+
The above copyright notice and this permission notice shall be
|
102
|
+
included in all copies or substantial portions of the Software.
|
103
|
+
|
104
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
105
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
106
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
107
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
108
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
109
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
110
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/gempackagetask'
|
4
|
+
require 'hanna/rdoctask'
|
5
|
+
require 'fileutils'
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
task :default => :package
|
9
|
+
|
10
|
+
# CONFIG =============================================================
|
11
|
+
|
12
|
+
# Change the following according to your needs
|
13
|
+
README = "README.rdoc"
|
14
|
+
CHANGES = "CHANGELOG.rdoc"
|
15
|
+
THANKS = 'THANKS.rdoc'
|
16
|
+
|
17
|
+
# Files and directories to be deleted when you run "rake clean"
|
18
|
+
CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
|
19
|
+
|
20
|
+
# Virginia assumes your project and gemspec have the same name
|
21
|
+
name = 'net-ssh'
|
22
|
+
load "#{name}.gemspec"
|
23
|
+
version = @spec.version
|
24
|
+
|
25
|
+
# That's it! The following defaults should allow you to get started
|
26
|
+
# on other things.
|
27
|
+
|
28
|
+
|
29
|
+
# TESTS/SPECS =========================================================
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
# INSTALL =============================================================
|
34
|
+
|
35
|
+
Rake::GemPackageTask.new(@spec) do |p|
|
36
|
+
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
37
|
+
end
|
38
|
+
|
39
|
+
task :release => [ :rdoc, :package ]
|
40
|
+
task :install => [ :rdoc, :package ] do
|
41
|
+
sh %{sudo gem install pkg/#{name}-#{version}.gem}
|
42
|
+
end
|
43
|
+
task :uninstall => [ :clean ] do
|
44
|
+
sh %{sudo gem uninstall #{name}}
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
|
49
|
+
|
50
|
+
if @spec.rubyforge_project
|
51
|
+
desc 'Publish website to rubyforge'
|
52
|
+
task 'publish:rdoc' => 'doc/index.html' do
|
53
|
+
sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
|
54
|
+
end
|
55
|
+
|
56
|
+
desc 'Public release to rubyforge'
|
57
|
+
task 'publish:gem' => [:package] do |t|
|
58
|
+
sh <<-end
|
59
|
+
rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
|
60
|
+
rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
# RUBY DOCS TASK ==================================
|
68
|
+
|
69
|
+
Rake::RDocTask.new do |t|
|
70
|
+
t.rdoc_dir = 'doc'
|
71
|
+
t.title = @spec.summary
|
72
|
+
t.options << '--line-numbers' << '-A cattr_accessor=object'
|
73
|
+
t.options << '--charset' << 'utf-8'
|
74
|
+
t.rdoc_files.include(README)
|
75
|
+
t.rdoc_files.include(CHANGES)
|
76
|
+
t.rdoc_files.include(THANKS)
|
77
|
+
t.rdoc_files.include('lib/**/*.rb')
|
78
|
+
end
|
79
|
+
|
data/THANKS.rdoc
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Net::SSH was originally written by Jamis Buck <jamis@37signals.com>. In
|
2
|
+
addition, the following individuals are gratefully acknowledged for their
|
3
|
+
contributions:
|
4
|
+
|
5
|
+
GOTOU Yuuzou <gotoyuzo@notwork.org>
|
6
|
+
* help and code related to OpenSSL
|
7
|
+
|
8
|
+
Guillaume Mar�ais <guillaume.marcais@free.fr>
|
9
|
+
* support for communicating with the the PuTTY "pageant" process
|
10
|
+
|
11
|
+
Daniel Berger <djberg96@yahoo.com>
|
12
|
+
* help getting unit tests in earlier Net::SSH versions to pass in Windows
|
13
|
+
* initial version of Net::SSH::Config provided inspiration and encouragement
|
14
|
+
|
15
|
+
Chris Andrews <chris@nodnol.org> and Lee Jensen <lee@outerim.com>
|
16
|
+
* support for ssh agent forwarding
|