osp 0.2.0 → 0.3.0.pre.dev.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7800ccd69d8e4045f39ef0e9192c03799848a94d
4
- data.tar.gz: f5826cfda6a244cfef3f710c3e03921b7d762e25
3
+ metadata.gz: 29a7260e8467924c0cfb61511807d2562a1dc102
4
+ data.tar.gz: 8d47df4ac02c3a0be9c129a370c415c85e2e9b7a
5
5
  SHA512:
6
- metadata.gz: 9afd2094afdd07081f83232836b6fe32080a9f9b68325264d2f4cfbda4ed60161ed1aa391e53973e6409501af2c6ffbbaeaa6f6b9683fbe77f32876327168268
7
- data.tar.gz: 3d66ae7ca70f34427deeb6240495a6347f2e3f57118e73b787f2c001325bf22daabddc2b9db0c8f0a282898a1dc8b6de9bcdb13314f9478810f0ee90dea5e800
6
+ metadata.gz: 831f2ae320e236c5f01e74076b5a1aa76aa289aee68109cd501e2da58864cd51a3563692b9c775668dce9c9339c53bc5869fba377c83fab7ffe05bec7bae13a4
7
+ data.tar.gz: d855ad637941341b19425b6b9c5dd7d2f33e4df9e1c6438b97c544ccb95d6ab073b60921d68ab1510e0ef9dd42fb1bdbdb26c3d0084ee1d7948fcacd7c5f5bf0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osp (0.2.0)
4
+ osp (0.3.0.pre.dev.1)
5
5
  highline (~> 1.7)
6
6
  msgpack (~> 0.7)
7
7
  thefox-ext (~> 1.2)
data/bin/osp CHANGED
@@ -60,7 +60,7 @@ puts 'Password: *****'
60
60
  puts
61
61
 
62
62
  @osp_class = TheFox::OSP::OSP
63
- #@osp_class = TheFox::OSP::OSPDev
63
+ @osp_class = TheFox::OSP::OSPDev
64
64
 
65
65
  printf "Calculating base hash: #{@osp_class::HASHES_N} (#{@osp_class::HASHES_EXP}-bit) - please wait ..."
66
66
  @osp = @osp_class.new(email, password)
@@ -209,11 +209,14 @@ while true
209
209
  when 'i'
210
210
  puts
211
211
  if found_hosts.count > 0
212
- index = @cli.ask('Show host, select by number: ', Integer){ |q|
213
- q.character = true if found_hosts.count < 10
214
- q.in = 1..(found_hosts.count) }.to_i
212
+ index = 1
213
+ if found_hosts.count > 1
214
+ index = @cli.ask('Show host, select by number: ', Integer){ |q|
215
+ q.character = true if found_hosts.count < 10
216
+ q.in = 1..(found_hosts.count) }.to_i
217
+ puts
218
+ end
215
219
 
216
- puts
217
220
  puts "Host ##{index} selected:"
218
221
  index -= 1
219
222
  selected_host = nil
@@ -232,11 +235,14 @@ while true
232
235
  when 'e'
233
236
  puts
234
237
  if found_hosts.count > 0
235
- index = @cli.ask('Edit, select host by number: ', Integer){ |q|
236
- q.character = true if found_hosts.count < 10
237
- q.in = 1..(found_hosts.count) }.to_i
238
+ index = 1
239
+ if found_hosts.count > 1
240
+ index = @cli.ask('Edit, select host by number: ', Integer){ |q|
241
+ q.character = true if found_hosts.count < 10
242
+ q.in = 1..(found_hosts.count) }.to_i
243
+ puts
244
+ end
238
245
 
239
- puts
240
246
  puts "Host ##{index} selected:"
241
247
  index -= 1
242
248
  selected_host = nil
@@ -255,14 +261,32 @@ while true
255
261
  else
256
262
  puts 'No hosts found.'
257
263
  end
258
- # when 'd'
259
- # puts
260
- # if found_hosts.count > 0
261
- # puts 'Delete'
262
- # puts
263
- # else
264
- # puts 'No hosts found.'
265
- # end
264
+ when 'd'
265
+ puts
266
+ if found_hosts.count > 0
267
+ index = 1
268
+ if found_hosts.count > 1
269
+ index = @cli.ask('Delete, select host by number: ', Integer){ |q|
270
+ q.character = true if found_hosts.count < 10
271
+ q.in = 1..(found_hosts.count) }.to_i
272
+ puts
273
+ end
274
+
275
+ puts "Delete host ##{index}."
276
+ index -= 1
277
+ selected_host = nil
278
+ begin
279
+ selected_host = found_hosts.values[index]
280
+ rescue Exception => e
281
+ puts "ERROR: #{e}"
282
+ end
283
+
284
+ if !selected_host.nil?
285
+ @database.remove_host(selected_host)
286
+ end
287
+ else
288
+ puts 'No hosts found.'
289
+ end
266
290
  when 'q'
267
291
  break
268
292
  when '?'
data/lib/osp/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  module TheFox
3
3
  module OSP
4
4
  RELEASE_ID = 0
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0-dev.1'
6
6
  DATE = '2015-12-20'
7
7
  HOMEPAGE = 'https://github.com/TheFox/osp'
8
8
  end
data/osp.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.email = 'christian@fox21.at'
14
14
 
15
15
  spec.summary = %q{One Shall Pass}
16
- spec.description = %q{One Shall Pass for Command Line.}
16
+ spec.description = %q{Password Manager: One Shall Pass for Command Line.}
17
17
  spec.homepage = TheFox::OSP::HOMEPAGE
18
18
  spec.license = 'GPL-3.0'
19
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0.pre.dev.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Mayer
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.2'
83
- description: One Shall Pass for Command Line.
83
+ description: 'Password Manager: One Shall Pass for Command Line.'
84
84
  email: christian@fox21.at
85
85
  executables:
86
86
  - osp
@@ -123,9 +123,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
123
  version: 2.1.0
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - ">="
126
+ - - ">"
127
127
  - !ruby/object:Gem::Version
128
- version: '0'
128
+ version: 1.3.1
129
129
  requirements: []
130
130
  rubyforge_project:
131
131
  rubygems_version: 2.4.7