Merge RubyGems-3.3.19 and Bundler-2.3.19

This commit is contained in:
Hiroshi SHIBATA 2022-08-22 11:49:38 +09:00 committed by nagachika
parent 0918783347
commit 44c926f3a9
362 changed files with 7843 additions and 7605 deletions

View file

@ -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