mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
Merge RubyGems-3.3.19 and Bundler-2.3.19
This commit is contained in:
parent
0918783347
commit
44c926f3a9
362 changed files with 7843 additions and 7605 deletions
|
@ -1,18 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative '../command'
|
||||
require_relative '../version_option'
|
||||
require_relative "../command"
|
||||
require_relative "../version_option"
|
||||
|
||||
class Gem::Commands::OpenCommand < Gem::Command
|
||||
include Gem::VersionOption
|
||||
|
||||
def initialize
|
||||
super 'open', 'Open gem sources in editor'
|
||||
super "open", "Open gem sources in editor"
|
||||
|
||||
add_option('-e', '--editor COMMAND', String,
|
||||
add_option("-e", "--editor COMMAND", String,
|
||||
"Prepends COMMAND to gem path. Could be used to specify editor.") do |command, options|
|
||||
options[:editor] = command || get_env_editor
|
||||
end
|
||||
add_option('-v', '--version VERSION', String,
|
||||
add_option("-v", "--version VERSION", String,
|
||||
"Opens specific gem version") do |version|
|
||||
options[:version] = version
|
||||
end
|
||||
|
@ -40,10 +40,10 @@ class Gem::Commands::OpenCommand < Gem::Command
|
|||
end
|
||||
|
||||
def get_env_editor
|
||||
ENV['GEM_EDITOR'] ||
|
||||
ENV['VISUAL'] ||
|
||||
ENV['EDITOR'] ||
|
||||
'vi'
|
||||
ENV["GEM_EDITOR"] ||
|
||||
ENV["VISUAL"] ||
|
||||
ENV["EDITOR"] ||
|
||||
"vi"
|
||||
end
|
||||
|
||||
def execute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue