rubeepass 1.0.1 → 1.0.2

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: 75e9f3dbb7ece89a8230efee0514e585a647e52b
4
- data.tar.gz: fd45799b61d0ed2567c7cce5e2d76f74f3487c31
3
+ metadata.gz: 8226617f8abe2bfe0a9b92d5f650785bd68fac14
4
+ data.tar.gz: 81e0391b37f439830a284063771d5dccc6af4d04
5
5
  SHA512:
6
- metadata.gz: 7adf401f9239048eddf29e7491d7afcc3bf4e3c497406bb240cffe6ba7881389fad23091c7104dc9b28468c75173ba92966b284ca0a46f7cb2a78911bde894ed
7
- data.tar.gz: d6e6b98206eaf073ce9297771e53e6c91d14cd38ce4d1fefe275b84a1f4d6c8ae5e35563e2aa7974ad6606010050ec53a5087360fcdf39f744fad2de8db7d99c
6
+ metadata.gz: 1922e8c6defb427f2c581ed28c20a9e51f53630e6c96b8f4554bc3e31b9db27315e440ab918017b2b0e02476840b5e424e9dd674fcad9ec71cdcbb7d1b551227
7
+ data.tar.gz: 5308e20223253ead6b627d078894765a7dbd1970ab16a67f82e5f443a579eca04796a3ed8a417c5503cdd6b60065251859d7a4a463ba5d846956f9b31b8af474
data/bin/rpass CHANGED
@@ -68,6 +68,8 @@ def parse(args)
68
68
  options["verbose"] = false
69
69
 
70
70
  parser = OptionParser.new do |opts|
71
+ opts.summary_width = 24
72
+
71
73
  opts.banner = "Usage: #{File.basename($0)} [OPTIONS] [kdbx]"
72
74
 
73
75
  opts.on(
@@ -284,12 +286,13 @@ rescue RubeePass::Error => e
284
286
  rescue Exception => e
285
287
  $stderr.puts
286
288
  $stderr.puts "Oops! Looks like an error has occured! If the " \
287
- "error persists, file a bug at:".word_wrap
289
+ "error persists, file a bug at:"
288
290
  $stderr.puts
289
291
  $stderr.puts " https://gitlab.com/mjwhitta/rubeepass/issues"
290
292
  $stderr.puts
291
293
  $stderr.puts "Maybe the message below will help. If not, you " \
292
- "can use the --verbose flag to get a backtrace.".word_wrap
294
+ "can use the --verbose flag to get"
295
+ $stderr.puts "a backtrace."
293
296
 
294
297
  $stderr.puts e.message.white.on_red
295
298
  if (options["verbose"])
@@ -123,7 +123,7 @@ class RubeePass::Group
123
123
 
124
124
  search = @path if (search.nil? || search.empty?)
125
125
  search = @keepass.absolute_path(search, @path)
126
- path, target = search.rsplit("/")
126
+ path, found, target = search.rpartition("/")
127
127
 
128
128
  new_cwd = find_group(path)
129
129
  return [[], []] if (new_cwd.nil?)
@@ -41,7 +41,7 @@ class CDWish < Djinni::Wish
41
41
  completions[group] = "Group"
42
42
  end
43
43
 
44
- return [completions, input.rsplit("/")[1], "/"]
44
+ return [completions, input.rpartition("/")[-1], "/"]
45
45
  end
46
46
 
47
47
  def usage
@@ -31,7 +31,7 @@ class CopyWish < Djinni::Wish
31
31
  cwd = djinni_env["cwd"]
32
32
 
33
33
  path = keepass.absolute_path(path, cwd.path)
34
- path, target = path.rsplit("/")
34
+ path, found, target = path.rpartition("/")
35
35
  new_cwd = keepass.find_group(path)
36
36
  timeout = djinni_env["clipboard_timeout"]
37
37
 
@@ -97,7 +97,7 @@ class CopyWish < Djinni::Wish
97
97
  append = "/"
98
98
  append = "" if (groups.empty?)
99
99
 
100
- return [completions, path.rsplit("/")[1], append]
100
+ return [completions, path.rpartition("/")[-1], append]
101
101
  end
102
102
 
103
103
  def usage
@@ -31,7 +31,7 @@ class EchoWish < Djinni::Wish
31
31
  cwd = djinni_env["cwd"]
32
32
 
33
33
  path = keepass.absolute_path(path, cwd.path)
34
- path, target = path.rsplit("/")
34
+ path, found, target = path.rpartition("/")
35
35
  new_cwd = keepass.find_group(path)
36
36
 
37
37
  if (new_cwd.nil? || !new_cwd.has_entry?(target))
@@ -87,7 +87,7 @@ class EchoWish < Djinni::Wish
87
87
  append = "/"
88
88
  append = "" if (groups.empty?)
89
89
 
90
- return [completions, path.rsplit("/")[1], append]
90
+ return [completions, path.rpartition("/")[-1], append]
91
91
  end
92
92
 
93
93
  def usage
@@ -39,7 +39,7 @@ class LSWish < Djinni::Wish
39
39
  completions[group] = "Group"
40
40
  end
41
41
 
42
- return [completions, input.rsplit("/")[1], "/"]
42
+ return [completions, input.rpartition("/")[-1], "/"]
43
43
  end
44
44
 
45
45
  def usage
@@ -15,7 +15,7 @@ class ShowWish < Djinni::Wish
15
15
 
16
16
  args = cwd.path if (args.empty?)
17
17
  path = keepass.absolute_path(args, cwd.path)
18
- path, target = path.rsplit("/")
18
+ path, found, target = path.rpartition("/")
19
19
  new_cwd = keepass.find_group(path)
20
20
 
21
21
  if (new_cwd.nil?)
@@ -68,7 +68,7 @@ class ShowWish < Djinni::Wish
68
68
  append = "/"
69
69
  append = "" if (groups.empty?)
70
70
 
71
- return [completions, input.rsplit("/")[1], append]
71
+ return [completions, input.rpartition("/")[-1], append]
72
72
  end
73
73
 
74
74
  def usage
data/lib/rubeepass.rb CHANGED
@@ -207,7 +207,6 @@ class RubeePass
207
207
 
208
208
  filehash = ""
209
209
  if (@keyfile)
210
- require "string"
211
210
  contents = File.readlines(@keyfile).join
212
211
  if (contents.length != contents.bytesize)
213
212
  contents = contents.unpack("H*").pack("H*")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubeepass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: '2.0'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.0
82
+ version: 2.0.1
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '2.0'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 2.0.0
92
+ version: 2.0.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: json_config
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -159,7 +159,7 @@ dependencies:
159
159
  version: '0.1'
160
160
  - - ">="
161
161
  - !ruby/object:Gem::Version
162
- version: 0.1.3
162
+ version: 0.1.4
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ dependencies:
169
169
  version: '0.1'
170
170
  - - ">="
171
171
  - !ruby/object:Gem::Version
172
- version: 0.1.3
172
+ version: 0.1.4
173
173
  description: Ruby KeePass 2.x implementation. Currently it is read-only.
174
174
  email: mjwhitta@gmail.com
175
175
  executables:
@@ -201,7 +201,6 @@ files:
201
201
  - lib/rubeepass/wish/ls_wish.rb
202
202
  - lib/rubeepass/wish/pwd_wish.rb
203
203
  - lib/rubeepass/wish/show_wish.rb
204
- - lib/string.rb
205
204
  homepage: https://mjwhitta.github.io/rubeepass
206
205
  licenses:
207
206
  - GPL-3.0
data/lib/string.rb DELETED
@@ -1,12 +0,0 @@
1
- # Modify String class to allow for rsplit and word wrap
2
- class String
3
- def rsplit(pattern)
4
- ret = rpartition(pattern)
5
- ret.delete_at(1)
6
- return ret
7
- end
8
-
9
- def word_wrap(width = 80)
10
- return scan(/\S.{0,#{width}}\S(?=\s|$)|\S+/).join("\n")
11
- end
12
- end