diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-01-10 13:53:41 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-01-10 15:53:07 +0900 |
commit | a43f1d90c2b3aed232d5f4ef9dfe226401cf5d81 (patch) | |
tree | dcb61dd3ab8434242b81d54e8e16b4c4d86d5b8c /lib/rubygems | |
parent | 89fb61f9a3276121da2826b93f131e52d6449859 (diff) |
Merge RubyGems and Bundler master
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7094
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/bundler_version_finder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/help_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/owner_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/defaults.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/dependency.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/ext/cargo_builder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/platform.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/requirement.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/resolver/stats.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/stub_specification.rb | 14 | ||||
-rw-r--r-- | lib/rubygems/text.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/util/licenses.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/version.rb | 2 |
14 files changed, 25 insertions, 25 deletions
diff --git a/lib/rubygems/bundler_version_finder.rb b/lib/rubygems/bundler_version_finder.rb index d47573ead6..5b34227d3a 100644 --- a/lib/rubygems/bundler_version_finder.rb +++ b/lib/rubygems/bundler_version_finder.rb @@ -21,7 +21,7 @@ module Gem::BundlerVersionFinder end def self.bundle_update_bundler_version - return unless File.basename($0) == "bundle".freeze + return unless File.basename($0) == "bundle" return unless "update".start_with?(ARGV.first || " ") bundler_version = nil update_index = nil diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index f4688d793b..59bfc5a118 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -624,7 +624,7 @@ class Gem::Command # :stopdoc: - HELP = <<-HELP.freeze + HELP = <<-HELP RubyGems is a package manager for Ruby. Usage: diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb index 8bfb4458ff..bf4ffefbb7 100644 --- a/lib/rubygems/commands/help_command.rb +++ b/lib/rubygems/commands/help_command.rb @@ -3,7 +3,7 @@ require_relative "../command" class Gem::Commands::HelpCommand < Gem::Command # :stopdoc: - EXAMPLES = <<-EOF.freeze + EXAMPLES = <<-EOF Some examples of 'gem' usage. * Install 'rake', either from local directory or remote server: @@ -52,7 +52,7 @@ Some examples of 'gem' usage. gem update --system EOF - GEM_DEPENDENCIES = <<-EOF.freeze + GEM_DEPENDENCIES = <<-EOF A gem dependencies file allows installation of a consistent set of gems across multiple environments. The RubyGems implementation is designed to be compatible with Bundler's Gemfile format. You can see additional @@ -229,7 +229,7 @@ default. This may be overridden with the :development_group option: EOF - PLATFORMS = <<-'EOF'.freeze + PLATFORMS = <<-'EOF' RubyGems platforms are composed of three parts, a CPU, an OS, and a version. These values are taken from values in rbconfig.rb. You can view your current platform by running `gem environment`. diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index 4a0f7aa3e4..959a6186dc 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -15,7 +15,7 @@ The owner command lets you add and remove owners of a gem on a push server (the default is https://rubygems.org). Multiple owners can be added or removed at the same time, if the flag is given multiple times. -The supported user identifiers are dependant on the push server. +The supported user identifiers are dependent on the push server. For rubygems.org, both e-mail and handle are supported, even though the user identifier field is called "email". diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb index 8daff0bc30..4806ea6469 100644 --- a/lib/rubygems/defaults.rb +++ b/lib/rubygems/defaults.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Gem - DEFAULT_HOST = "https://rubygems.org".freeze + DEFAULT_HOST = "https://rubygems.org" @post_install_hooks ||= [] @done_installing_hooks ||= [] diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index 7fa0f91bd4..cd03e7e299 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -299,7 +299,7 @@ class Gem::Dependency end def prioritizes_bundler? - name == "bundler".freeze && !specific? + name == "bundler" && !specific? end def to_specs diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb index 3851e8d523..60ab5544fe 100644 --- a/lib/rubygems/ext/cargo_builder.rb +++ b/lib/rubygems/ext/cargo_builder.rb @@ -203,7 +203,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder !!Gem::WIN_PATTERNS.find {|r| target_platform =~ r } end - # Interpolate substition vars in the arg (i.e. $(DEFFILE)) + # Interpolate substitution vars in the arg (i.e. $(DEFFILE)) def maybe_resolve_ldflag_variable(input_arg, dest_dir) var_matches = input_arg.match(/\$\((\w+)\)/) diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index 1e7a5c503a..f4983c1153 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -158,7 +158,7 @@ class Gem::Platform # Of note, this method is not commutative. Indeed the OS 'linux' has a # special case: the version is the libc name, yet while "no version" stands # as a wildcard for a binary gem platform (as for other OSes), for the - # runtime platform "no version" stands for 'gnu'. To be able to disinguish + # runtime platform "no version" stands for 'gnu'. To be able to distinguish # these, the method receiver is the gem platform, while the argument is # the runtime platform. # @@ -235,11 +235,11 @@ class Gem::Platform # A pure-Ruby gem that may use Gem::Specification#extensions to build # binary files. - RUBY = "ruby".freeze + RUBY = "ruby" ## # A platform-specific gem that is built for the packaging Ruby's platform. # This will be replaced with Gem::Platform::local. - CURRENT = "current".freeze + CURRENT = "current" end diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index 64f9ac3465..bc2fd9af55 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -22,7 +22,7 @@ class Gem::Requirement SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc: quoted = OPS.keys.map {|k| Regexp.quote k }.join "|" - PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*".freeze # :nodoc: + PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc: ## # A regular expression that matches a requirement diff --git a/lib/rubygems/resolver/stats.rb b/lib/rubygems/resolver/stats.rb index 64b458f504..3b95efebf7 100644 --- a/lib/rubygems/resolver/stats.rb +++ b/lib/rubygems/resolver/stats.rb @@ -32,7 +32,7 @@ class Gem::Resolver::Stats @iterations += 1 end - PATTERN = "%20s: %d\n".freeze + PATTERN = "%20s: %d\n" def display $stdout.puts "=== Resolver Statistics ===" diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb index 512ca9143d..d87abdd993 100644 --- a/lib/rubygems/stub_specification.rb +++ b/lib/rubygems/stub_specification.rb @@ -6,10 +6,10 @@ class Gem::StubSpecification < Gem::BasicSpecification # :nodoc: - PREFIX = "# stub: ".freeze + PREFIX = "# stub: " # :nodoc: - OPEN_MODE = "r:UTF-8:-".freeze + OPEN_MODE = "r:UTF-8:-" class StubLine # :nodoc: all attr_reader :name, :version, :platform, :require_paths, :extensions, @@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification # These are common require paths. REQUIRE_PATHS = { # :nodoc: - "lib" => "lib".freeze, - "test" => "test".freeze, - "ext" => "ext".freeze, + "lib" => "lib", + "test" => "test", + "ext" => "ext", }.freeze # These are common require path lists. This hash is used to optimize @@ -33,7 +33,7 @@ class Gem::StubSpecification < Gem::BasicSpecification }.freeze def initialize(data, extensions) - parts = data[PREFIX.length..-1].split(" ".freeze, 4) + parts = data[PREFIX.length..-1].split(" ", 4) @name = parts[0].freeze @version = if Gem::Version.correct?(parts[1]) Gem::Version.new(parts[1]) @@ -50,7 +50,7 @@ class Gem::StubSpecification < Gem::BasicSpecification end path_list = parts.last - @require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0".freeze).map! do |x| + @require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0").map! do |x| REQUIRE_PATHS[x] || x end end diff --git a/lib/rubygems/text.rb b/lib/rubygems/text.rb index d6b891380e..be811525f2 100644 --- a/lib/rubygems/text.rb +++ b/lib/rubygems/text.rb @@ -9,7 +9,7 @@ module Gem::Text # Remove any non-printable characters and make the text suitable for # printing. def clean_text(text) - text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".".freeze) + text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".") end def truncate_text(text, description, max_length = 100_000) diff --git a/lib/rubygems/util/licenses.rb b/lib/rubygems/util/licenses.rb index 96f47781c0..a823521d10 100644 --- a/lib/rubygems/util/licenses.rb +++ b/lib/rubygems/util/licenses.rb @@ -4,8 +4,8 @@ require_relative "../text" class Gem::Licenses extend Gem::Text - NONSTANDARD = "Nonstandard".freeze - LICENSE_REF = "LicenseRef-.+".freeze + NONSTANDARD = "Nonstandard" + LICENSE_REF = "LicenseRef-.+" # Software Package Data Exchange (SPDX) standard open-source software # license identifiers diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb index f67889ef1a..903b7de99d 100644 --- a/lib/rubygems/version.rb +++ b/lib/rubygems/version.rb @@ -155,7 +155,7 @@ require_relative "deprecate" class Gem::Version include Comparable - VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?'.freeze # :nodoc: + VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc: ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze # :nodoc: ## |