summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/open_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/open_command.rb')
-rw-r--r--lib/rubygems/commands/open_command.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/commands/open_command.rb b/lib/rubygems/commands/open_command.rb
index 91963bb..254a742 100644
--- a/lib/rubygems/commands/open_command.rb
+++ b/lib/rubygems/commands/open_command.rb
@@ -61,7 +61,9 @@ class Gem::Commands::OpenCommand < Gem::Command
end
def open_editor path
- system(*@editor.split(/\s+/) + [path])
+ Dir.chdir(path) do
+ system(*@editor.split(/\s+/) + [path])
+ end
end
def spec_for name