adamsanderson-open_gem 1.1.0 → 1.2.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/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :patch: 0
3
3
  :major: 1
4
- :minor: 1
4
+ :minor: 2
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  require 'rubygems/command'
2
4
  require 'rubygems/dependency'
3
5
  require 'rubygems/version_option'
@@ -60,7 +62,12 @@ class Gem::Commands::OpenCommand < Gem::Command
60
62
  if !editor
61
63
  say "Either set $EDITOR, or use -c <command_name>"
62
64
  else
63
- system(editor, path)
65
+ command_parts = Shellwords.shellwords(editor)
66
+ command_parts << path
67
+ success = system(*command_parts)
68
+ if !success
69
+ raise Gem::CommandLineError, "Could not run '#{editor} #{path}', exit code: #{$?.exitstatus}"
70
+ end
64
71
  end
65
72
  end
66
73
  end
@@ -38,5 +38,4 @@ class Test_SomethingToTest < Test::Unit::TestCase
38
38
  command.invoke()
39
39
  end
40
40
  end
41
-
42
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adamsanderson-open_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Sanderson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-28 00:00:00 -07:00
12
+ date: 2009-05-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency