From 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 21 Nov 2018 10:20:47 +0000 Subject: Merge master branch from rubygems/rubygems upstream. * Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/stub_specification.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/rubygems/stub_specification.rb') diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb index 8dd6df17e3..022da9185d 100644 --- a/lib/rubygems/stub_specification.rb +++ b/lib/rubygems/stub_specification.rb @@ -32,7 +32,7 @@ class Gem::StubSpecification < Gem::BasicSpecification 'lib' => ['lib'].freeze }.freeze - def initialize data, extensions + def initialize(data, extensions) parts = data[PREFIX.length..-1].split(" ".freeze, 4) @name = parts[0].freeze @version = if Gem::Version.correct?(parts[1]) @@ -56,17 +56,17 @@ class Gem::StubSpecification < Gem::BasicSpecification end end - def self.default_gemspec_stub filename, base_dir, gems_dir + def self.default_gemspec_stub(filename, base_dir, gems_dir) new filename, base_dir, gems_dir, true end - def self.gemspec_stub filename, base_dir, gems_dir + def self.gemspec_stub(filename, base_dir, gems_dir) new filename, base_dir, gems_dir, false end attr_reader :base_dir, :gems_dir - def initialize filename, base_dir, gems_dir, default_gem + def initialize(filename, base_dir, gems_dir, default_gem) super() filename.untaint @@ -115,7 +115,7 @@ class Gem::StubSpecification < Gem::BasicSpecification begin file.readline # discard encoding line stubline = file.readline.chomp - if stubline.start_with?(PREFIX) then + if stubline.start_with?(PREFIX) extensions = if /\A#{PREFIX}/ =~ file.readline.chomp $'.split "\0" else @@ -185,7 +185,7 @@ class Gem::StubSpecification < Gem::BasicSpecification # The full Gem::Specification for this gem, loaded from evalling its gemspec def to_spec - @spec ||= if @data then + @spec ||= if @data loaded = Gem.loaded_specs[name] loaded if loaded && loaded.version == version end -- cgit v1.2.3