rubeepass 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubeepass/entry.rb +5 -8
- data/lib/rubeepass/group.rb +6 -11
- data/lib/rubeepass.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a69a934556fba614bbb3f0f83205a159551e0ae9
|
4
|
+
data.tar.gz: 54af2c8c9f97c1237b2b59fbe45efcb167f2cfa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b0424517f9678099e2ec80e7cff802b89f02ffbadcbfa6dde0bf871de208db4117067b0aaa96c013288bac89d83008df3fb8db34d137a6cc2dc0824ca2367ea
|
7
|
+
data.tar.gz: 485e0b12733234359dbc92b29ef0c152cd171805f9ce090b6bd7ea5d8307c9e8e47ae19367f8e4da676e0f833cc2abebf8eb30e54ca30e2fe7309452206305f0
|
data/lib/rubeepass/entry.rb
CHANGED
@@ -23,13 +23,13 @@ class RubeePass::Entry
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def colorize_password(passwd)
|
26
|
-
return passwd if (
|
26
|
+
return passwd if (!RubeePass.colorize?)
|
27
27
|
return passwd.light_red
|
28
28
|
end
|
29
29
|
private :colorize_password
|
30
30
|
|
31
31
|
def colorize_title(title)
|
32
|
-
return title if (
|
32
|
+
return title if (!RubeePass.colorize?)
|
33
33
|
return title.light_green
|
34
34
|
end
|
35
35
|
private :colorize_title
|
@@ -61,7 +61,7 @@ class RubeePass::Entry
|
|
61
61
|
return ret.join("\n")
|
62
62
|
end
|
63
63
|
|
64
|
-
def self.from_xml(keepass, parent, xml
|
64
|
+
def self.from_xml(keepass, parent, xml)
|
65
65
|
notes = ""
|
66
66
|
password = ""
|
67
67
|
title = ""
|
@@ -111,8 +111,7 @@ class RubeePass::Entry
|
|
111
111
|
title,
|
112
112
|
url,
|
113
113
|
username,
|
114
|
-
uuid
|
115
|
-
colorize
|
114
|
+
uuid
|
116
115
|
)
|
117
116
|
end
|
118
117
|
|
@@ -137,10 +136,8 @@ class RubeePass::Entry
|
|
137
136
|
title,
|
138
137
|
url,
|
139
138
|
username,
|
140
|
-
uuid
|
141
|
-
colorize = false
|
139
|
+
uuid
|
142
140
|
)
|
143
|
-
@colorize = colorize
|
144
141
|
@group = group
|
145
142
|
@keepass = keepass
|
146
143
|
@notes = notes
|
data/lib/rubeepass/group.rb
CHANGED
@@ -21,7 +21,7 @@ class RubeePass::Group
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def colorize_header(header)
|
24
|
-
return header if (
|
24
|
+
return header if (!RubeePass.colorize?)
|
25
25
|
return header.light_blue
|
26
26
|
end
|
27
27
|
private :colorize_header
|
@@ -70,7 +70,7 @@ class RubeePass::Group
|
|
70
70
|
return cwd
|
71
71
|
end
|
72
72
|
|
73
|
-
def self.from_xml(keepass, parent, xml
|
73
|
+
def self.from_xml(keepass, parent, xml)
|
74
74
|
name = xml.elements["Name"].text if (parent)
|
75
75
|
name = "" if (name.nil?)
|
76
76
|
name = "/" if (parent.nil?)
|
@@ -88,8 +88,7 @@ class RubeePass::Group
|
|
88
88
|
keepass,
|
89
89
|
name,
|
90
90
|
notes,
|
91
|
-
uuid
|
92
|
-
colorize
|
91
|
+
uuid
|
93
92
|
)
|
94
93
|
|
95
94
|
if (xml.elements["Entry"])
|
@@ -97,8 +96,7 @@ class RubeePass::Group
|
|
97
96
|
entry = RubeePass::Entry.from_xml(
|
98
97
|
keepass,
|
99
98
|
group,
|
100
|
-
entry_xml
|
101
|
-
colorize
|
99
|
+
entry_xml
|
102
100
|
)
|
103
101
|
group.entries[entry.title] = entry
|
104
102
|
end
|
@@ -109,8 +107,7 @@ class RubeePass::Group
|
|
109
107
|
child = RubeePass::Group.from_xml(
|
110
108
|
keepass,
|
111
109
|
group,
|
112
|
-
group_xml
|
113
|
-
colorize
|
110
|
+
group_xml
|
114
111
|
)
|
115
112
|
group.groups[child.name] = child
|
116
113
|
end
|
@@ -175,10 +172,8 @@ class RubeePass::Group
|
|
175
172
|
keepass,
|
176
173
|
name,
|
177
174
|
notes,
|
178
|
-
uuid
|
179
|
-
colorize = false
|
175
|
+
uuid
|
180
176
|
)
|
181
|
-
@colorize = colorize
|
182
177
|
@entries = Hash.new
|
183
178
|
@group = group
|
184
179
|
@groups = Hash.new
|
data/lib/rubeepass.rb
CHANGED
@@ -73,6 +73,11 @@ class RubeePass
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
def self.colorize?
|
77
|
+
@@colorize ||= false
|
78
|
+
return @@colorize
|
79
|
+
end
|
80
|
+
|
76
81
|
def copy_to_clipboard(string, err = true)
|
77
82
|
string = "" if (string.nil?)
|
78
83
|
if (OS::Underlying.windows?)
|
@@ -175,7 +180,7 @@ class RubeePass
|
|
175
180
|
end
|
176
181
|
|
177
182
|
def initialize(kdbx, password, keyfile = nil, colorize = false)
|
178
|
-
|
183
|
+
@@colorize = colorize
|
179
184
|
@kdbx = Pathname.new(kdbx).expand_path
|
180
185
|
@keyfile = nil
|
181
186
|
@keyfile = Pathname.new(keyfile).expand_path if (keyfile)
|
@@ -331,7 +336,7 @@ class RubeePass
|
|
331
336
|
end
|
332
337
|
|
333
338
|
root = doc.elements["KeePassFile/Root"]
|
334
|
-
@db = Group.from_xml(self, nil, root
|
339
|
+
@db = Group.from_xml(self, nil, root)
|
335
340
|
end
|
336
341
|
private :parse_xml
|
337
342
|
|
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: 0.5.
|
4
|
+
version: 0.5.1
|
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-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|