diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-12-26 14:00:11 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-12-26 15:09:21 +0900 |
commit | b7ad60a79440f65cf883d3ff9dbdde701666ef56 (patch) | |
tree | e0033b706a480377472bf93f58eaf42f6e2301ab /lib/bundler/cli | |
parent | 10c9ce9d4c632d7c6232b53367b0496aef2ebb13 (diff) |
Merge RubyGems/Bundler master
from https://github.com/rubygems/rubygems/commit/72fd3dd2096af16d797ad0cd8e0d2a8869e240b3
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7025
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r-- | lib/bundler/cli/binstubs.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/info.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/outdated.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/platform.rb | 12 |
5 files changed, 11 insertions, 9 deletions
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb index 639c01ff39..09541b1955 100644 --- a/lib/bundler/cli/binstubs.rb +++ b/lib/bundler/cli/binstubs.rb @@ -11,7 +11,7 @@ module Bundler def run Bundler.definition.validate_runtime! path_option = options["path"] - path_option = nil if path_option && path_option.empty? + path_option = nil if path_option&.empty? Bundler.settings.set_command_option :bin, path_option if options["path"] Bundler.settings.set_command_option_if_given :shebang, options["shebang"] installer = Installer.new(Bundler.root, Bundler.definition) diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb index 0545ce8c75..36c7a58f12 100644 --- a/lib/bundler/cli/info.rb +++ b/lib/bundler/cli/info.rb @@ -33,7 +33,7 @@ module Bundler def default_gem_spec(gem_name) return unless Gem::Specification.respond_to?(:find_all_by_name) gem_spec = Gem::Specification.find_all_by_name(gem_name).last - return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem? + return gem_spec if gem_spec&.default_gem? end def spec_not_found(gem_name) diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 1765621cb3..c71bcf159f 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -154,7 +154,7 @@ module Bundler end bin_option = options["binstubs"] - bin_option = nil if bin_option && bin_option.empty? + bin_option = nil if bin_option&.empty? Bundler.settings.set_command_option :bin, bin_option if options["binstubs"] Bundler.settings.set_command_option_if_given :shebang, options["shebang"] diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 12c3384938..68c701aefb 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -194,7 +194,7 @@ module Bundler end current_version = "#{current_spec.version}#{current_spec.git_version}" - if dependency && dependency.specific? + if dependency&.specific? dependency_version = %(, requested #{dependency.requirement}) end diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb index 73da8cf80e..32d68abbb1 100644 --- a/lib/bundler/cli/platform.rb +++ b/lib/bundler/cli/platform.rb @@ -8,12 +8,12 @@ module Bundler end def run - platforms, ruby_version = Bundler.ui.silence do - locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version&.gsub(/p\d+\Z/, "") - gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string - [Bundler.definition.platforms.map {|p| "* #{p}" }, - locked_ruby_version || gemfile_ruby_version] + ruby_version = if Bundler.locked_gems + Bundler.locked_gems.ruby_version&.gsub(/p\d+\Z/, "") + else + Bundler.definition.ruby_version&.single_version_string end + output = [] if options[:ruby] @@ -23,6 +23,8 @@ module Bundler output << "No ruby version specified" end else + platforms = Bundler.definition.platforms.map {|p| "* #{p}" } + output << "Your platform is: #{Gem::Platform.local}" output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}" |