ssh 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +1 -0
- data/lib/ssh.rb +1 -1
- data/lib/ssh_test.rb +52 -0
- data/test/test_ssh.rb +1 -49
- metadata +19 -18
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/ssh.rb
CHANGED
data/lib/ssh_test.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require "ssh"
|
2
|
+
require 'stringio'
|
3
|
+
|
4
|
+
class StringIO
|
5
|
+
def readpartial(size) read end # suck!
|
6
|
+
end
|
7
|
+
|
8
|
+
module Process
|
9
|
+
def self.expected status
|
10
|
+
@@expected ||= []
|
11
|
+
@@expected << status
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
alias :waitpid2_old :waitpid2
|
16
|
+
|
17
|
+
def waitpid2(pid)
|
18
|
+
[ @@expected.shift ]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module FakePOpen
|
24
|
+
attr_accessor :commands, :action, :input, :output, :error
|
25
|
+
|
26
|
+
class Status < Struct.new :exitstatus
|
27
|
+
def success?() exitstatus == 0 end
|
28
|
+
end
|
29
|
+
|
30
|
+
def popen4 *command
|
31
|
+
@commands << command
|
32
|
+
|
33
|
+
@input = StringIO.new
|
34
|
+
out = StringIO.new @output.shift.to_s
|
35
|
+
err = StringIO.new @error.shift.to_s
|
36
|
+
|
37
|
+
raise if block_given?
|
38
|
+
|
39
|
+
status = self.action ? self.action[command.join(' ')] : 0
|
40
|
+
Process.expected Status.new(status)
|
41
|
+
|
42
|
+
return 42, @input, out, err
|
43
|
+
end
|
44
|
+
|
45
|
+
def select reads, writes, errs, timeout
|
46
|
+
[reads, writes, errs]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class SSH
|
51
|
+
include FakePOpen
|
52
|
+
end
|
data/test/test_ssh.rb
CHANGED
@@ -1,53 +1,5 @@
|
|
1
1
|
require "minitest/autorun"
|
2
|
-
require "
|
3
|
-
|
4
|
-
require 'stringio'
|
5
|
-
|
6
|
-
class StringIO
|
7
|
-
def readpartial(size) read end # suck!
|
8
|
-
end
|
9
|
-
|
10
|
-
module Process
|
11
|
-
def self.expected status
|
12
|
-
@@expected ||= []
|
13
|
-
@@expected << status
|
14
|
-
end
|
15
|
-
|
16
|
-
class << self
|
17
|
-
alias :waitpid2_old :waitpid2
|
18
|
-
|
19
|
-
def waitpid2(pid)
|
20
|
-
[ @@expected.shift ]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class SSH
|
26
|
-
attr_accessor :commands, :action, :input, :output, :error
|
27
|
-
|
28
|
-
class Status < Struct.new :exitstatus
|
29
|
-
def success?() exitstatus == 0 end
|
30
|
-
end
|
31
|
-
|
32
|
-
def popen4 *command
|
33
|
-
@commands << command
|
34
|
-
|
35
|
-
@input = StringIO.new
|
36
|
-
out = StringIO.new @output.shift.to_s
|
37
|
-
err = StringIO.new @error.shift.to_s
|
38
|
-
|
39
|
-
raise if block_given?
|
40
|
-
|
41
|
-
status = self.action ? self.action[command.join(' ')] : 0
|
42
|
-
Process.expected Status.new(status)
|
43
|
-
|
44
|
-
return 42, @input, out, err
|
45
|
-
end
|
46
|
-
|
47
|
-
def select reads, writes, errs, timeout
|
48
|
-
[reads, writes, errs]
|
49
|
-
end
|
50
|
-
end
|
2
|
+
require "ssh_test"
|
51
3
|
|
52
4
|
class TestSSH < MiniTest::Unit::TestCase
|
53
5
|
def setup
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date:
|
39
|
+
date: 2012-11-09 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: open4
|
@@ -54,33 +54,33 @@ dependencies:
|
|
54
54
|
type: :runtime
|
55
55
|
version_requirements: *id001
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: minitest
|
58
58
|
prerelease: false
|
59
59
|
requirement: &id002 !ruby/object:Gem::Requirement
|
60
60
|
none: false
|
61
61
|
requirements:
|
62
62
|
- - ~>
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
hash:
|
64
|
+
hash: 31
|
65
65
|
segments:
|
66
|
-
-
|
67
|
-
-
|
68
|
-
version: "
|
66
|
+
- 4
|
67
|
+
- 2
|
68
|
+
version: "4.2"
|
69
69
|
type: :development
|
70
70
|
version_requirements: *id002
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
72
|
+
name: rdoc
|
73
73
|
prerelease: false
|
74
74
|
requirement: &id003 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 19
|
80
80
|
segments:
|
81
|
-
-
|
82
|
-
-
|
83
|
-
version: "
|
81
|
+
- 3
|
82
|
+
- 10
|
83
|
+
version: "3.10"
|
84
84
|
type: :development
|
85
85
|
version_requirements: *id003
|
86
86
|
- !ruby/object:Gem::Dependency
|
@@ -91,11 +91,11 @@ dependencies:
|
|
91
91
|
requirements:
|
92
92
|
- - ~>
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
94
|
+
hash: 3
|
95
95
|
segments:
|
96
|
+
- 3
|
96
97
|
- 2
|
97
|
-
|
98
|
-
version: "2.12"
|
98
|
+
version: "3.2"
|
99
99
|
type: :development
|
100
100
|
version_requirements: *id004
|
101
101
|
description: |-
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- README.txt
|
124
124
|
- Rakefile
|
125
125
|
- lib/ssh.rb
|
126
|
+
- lib/ssh_test.rb
|
126
127
|
- test/test_ssh.rb
|
127
128
|
- .gemtest
|
128
129
|
homepage: https://github.com/seattlerb/ssh
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
requirements: []
|
156
157
|
|
157
158
|
rubyforge_project: ssh
|
158
|
-
rubygems_version: 1.8.
|
159
|
+
rubygems_version: 1.8.24
|
159
160
|
signing_key:
|
160
161
|
specification_version: 3
|
161
162
|
summary: SSH provides a simple streaming ssh command runner
|
metadata.gz.sig
CHANGED
Binary file
|