rubeepass 1.0.2 → 1.0.3

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: 8226617f8abe2bfe0a9b92d5f650785bd68fac14
4
- data.tar.gz: 81e0391b37f439830a284063771d5dccc6af4d04
3
+ metadata.gz: 225032ca27aae7a359a0aaa46f3ca5d6cc0be876
4
+ data.tar.gz: 9c5fff439de444eda840e951e460d73a1e9c7afd
5
5
  SHA512:
6
- metadata.gz: 1922e8c6defb427f2c581ed28c20a9e51f53630e6c96b8f4554bc3e31b9db27315e440ab918017b2b0e02476840b5e424e9dd674fcad9ec71cdcbb7d1b551227
7
- data.tar.gz: 5308e20223253ead6b627d078894765a7dbd1970ab16a67f82e5f443a579eca04796a3ed8a417c5503cdd6b60065251859d7a4a463ba5d846956f9b31b8af474
6
+ metadata.gz: 12098aca371ff956e07f15db6f70c36a6721f7b4af7e4ff191a0a8ed9322a3732107bc80cbe2ddbc2bd0a571713a982c282e9db81342038eef4378d9f0e7e88f
7
+ data.tar.gz: 123f4c1b4d48b51adc76e82321fdcc709d8c341d7e5f771b626f1b995a702860b8ff15e1044738340c67f02def6b4f4122d3751335b226871946cd0e73f24b11
data/bin/rpass CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "colorize"
4
3
  require "djinni"
4
+ require "hilighter"
5
5
  require "io/console"
6
6
  require "json_config"
7
7
  require "optparse"
@@ -111,7 +111,7 @@ def parse(args)
111
111
  end
112
112
 
113
113
  opts.on("--nocolor", "Disable colorized output") do
114
- String.disable_colorization = true
114
+ Hilighter.disable
115
115
  end
116
116
 
117
117
  opts.on(
@@ -220,7 +220,7 @@ begin
220
220
  kdbx,
221
221
  password,
222
222
  keyfile,
223
- !String.disable_colorization
223
+ !Hilighter.disable?
224
224
  )
225
225
 
226
226
  loop do
@@ -242,7 +242,7 @@ begin
242
242
  kdbx,
243
243
  password,
244
244
  keyfile,
245
- !String.disable_colorization
245
+ !Hilighter.disable?
246
246
  )
247
247
  end
248
248
  end
@@ -1,4 +1,4 @@
1
- require "colorize"
1
+ require "hilighter"
2
2
  require "rexml/document"
3
3
 
4
4
  class RubeePass::Entry
@@ -17,28 +17,16 @@ class RubeePass::Entry
17
17
  return (self.title.downcase <=> other.title.downcase)
18
18
  end
19
19
 
20
- def colorize_password(passwd)
21
- return passwd if (!RubeePass.colorize?)
22
- return passwd.light_red
23
- end
24
- private :colorize_password
25
-
26
- def colorize_title(title)
27
- return title if (!RubeePass.colorize?)
28
- return title.light_green
29
- end
30
- private :colorize_title
31
-
32
20
  def details(level = 0, show_passwd = false)
33
21
  lvl = Array.new(level, " ").join
34
22
 
35
23
  ret = Array.new
36
- ret.push(colorize_title("#{lvl}Title : #{@title}"))
24
+ ret.push(hilight_title("#{lvl}Title : #{@title}"))
37
25
  # ret.push("#{lvl}UUID : #{@uuid}")
38
26
  ret.push("#{lvl}Username : #{@username}")
39
27
  if (show_passwd)
40
28
  ret.push(
41
- colorize_password("#{lvl}Password : #{password}")
29
+ hilight_password("#{lvl}Password : #{password}")
42
30
  )
43
31
  end
44
32
  ret.push("#{lvl}Url : #{@url}")
@@ -142,6 +130,18 @@ class RubeePass::Entry
142
130
  return keepass.protected_decryptor.add_to_stream(data)
143
131
  end
144
132
 
133
+ def hilight_password(passwd)
134
+ return passwd if (!RubeePass.hilight?)
135
+ return passwd.light_red
136
+ end
137
+ private :hilight_password
138
+
139
+ def hilight_title(title)
140
+ return title if (!RubeePass.hilight?)
141
+ return title.light_green
142
+ end
143
+ private :hilight_title
144
+
145
145
  def initialize(
146
146
  group,
147
147
  keepass,
@@ -1,4 +1,4 @@
1
- require "colorize"
1
+ require "hilighter"
2
2
  require "rexml/document"
3
3
 
4
4
  class RubeePass::Group
@@ -20,18 +20,12 @@ class RubeePass::Group
20
20
  return (self.name.downcase <=> other.name.downcase)
21
21
  end
22
22
 
23
- def colorize_header(header)
24
- return header if (!RubeePass.colorize?)
25
- return header.light_blue
26
- end
27
- private :colorize_header
28
-
29
23
  def details(level = 0, show_passwd = false)
30
24
  out = Array.new
31
25
  lvl = Array.new(level, " ").join
32
26
 
33
- group_details = [ colorize_header(@path) ] if (level == 0)
34
- group_details = [ colorize_header(@name) ] if (level != 0)
27
+ group_details = [ hilight_header(@path) ] if (level == 0)
28
+ group_details = [ hilight_header(@name) ] if (level != 0)
35
29
 
36
30
  group_details.each do |line|
37
31
  out.push("#{lvl}#{line}")
@@ -170,6 +164,12 @@ class RubeePass::Group
170
164
  return false
171
165
  end
172
166
 
167
+ def hilight_header(header)
168
+ return header if (!RubeePass.hilight?)
169
+ return header.light_blue
170
+ end
171
+ private :hilight_header
172
+
173
173
  def initialize(
174
174
  group,
175
175
  keepass,
@@ -1,5 +1,5 @@
1
- require "colorize"
2
1
  require "djinni"
2
+ require "hilighter"
3
3
 
4
4
  class CDWish < Djinni::Wish
5
5
  def aliases
data/lib/rubeepass.rb CHANGED
@@ -72,9 +72,9 @@ class RubeePass
72
72
  end
73
73
  end
74
74
 
75
- def self.colorize?
76
- @@colorize ||= false
77
- return @@colorize
75
+ def self.hilight?
76
+ @@hilight ||= false
77
+ return @@hilight
78
78
  end
79
79
 
80
80
  def copy_to_clipboard(string, err = true)
@@ -178,8 +178,8 @@ class RubeePass
178
178
  return @db.fuzzy_find(input)
179
179
  end
180
180
 
181
- def initialize(kdbx, password, keyfile = nil, colorize = false)
182
- @@colorize = colorize
181
+ def initialize(kdbx, password, keyfile = nil, hilight = false)
182
+ @@hilight = hilight
183
183
  @kdbx = Pathname.new(kdbx).expand_path
184
184
  @keyfile = nil
185
185
  @keyfile = Pathname.new(keyfile).expand_path if (keyfile)
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.2
4
+ version: 1.0.3
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-26 00:00:00.000000000 Z
11
+ date: 2016-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -51,45 +51,45 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: 10.5.0
53
53
  - !ruby/object:Gem::Dependency
54
- name: colorize
54
+ name: djinni
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.7'
59
+ version: '2.0'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 0.7.7
62
+ version: 2.0.1
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.7'
69
+ version: '2.0'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 0.7.7
72
+ version: 2.0.1
73
73
  - !ruby/object:Gem::Dependency
74
- name: djinni
74
+ name: hilighter
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '2.0'
79
+ version: '0.1'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.1
82
+ version: 0.1.1
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.0'
89
+ version: '0.1'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 2.0.1
92
+ version: 0.1.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: json_config
95
95
  requirement: !ruby/object:Gem::Requirement