1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
hsbt 2018-11-21 10:20:47 +00:00
parent 2f023c5dba
commit 5335ce0e06
247 changed files with 1290 additions and 1363 deletions

View file

@ -73,7 +73,7 @@ prefix or only the files that are requireable.
names.each do |name|
found =
if options[:show_install_dir] then
if options[:show_install_dir]
gem_install_dir name
else
gem_contents name
@ -83,15 +83,15 @@ prefix or only the files that are requireable.
end
end
def files_in spec
if spec.default_gem? then
def files_in(spec)
if spec.default_gem?
files_in_default_gem spec
else
files_in_gem spec
end
end
def files_in_gem spec
def files_in_gem(spec)
gem_path = spec.full_gem_path
extra = "/{#{spec.require_paths.join ','}}" if options[:lib_only]
glob = "#{gem_path}#{extra}/**/*"
@ -102,7 +102,7 @@ prefix or only the files that are requireable.
end
end
def files_in_default_gem spec
def files_in_default_gem(spec)
spec.files.map do |file|
case file
when /\A#{spec.bindir}\//
@ -115,7 +115,7 @@ prefix or only the files that are requireable.
end
end
def gem_contents name
def gem_contents(name)
spec = spec_for name
return false unless spec
@ -127,7 +127,7 @@ prefix or only the files that are requireable.
true
end
def gem_install_dir name
def gem_install_dir(name)
spec = spec_for name
return false unless spec
@ -138,27 +138,27 @@ prefix or only the files that are requireable.
end
def gem_names # :nodoc:
if options[:all] then
if options[:all]
Gem::Specification.map(&:name)
else
get_all_gem_names
end
end
def path_description spec_dirs # :nodoc:
if spec_dirs.empty? then
def path_description(spec_dirs) # :nodoc:
if spec_dirs.empty?
"default gem paths"
else
"specified path"
end
end
def show_files files
def show_files(files)
files.sort.each do |prefix, basename|
absolute_path = File.join(prefix, basename)
next if File.directory? absolute_path
if options[:prefix] then
if options[:prefix]
say absolute_path
else
say basename
@ -166,14 +166,14 @@ prefix or only the files that are requireable.
end
end
def spec_for name
def spec_for(name)
spec = Gem::Specification.find_all_by_name(name, @version).last
return spec if spec
say "Unable to find gem '#{name}' in #{@path_kind}"
if Gem.configuration.verbose then
if Gem.configuration.verbose
say "\nDirectories searched:"
@spec_dirs.sort.each { |dir| say dir }
end
@ -188,4 +188,3 @@ prefix or only the files that are requireable.
end
end