rgpg 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgpg/gem_info.rb +1 -1
- data/lib/rgpg/gpg_helper.rb +4 -3
- metadata +2 -2
data/lib/rgpg/gem_info.rb
CHANGED
data/lib/rgpg/gpg_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'tempfile'
|
2
|
+
require 'shellwords'
|
2
3
|
|
3
4
|
module Rgpg
|
4
5
|
module GpgHelper
|
@@ -10,7 +11,7 @@ module Rgpg
|
|
10
11
|
begin
|
11
12
|
script_file.write(script)
|
12
13
|
script_file.close
|
13
|
-
result = system("gpg --batch --gen-key #{script_file.path}")
|
14
|
+
result = system("gpg --batch --gen-key #{Shellwords.escape(script_file.path)}")
|
14
15
|
raise RuntimeError.new('gpg failed') unless result
|
15
16
|
ensure
|
16
17
|
script_file.close
|
@@ -62,12 +63,12 @@ module Rgpg
|
|
62
63
|
'gpg',
|
63
64
|
'--no-default-keyring'
|
64
65
|
] + args
|
65
|
-
command_line = fragments.join(' ')
|
66
|
+
command_line = fragments.collect { |fragment| Shellwords.escape(fragment) }.join(' ')
|
66
67
|
|
67
68
|
output_file = Tempfile.new('gpg-output')
|
68
69
|
begin
|
69
70
|
output_file.close
|
70
|
-
result = system("#{command_line} > #{output_file.path} 2>&1")
|
71
|
+
result = system("#{command_line} > #{Shellwords.escape(output_file.path)} 2>&1")
|
71
72
|
ensure
|
72
73
|
output_file.unlink
|
73
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgpg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
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-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Simple Ruby wrapper around "gpg" command for file encryption
|
15
15
|
email: rcook@rcook.org
|