keyrack 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,30 +3,31 @@ GEM
3
3
  specs:
4
4
  builder (3.0.0)
5
5
  copier (1.3)
6
- cucumber (0.10.0)
6
+ cucumber (1.1.4)
7
7
  builder (>= 2.1.2)
8
- diff-lcs (~> 1.1.2)
9
- gherkin (~> 2.3.2)
10
- json (~> 1.4.6)
11
- term-ansicolor (~> 1.0.5)
12
- diff-lcs (1.1.2)
13
- gherkin (2.3.3)
14
- json (~> 1.4.6)
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.1)
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.6)
22
- mocha (0.9.10)
23
- rake
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.0.23)
27
- rake (0.8.7)
28
- rcov (0.9.9)
29
- term-ansicolor (1.0.5)
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.2
1
+ 0.2.3
@@ -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
- Net::SCP.download!(@host, @user, @path)
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::SCP.upload!(@host, @user, StringIO.new(data), @path)
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
- Net::SCP.expects(:download!).with("example.com", "dude", "foo.txt").returns("foo")
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
- Net::SCP.expects(:upload!).with do |host, user, local, remote|
15
- host == 'example.com' && user == 'dude' && local.is_a?(StringIO) &&
16
- local.read == "foo" && remote == "foo.txt"
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
- Net::SCP.expects(:download!).with("example.com", "dude", "foo.txt").raises(Net::SCP::Error)
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
- prerelease: false
5
- segments:
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
- date: 2011-01-18 00:00:00 -06:00
18
- default_executable: keyrack
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: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &28232780 !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
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: *id001
33
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *28232780
25
+ - !ruby/object:Gem::Dependency
34
26
  name: highline
35
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &28231960 !ruby/object:Gem::Requirement
36
28
  none: false
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
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: *id002
46
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *28231960
36
+ - !ruby/object:Gem::Dependency
47
37
  name: copier
48
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &28231280 !ruby/object:Gem::Requirement
49
39
  none: false
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- segments:
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: *id003
59
- - !ruby/object:Gem::Dependency
46
+ version_requirements: *28231280
47
+ - !ruby/object:Gem::Dependency
60
48
  name: bundler
61
- requirement: &id004 !ruby/object:Gem::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: *id004
74
- - !ruby/object:Gem::Dependency
57
+ version_requirements: *28230680
58
+ - !ruby/object:Gem::Dependency
75
59
  name: jeweler
76
- requirement: &id005 !ruby/object:Gem::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: *id005
89
- - !ruby/object:Gem::Dependency
68
+ version_requirements: *28230000
69
+ - !ruby/object:Gem::Dependency
90
70
  name: rcov
91
- requirement: &id006 !ruby/object:Gem::Requirement
71
+ requirement: &28229280 !ruby/object:Gem::Requirement
92
72
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- segments:
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: *id006
102
- - !ruby/object:Gem::Dependency
79
+ version_requirements: *28229280
80
+ - !ruby/object:Gem::Dependency
103
81
  name: mocha
104
- requirement: &id007 !ruby/object:Gem::Requirement
82
+ requirement: &28216480 !ruby/object:Gem::Requirement
105
83
  none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- segments:
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: *id007
115
- - !ruby/object:Gem::Dependency
90
+ version_requirements: *28216480
91
+ - !ruby/object:Gem::Dependency
116
92
  name: cucumber
117
- requirement: &id008 !ruby/object:Gem::Requirement
93
+ requirement: &28215980 !ruby/object:Gem::Requirement
118
94
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- segments:
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: *id008
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
- hash: -2578800290968079459
190
- segments:
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ segments:
191
161
  - 0
192
- version: "0"
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
- segments:
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.3.7
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
@@ -1,2 +0,0 @@
1
- neww -n 'autotest' 'autotest'
2
- neww -n 'vim' 'vim'