gpg_status_parser 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.asc +7 -7
- data/lib/gpg_status_parser.rb +36 -0
- metadata +3 -3
- metadata.gz.asc +7 -7
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
|
+
iQEcBAABCgAGBQJRM49kAAoJEP5F5V2hilTWkP4H/AztOAn8ffWJ9zVLuwMVYuBi
|
5
|
+
9vX3H9o9ie9s68NnfgE2BflTlj5ybij5H0Zw/D84TYiEIGRXXj/QkawW6Z4a1Xo/
|
6
|
+
Zhelu5iGO0L1i4oXxuWHsVnU1QYruBw6Yhuu0FeukUv6mpQ5jbK1VJcwVm+DI8bN
|
7
|
+
BRPj0YJ/q8XnGoNqMgZsXC9N4GoH7I5G4mrG2UVVRGxNlaoxyjAM2Pk7poi6hUpV
|
8
|
+
UU6Ys3dXGMeJVhGl4lPi/VJt6Dry7DKZqu5JwbqODuqTPucnK+9cNKtp6BhkEr62
|
9
|
+
G/1OGNFy2Rrmf82r/4LsKzqz4oYlWMHBNeAPUngM+BmF/29lfHfwfqP+yMdpaRM=
|
10
|
+
=fMM8
|
11
11
|
-----END PGP SIGNATURE-----
|
data/lib/gpg_status_parser.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'gpg_status_parser/status_message'
|
2
|
+
require 'open3'
|
2
3
|
|
3
4
|
module GPGStatusParser
|
4
5
|
|
@@ -17,4 +18,39 @@ module GPGStatusParser
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
# Run a gpg command, and take care of setting up and tearing down the
|
22
|
+
# required temporary files. Just pass in the arguments you want to send
|
23
|
+
# to gpg:
|
24
|
+
#
|
25
|
+
# GPGStatusParser.run_gpg("--verify foo.txt.asc foo.txt")
|
26
|
+
#
|
27
|
+
# and not:
|
28
|
+
#
|
29
|
+
# GPGStatusParser.run_gpg("gpg --verify foo.txt.asc foo.txt")
|
30
|
+
#
|
31
|
+
# It is highly advised that you escape and/or scrub any user
|
32
|
+
# generated input to make sure it is safe. See Shellwords#shell_escape
|
33
|
+
# in the ruby standard library.
|
34
|
+
def self.run_gpg args, data=nil, &block
|
35
|
+
exit_status = nil
|
36
|
+
status_file = Tempfile.new("status")
|
37
|
+
|
38
|
+
full_gpg_command = "gpg --status-file #{status_file.path} #{args}"
|
39
|
+
gpg_results = Open3.popen3(full_gpg_command) do |stdin, stdout, stderr, wait_thr|
|
40
|
+
stdin.write data if data
|
41
|
+
stdin.close
|
42
|
+
exit_status = wait_thr.value
|
43
|
+
parse(status_file, &block)
|
44
|
+
out = stdout.read()
|
45
|
+
err = stderr.read()
|
46
|
+
{:status => exit_status, :stdout => out, :err => err}
|
47
|
+
end
|
48
|
+
gpg_results
|
49
|
+
ensure
|
50
|
+
status_file.close
|
51
|
+
status_file.unlink
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
|
20
56
|
end
|
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.4.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-
|
12
|
+
date: 2013-03-03 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.
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
50
|
rubyforge_project:
|
51
|
-
rubygems_version: 1.8.
|
51
|
+
rubygems_version: 1.8.25
|
52
52
|
signing_key:
|
53
53
|
specification_version: 3
|
54
54
|
summary: Turns gpg status messages into ruby objects.
|
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
|
+
iQEcBAABCgAGBQJRM49pAAoJEP5F5V2hilTWJ64H/1Mnou1BURVxDK05XbwBqkbN
|
5
|
+
bpZ2rhNowzi1r0qwwas6tWB59NUq4uuFvjNd+eNbJ4bbdoz3zlNJrHeb6GTw7RUZ
|
6
|
+
r/eHMSoTa3/EB3uZ+cKprvG5rXxfcyKnL4ZymlAQgym8j0LZ7PULDtKnU9FWNSVZ
|
7
|
+
qGUR1CPyrC8WvGH0MpQV6LxagIK66V5jGSGgdVmiG1ZtrlOiS0djzCey7XC0Wf1m
|
8
|
+
AudqxHG6qoTbPNw4tp87jd/LSpBSdxVM70fYorgiPYYF+VGmDvk8GZaGXDH49uQO
|
9
|
+
ieM14zkMejVEhFVjud+teozZcZ2psdVSzLbhLCWzp5K7/zkXpxY3K+mpGaznT/g=
|
10
|
+
=Jr8N
|
11
11
|
-----END PGP SIGNATURE-----
|