diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
commit | 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch) | |
tree | c63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/source/git.rb | |
parent | 2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff) | |
download | ruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz |
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/source/git.rb')
-rw-r--r-- | lib/rubygems/source/git.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb index 23f8928a4e..0b8a4339cc 100644 --- a/lib/rubygems/source/git.rb +++ b/lib/rubygems/source/git.rb @@ -50,7 +50,7 @@ class Gem::Source::Git < Gem::Source # repository may contain multiple gems. If +submodules+ is true, submodules # will be checked out when the gem is installed. - def initialize name, repository, reference, submodules = false + def initialize(name, repository, reference, submodules = false) super repository @name = name @@ -63,7 +63,7 @@ class Gem::Source::Git < Gem::Source @git = ENV['git'] || 'git' end - def <=> other + def <=>(other) case other when Gem::Source::Git then 0 @@ -77,7 +77,7 @@ class Gem::Source::Git < Gem::Source end end - def == other # :nodoc: + def ==(other) # :nodoc: super and @name == other.name and @repository == other.repository and @@ -93,7 +93,7 @@ class Gem::Source::Git < Gem::Source return false unless File.exist? repo_cache_dir - unless File.exist? install_dir then + unless File.exist? install_dir system @git, 'clone', '--quiet', '--no-checkout', repo_cache_dir, install_dir end @@ -117,7 +117,7 @@ class Gem::Source::Git < Gem::Source def cache # :nodoc: return unless @remote - if File.exist? repo_cache_dir then + if File.exist? repo_cache_dir Dir.chdir repo_cache_dir do system @git, 'fetch', '--quiet', '--force', '--tags', @repository, 'refs/heads/*:refs/heads/*' @@ -145,7 +145,7 @@ class Gem::Source::Git < Gem::Source ## # Nothing to download for git gems - def download full_spec, path # :nodoc: + def download(full_spec, path) # :nodoc: end ## @@ -157,7 +157,7 @@ class Gem::Source::Git < Gem::Source File.join base_dir, 'gems', "#{@name}-#{dir_shortref}" end - def pretty_print q # :nodoc: + def pretty_print(q) # :nodoc: q.group 2, '[Git: ', ']' do q.breakable q.text @repository @@ -206,7 +206,7 @@ class Gem::Source::Git < Gem::Source Dir.chdir directory do spec = Gem::Specification.load file - if spec then + if spec spec.base_dir = base_dir spec.extension_dir = @@ -228,7 +228,7 @@ class Gem::Source::Git < Gem::Source require 'digest' # required here to avoid deadlocking in Gem.activate_bin_path (because digest is a gem on 2.5+) normalized = - if @repository =~ %r%^\w+://(\w+@)?% then + if @repository =~ %r%^\w+://(\w+@)?% uri = URI(@repository).normalize.to_s.sub %r%/$%,'' uri.sub(/\A(\w+)/) { $1.downcase } else @@ -239,4 +239,3 @@ class Gem::Source::Git < Gem::Source end end - |