rgpg 0.2.2 → 0.2.3

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/lib/rgpg/gem_info.rb CHANGED
@@ -2,7 +2,7 @@ module Rgpg
2
2
  module GemInfo
3
3
  MAJOR_VERSION = 0
4
4
  MINOR_VERSION = 2
5
- PATCH_VERSION = 2
5
+ PATCH_VERSION = 3
6
6
 
7
7
  def self.version_string
8
8
  [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join('.')
@@ -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.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-07-31 00:00:00.000000000 Z
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