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/stub_specification.rb | |
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/stub_specification.rb')
-rw-r--r-- | lib/rubygems/stub_specification.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 |