gpg_status_parser 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gpg_status_parser/arguments.rb +21 -4
- data/lib/gpg_status_parser/status_codes.rb +3 -2
- data/lib/gpg_status_parser/status_message.rb +1 -1
- data.tar.gz.asc +7 -7
- metadata +2 -2
- metadata.gz.asc +7 -7
@@ -78,7 +78,23 @@ module GPGStatusParser::Arguments
|
|
78
78
|
:cur => NO_WHITESPACE,
|
79
79
|
:total => NO_WHITESPACE,
|
80
80
|
:fname => NO_WHITESPACE,
|
81
|
-
:pid => NO_WHITESPACE
|
81
|
+
:pid => NO_WHITESPACE,
|
82
|
+
:count => NUMBER,
|
83
|
+
:no_user_id => NUMBER,
|
84
|
+
:imported => NUMBER,
|
85
|
+
:imported_rsa => NUMBER,
|
86
|
+
:unchanged => NUMBER,
|
87
|
+
:n_uids => NUMBER,
|
88
|
+
:n_sigs => NUMBER,
|
89
|
+
:n_subk => NUMBER,
|
90
|
+
:n_revoc => NUMBER,
|
91
|
+
:sec_read => NUMBER,
|
92
|
+
:sec_imported => NUMBER,
|
93
|
+
:sec_dups => NUMBER,
|
94
|
+
:skipped_new_keys => NUMBER,
|
95
|
+
:not_imported => NUMBER
|
96
|
+
}
|
97
|
+
|
82
98
|
|
83
99
|
def self.extract_expected_argument argument_string
|
84
100
|
argument_string = argument_string.strip
|
@@ -141,9 +157,10 @@ module GPGStatusParser::Arguments
|
|
141
157
|
|
142
158
|
end
|
143
159
|
|
144
|
-
|
145
|
-
|
146
|
-
|
160
|
+
if argument_value_string && argument_value_string.length > 0
|
161
|
+
warn "Actual args didnt match expected. Extra stuff #{argument_value_string.inspect}"
|
162
|
+
end
|
163
|
+
|
147
164
|
# Delete unspecified optional args
|
148
165
|
args = Hash[expected_args.zip(results)]
|
149
166
|
args.delete_if {|key,val| val.nil? || val.empty?}
|
@@ -35,6 +35,7 @@ module GPGStatusParser
|
|
35
35
|
:NO_RECP => "<reserved>",
|
36
36
|
:NO_SGNR => "<reserved>",
|
37
37
|
:KEYEXPIRED => "<expire-timestamp>",
|
38
|
+
:SIGEXPIRED => "",
|
38
39
|
:KEYREVOKED => "",
|
39
40
|
:NO_PUBKEY => "<long keyid>",
|
40
41
|
:NO_SECKEY => "<long keyid>",
|
@@ -51,7 +52,7 @@ module GPGStatusParser
|
|
51
52
|
:GET_LINE => "",
|
52
53
|
:GET_HIDDEN => "",
|
53
54
|
:GOT_IT => "",
|
54
|
-
:USERID_HINT => "<long main keyid> <
|
55
|
+
:USERID_HINT => "<long main keyid> <username>",
|
55
56
|
:NEED_PASSPHRASE => "<long keyid> <long main keyid> <keytype> <keylength>",
|
56
57
|
:NEED_PASSPHRASE_SYM => "<cipher_algo> <s2k_mode> <s2k_hash>",
|
57
58
|
:NEED_PASSPHRASE_PIN => "<card_type> <chvno> [<serialno>]",
|
@@ -62,7 +63,7 @@ module GPGStatusParser
|
|
62
63
|
:IMPORTED => "<long keyid> <username>",
|
63
64
|
:IMPORT_OK => "<reason> [<fingerprint>]",
|
64
65
|
:IMPORT_PROBLEM => "<reason> [<fingerprint>]",
|
65
|
-
:IMPORT_RES => "<
|
66
|
+
:IMPORT_RES => "<count> <no_user_id> <imported> <imported_rsa> <unchanged> <n_uids> <n_subk> <n_sigs> <n_revoc> <sec_read> <sec_imported> <sec_dups> <skipped_new_keys> <not_imported>",
|
66
67
|
:CARDCTRL => "<what> [<serialno>]",
|
67
68
|
:SC_OP_FAILURE => "[<code>]",
|
68
69
|
:SC_OP_SUCCESS => "",
|
@@ -19,7 +19,7 @@ module GPGStatusParser
|
|
19
19
|
raise NotGPGStatus if match.nil?
|
20
20
|
|
21
21
|
@status = match[1].intern
|
22
|
-
raise InvalidStatus if !STATUS_CODES.keys.include?(@status)
|
22
|
+
raise InvalidStatus, @status if !STATUS_CODES.keys.include?(@status)
|
23
23
|
|
24
24
|
expected_arg_string = GPGStatusParser::STATUS_CODES[@status]
|
25
25
|
expected_args = GPGStatusParser::Arguments.extract_expected_arguments(expected_arg_string)
|
data.tar.gz.asc
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
-----BEGIN PGP SIGNATURE-----
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
=
|
4
|
+
iQEcBAABCgAGBQJRKM7jAAoJEP5F5V2hilTW1jQH/1aQBu/JPu6M7C1UZ98NbkR7
|
5
|
+
xkmooFS6+/lFkNs7JUczX9dfU9I4e/ukXAxn7TUaY4l/rmxzIyn51uMp937s0kky
|
6
|
+
6pyYGsiSmam+jQYZ5/g3BmNdX1TdErkLvhLeDum/ZaKWzmjlW8pJ4NZ4tyVguMoP
|
7
|
+
vtT7vO0V0bbXdeKG4M9Kir4vY2n4H3wn1C+DAB7VBKRXqaTXuijC7Fv6Th8JIsa2
|
8
|
+
TJ81aeM3l34XsO+Px+3VADmEHduwe81ge/hqi7WfTvWAc5QWHFc8DwH3fejgx5Yh
|
9
|
+
62dri9HGtthF5qlUjNX9JczHzfVCC01ZeX/NSHNkrHK11lkri6VuZBMW4X2bdDQ=
|
10
|
+
=fP7T
|
11
11
|
-----END PGP SIGNATURE-----
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpg_status_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Turns structured status messages provided by gpg into ruby objects for
|
15
15
|
easy manipulation in your code.
|
metadata.gz.asc
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
-----BEGIN PGP SIGNATURE-----
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
=
|
4
|
+
iQEcBAABCgAGBQJRKM7oAAoJEP5F5V2hilTWYm8H/0UcWUEJ96ns/iyzKxNS5kzt
|
5
|
+
EapjQ+/6hYx8M8/5mjPC8gHkOrCJB6syJvx4N4F/vz83xc661A5ozEznqPNcM4CP
|
6
|
+
+lsxN2B20LQ7rCOpDVFGi4e76BAUzwzKQqxLjzr1NGyrU4h+UE8K5/tkeSikXb9y
|
7
|
+
NG2ivyZLvy/RM6UvN1lRnWR24zYQtXoMfqIImgjHTtPJ2h+sl5drUaYGkNy6UMYs
|
8
|
+
C3JjrvAJ17eV4sHF5EJSMCD+jpsFc1lMdtL+Sr2581Al8vUtCWmJjp4H4o4kFxug
|
9
|
+
bGEvTu/kcg8izG71j4/BTjknsZh4W/Ef12zkCiOy/6G0I6PbxVSGoucZqWhKeUM=
|
10
|
+
=7DB2
|
11
11
|
-----END PGP SIGNATURE-----
|