summaryrefslogtreecommitdiff
path: root/lib/rubygems/stub_specification.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/stub_specification.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
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
Diffstat (limited to 'lib/rubygems/stub_specification.rb')
-rw-r--r--lib/rubygems/stub_specification.rb12
1 files changed, 6 insertions, 6 deletions
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