keyrack 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +17 -16
- data/VERSION +1 -1
- data/lib/keyrack/store/ssh.rb +9 -2
- data/test/keyrack/store/test_ssh.rb +15 -7
- metadata +78 -111
- data/.tmux.conf +0 -2
data/Gemfile.lock
CHANGED
@@ -3,30 +3,31 @@ GEM
|
|
3
3
|
specs:
|
4
4
|
builder (3.0.0)
|
5
5
|
copier (1.3)
|
6
|
-
cucumber (
|
6
|
+
cucumber (1.1.4)
|
7
7
|
builder (>= 2.1.2)
|
8
|
-
diff-lcs (
|
9
|
-
gherkin (~> 2.
|
10
|
-
json (
|
11
|
-
term-ansicolor (
|
12
|
-
diff-lcs (1.1.
|
13
|
-
gherkin (2.
|
14
|
-
json (
|
8
|
+
diff-lcs (>= 1.1.2)
|
9
|
+
gherkin (~> 2.7.1)
|
10
|
+
json (>= 1.4.6)
|
11
|
+
term-ansicolor (>= 1.0.6)
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
gherkin (2.7.1)
|
14
|
+
json (>= 1.4.6)
|
15
15
|
git (1.2.5)
|
16
|
-
highline (1.6.
|
16
|
+
highline (1.6.9)
|
17
17
|
jeweler (1.5.2)
|
18
18
|
bundler (~> 1.0.0)
|
19
19
|
git (>= 1.2.5)
|
20
20
|
rake
|
21
|
-
json (1.4
|
22
|
-
|
23
|
-
|
21
|
+
json (1.6.4)
|
22
|
+
metaclass (0.0.1)
|
23
|
+
mocha (0.10.0)
|
24
|
+
metaclass (~> 0.0.1)
|
24
25
|
net-scp (1.0.4)
|
25
26
|
net-ssh (>= 1.99.1)
|
26
|
-
net-ssh (2.
|
27
|
-
rake (0.
|
28
|
-
rcov (0.9.
|
29
|
-
term-ansicolor (1.0.
|
27
|
+
net-ssh (2.2.1)
|
28
|
+
rake (0.9.2.2)
|
29
|
+
rcov (0.9.11)
|
30
|
+
term-ansicolor (1.0.7)
|
30
31
|
|
31
32
|
PLATFORMS
|
32
33
|
ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/keyrack/store/ssh.rb
CHANGED
@@ -5,18 +5,25 @@ module Keyrack
|
|
5
5
|
@host = options['host']
|
6
6
|
@user = options['user']
|
7
7
|
@path = options['path']
|
8
|
+
@port = options['port'] || 22
|
8
9
|
end
|
9
10
|
|
10
11
|
def read
|
11
12
|
begin
|
12
|
-
|
13
|
+
result = nil
|
14
|
+
Net::SSH.start(@host, @user, :port => @port) do |ssh|
|
15
|
+
result = ssh.scp.download!(@path)
|
16
|
+
end
|
17
|
+
result
|
13
18
|
rescue Net::SCP::Error
|
14
19
|
nil
|
15
20
|
end
|
16
21
|
end
|
17
22
|
|
18
23
|
def write(data)
|
19
|
-
Net::
|
24
|
+
Net::SSH.start(@host, @user, :port => @port) do |ssh|
|
25
|
+
ssh.scp.upload!(StringIO.new(data), @path)
|
26
|
+
end
|
20
27
|
end
|
21
28
|
end
|
22
29
|
end
|
@@ -4,23 +4,31 @@ module Keyrack
|
|
4
4
|
module Store
|
5
5
|
class TestSSH < Test::Unit::TestCase
|
6
6
|
def test_read
|
7
|
-
store = SSH.new('host' => 'example.com', 'user' => 'dude', 'path' => 'foo.txt')
|
8
|
-
|
7
|
+
store = SSH.new('host' => 'example.com', 'user' => 'dude', 'port' => 22, 'path' => 'foo.txt')
|
8
|
+
scp = mock('scp session')
|
9
|
+
scp.expects(:download!).with("foo.txt").returns("foo")
|
10
|
+
session = mock('ssh session', :scp => scp)
|
11
|
+
Net::SSH.expects(:start).with('example.com', 'dude', :port => 22).yields(session)
|
9
12
|
assert_equal "foo", store.read
|
10
13
|
end
|
11
14
|
|
12
15
|
def test_write
|
13
16
|
store = SSH.new('host' => 'example.com', 'user' => 'dude', 'path' => 'foo.txt')
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
scp = mock('scp session')
|
18
|
+
session = mock('ssh session', :scp => scp)
|
19
|
+
Net::SSH.expects(:start).with('example.com', 'dude', :port => 22).yields(session)
|
20
|
+
scp.expects(:upload!).with do |local, remote|
|
21
|
+
local.is_a?(StringIO) && local.read == "foo" && remote == "foo.txt"
|
17
22
|
end
|
18
23
|
store.write("foo")
|
19
24
|
end
|
20
25
|
|
21
26
|
def test_read_returns_nil_for_non_existant_file
|
22
|
-
store = SSH.new('host' => 'example.com', 'user' => 'dude', 'path' => 'foo.txt')
|
23
|
-
|
27
|
+
store = SSH.new('host' => 'example.com', 'user' => 'dude', 'port' => 22, 'path' => 'foo.txt')
|
28
|
+
scp = mock('scp session')
|
29
|
+
scp.expects(:download!).with("foo.txt").raises(Net::SCP::Error)
|
30
|
+
session = mock('ssh session', :scp => scp)
|
31
|
+
Net::SSH.expects(:start).with('example.com', 'dude', :port => 22).yields(session)
|
24
32
|
assert_nil store.read
|
25
33
|
end
|
26
34
|
end
|
metadata
CHANGED
@@ -1,144 +1,116 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: keyrack
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 2
|
9
|
-
version: 0.2.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Jeremy Stephens
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-01-01 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: net-scp
|
22
|
-
requirement: &
|
16
|
+
requirement: &28232780 !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
23
|
prerelease: false
|
32
|
-
version_requirements: *
|
33
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *28232780
|
25
|
+
- !ruby/object:Gem::Dependency
|
34
26
|
name: highline
|
35
|
-
requirement: &
|
27
|
+
requirement: &28231960 !ruby/object:Gem::Requirement
|
36
28
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
- 0
|
42
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
43
33
|
type: :runtime
|
44
34
|
prerelease: false
|
45
|
-
version_requirements: *
|
46
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *28231960
|
36
|
+
- !ruby/object:Gem::Dependency
|
47
37
|
name: copier
|
48
|
-
requirement: &
|
38
|
+
requirement: &28231280 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
- 0
|
55
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
56
44
|
type: :runtime
|
57
45
|
prerelease: false
|
58
|
-
version_requirements: *
|
59
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *28231280
|
47
|
+
- !ruby/object:Gem::Dependency
|
60
48
|
name: bundler
|
61
|
-
requirement: &
|
49
|
+
requirement: &28230680 !ruby/object:Gem::Requirement
|
62
50
|
none: false
|
63
|
-
requirements:
|
51
|
+
requirements:
|
64
52
|
- - ~>
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
segments:
|
67
|
-
- 1
|
68
|
-
- 0
|
69
|
-
- 0
|
53
|
+
- !ruby/object:Gem::Version
|
70
54
|
version: 1.0.0
|
71
55
|
type: :development
|
72
56
|
prerelease: false
|
73
|
-
version_requirements: *
|
74
|
-
- !ruby/object:Gem::Dependency
|
57
|
+
version_requirements: *28230680
|
58
|
+
- !ruby/object:Gem::Dependency
|
75
59
|
name: jeweler
|
76
|
-
requirement: &
|
60
|
+
requirement: &28230000 !ruby/object:Gem::Requirement
|
77
61
|
none: false
|
78
|
-
requirements:
|
62
|
+
requirements:
|
79
63
|
- - ~>
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
segments:
|
82
|
-
- 1
|
83
|
-
- 5
|
84
|
-
- 1
|
64
|
+
- !ruby/object:Gem::Version
|
85
65
|
version: 1.5.1
|
86
66
|
type: :development
|
87
67
|
prerelease: false
|
88
|
-
version_requirements: *
|
89
|
-
- !ruby/object:Gem::Dependency
|
68
|
+
version_requirements: *28230000
|
69
|
+
- !ruby/object:Gem::Dependency
|
90
70
|
name: rcov
|
91
|
-
requirement: &
|
71
|
+
requirement: &28229280 !ruby/object:Gem::Requirement
|
92
72
|
none: false
|
93
|
-
requirements:
|
94
|
-
- -
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
|
97
|
-
- 0
|
98
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
99
77
|
type: :development
|
100
78
|
prerelease: false
|
101
|
-
version_requirements: *
|
102
|
-
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: *28229280
|
80
|
+
- !ruby/object:Gem::Dependency
|
103
81
|
name: mocha
|
104
|
-
requirement: &
|
82
|
+
requirement: &28216480 !ruby/object:Gem::Requirement
|
105
83
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
- 0
|
111
|
-
version: "0"
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
112
88
|
type: :development
|
113
89
|
prerelease: false
|
114
|
-
version_requirements: *
|
115
|
-
- !ruby/object:Gem::Dependency
|
90
|
+
version_requirements: *28216480
|
91
|
+
- !ruby/object:Gem::Dependency
|
116
92
|
name: cucumber
|
117
|
-
requirement: &
|
93
|
+
requirement: &28215980 !ruby/object:Gem::Requirement
|
118
94
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
- 0
|
124
|
-
version: "0"
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
125
99
|
type: :development
|
126
100
|
prerelease: false
|
127
|
-
version_requirements: *
|
101
|
+
version_requirements: *28215980
|
128
102
|
description: Simple password manager with local/remote database storage and RSA encryption.
|
129
103
|
email: viking@pillageandplunder.net
|
130
|
-
executables:
|
104
|
+
executables:
|
131
105
|
- keyrack
|
132
106
|
extensions: []
|
133
|
-
|
134
|
-
extra_rdoc_files:
|
107
|
+
extra_rdoc_files:
|
135
108
|
- LICENSE.txt
|
136
109
|
- README.rdoc
|
137
110
|
- TODO
|
138
|
-
files:
|
111
|
+
files:
|
139
112
|
- .document
|
140
113
|
- .rvmrc
|
141
|
-
- .tmux.conf
|
142
114
|
- Gemfile
|
143
115
|
- Gemfile.lock
|
144
116
|
- LICENSE.txt
|
@@ -172,40 +144,35 @@ files:
|
|
172
144
|
- test/keyrack/test_store.rb
|
173
145
|
- test/keyrack/test_utils.rb
|
174
146
|
- test/keyrack/ui/test_console.rb
|
175
|
-
has_rdoc: true
|
176
147
|
homepage: http://github.com/viking/keyrack
|
177
|
-
licenses:
|
148
|
+
licenses:
|
178
149
|
- MIT
|
179
150
|
post_install_message:
|
180
151
|
rdoc_options: []
|
181
|
-
|
182
|
-
require_paths:
|
152
|
+
require_paths:
|
183
153
|
- lib
|
184
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
155
|
none: false
|
186
|
-
requirements:
|
187
|
-
- -
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
|
190
|
-
segments:
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
segments:
|
191
161
|
- 0
|
192
|
-
|
193
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
hash: -3699145682324095706
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
164
|
none: false
|
195
|
-
requirements:
|
196
|
-
- -
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
|
199
|
-
- 0
|
200
|
-
version: "0"
|
165
|
+
requirements:
|
166
|
+
- - ! '>='
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
201
169
|
requirements: []
|
202
|
-
|
203
170
|
rubyforge_project:
|
204
|
-
rubygems_version: 1.
|
171
|
+
rubygems_version: 1.8.10
|
205
172
|
signing_key:
|
206
173
|
specification_version: 3
|
207
174
|
summary: Simple password manager
|
208
|
-
test_files:
|
175
|
+
test_files:
|
209
176
|
- test/helper.rb
|
210
177
|
- test/keyrack/store/test_filesystem.rb
|
211
178
|
- test/keyrack/store/test_ssh.rb
|
data/.tmux.conf
DELETED