diff options
author | David RodrÃguez <[email protected]> | 2022-09-07 07:13:04 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-09-08 11:25:03 +0900 |
commit | 24fd2f73d0835eea534225a6381551d591764002 () | |
tree | 3447658af19fa723e6c2c4c3e5cbdacda430e424 /lib | |
parent | 2d57447ae80e0b0895d6d22d606391b48516ba93 (diff) |
Resync Bundler & RubyGems
Notes: Merged: https://.com/ruby/ruby/pull/6330
61 files changed, 500 insertions, 454 deletions
@@ -22,14 +22,12 @@ Gem::Specification.new do |s| s.summary = "The best way to manage your application's dependencies" s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably" - if s.respond_to?(:metadata=) - s.metadata = { - "bug_tracker_uri" => "https://.com/rubygems/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler", - "changelog_uri" => "https://.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md", - "homepage_uri" => "https://bundler.io/", - "source_code_uri" => "https://.com/rubygems/rubygems/", - } - end s.required_ruby_version = ">= 2.3.0" s.required_rubygems_version = ">= 2.5.2" @@ -517,7 +517,7 @@ module Bundler end end - desc "version", "Prints the bundler's version information" def version cli_help = current_command.name == "cli_help" if cli_help || ARGV.include?("version") @@ -30,9 +30,9 @@ module Bundler def get_constant(name) const_name = { - "pry" => :Pry, "ripl" => :Ripl, - "irb" => :IRB, }[name] Object.const_get(const_name) rescue NameError @@ -55,20 +55,20 @@ module Bundler end config = { - :name => name, :underscored_name => underscored_name, - :namespaced_path => namespaced_path, - :makefile_path => "#{underscored_name}/#{underscored_name}", - :constant_name => constant_name, - :constant_array => constant_array, - :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name, - :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email, - :test => options[:test], - :ext => options[:ext], - :exe => options[:exe], - :bundler_version => bundler_dependency_version, - :git => use_git, - :_username => _username.empty? ? "[USERNAME]" : _username, :required_ruby_version => required_ruby_version, :minitest_constant_name => minitest_constant_name, } @@ -9,91 +9,22 @@ module Bundler attr_reader :autorequire attr_reader :groups, :platforms, :gemfile, :path, :git, :, :branch, :ref, :force_ruby_platform - # rubocop:disable Naming/VariableNumber PLATFORM_MAP = { - :ruby => Gem::Platform::RUBY, - :ruby_18 => Gem::Platform::RUBY, - :ruby_19 => Gem::Platform::RUBY, - :ruby_20 => Gem::Platform::RUBY, - :ruby_21 => Gem::Platform::RUBY, - :ruby_22 => Gem::Platform::RUBY, - :ruby_23 => Gem::Platform::RUBY, - :ruby_24 => Gem::Platform::RUBY, - :ruby_25 => Gem::Platform::RUBY, - :ruby_26 => Gem::Platform::RUBY, - :ruby_27 => Gem::Platform::RUBY, - :ruby_30 => Gem::Platform::RUBY, - :ruby_31 => Gem::Platform::RUBY, - :mri => Gem::Platform::RUBY, - :mri_18 => Gem::Platform::RUBY, - :mri_19 => Gem::Platform::RUBY, - :mri_20 => Gem::Platform::RUBY, - :mri_21 => Gem::Platform::RUBY, - :mri_22 => Gem::Platform::RUBY, - :mri_23 => Gem::Platform::RUBY, - :mri_24 => Gem::Platform::RUBY, - :mri_25 => Gem::Platform::RUBY, - :mri_26 => Gem::Platform::RUBY, - :mri_27 => Gem::Platform::RUBY, - :mri_30 => Gem::Platform::RUBY, - :mri_31 => Gem::Platform::RUBY, - :rbx => Gem::Platform::RUBY, - :truffleruby => Gem::Platform::RUBY, - :jruby => Gem::Platform::JAVA, - :jruby_18 => Gem::Platform::JAVA, - :jruby_19 => Gem::Platform::JAVA, - :windows => Gem::Platform::WINDOWS, - :mswin => Gem::Platform::MSWIN, - :mswin_18 => Gem::Platform::MSWIN, - :mswin_19 => Gem::Platform::MSWIN, - :mswin_20 => Gem::Platform::MSWIN, - :mswin_21 => Gem::Platform::MSWIN, - :mswin_22 => Gem::Platform::MSWIN, - :mswin_23 => Gem::Platform::MSWIN, - :mswin_24 => Gem::Platform::MSWIN, - :mswin_25 => Gem::Platform::MSWIN, - :mswin_26 => Gem::Platform::MSWIN, - :mswin_27 => Gem::Platform::MSWIN, - :mswin_30 => Gem::Platform::MSWIN, - :mswin_31 => Gem::Platform::MSWIN, - :mswin64 => Gem::Platform::MSWIN64, - :mswin64_19 => Gem::Platform::MSWIN64, - :mswin64_20 => Gem::Platform::MSWIN64, - :mswin64_21 => Gem::Platform::MSWIN64, - :mswin64_22 => Gem::Platform::MSWIN64, - :mswin64_23 => Gem::Platform::MSWIN64, - :mswin64_24 => Gem::Platform::MSWIN64, - :mswin64_25 => Gem::Platform::MSWIN64, - :mswin64_26 => Gem::Platform::MSWIN64, - :mswin64_27 => Gem::Platform::MSWIN64, - :mswin64_30 => Gem::Platform::MSWIN64, - :mswin64_31 => Gem::Platform::MSWIN64, - :mingw => Gem::Platform::MINGW, - :mingw_18 => Gem::Platform::MINGW, - :mingw_19 => Gem::Platform::MINGW, - :mingw_20 => Gem::Platform::MINGW, - :mingw_21 => Gem::Platform::MINGW, - :mingw_22 => Gem::Platform::MINGW, - :mingw_23 => Gem::Platform::MINGW, - :mingw_24 => Gem::Platform::MINGW, - :mingw_25 => Gem::Platform::MINGW, - :mingw_26 => Gem::Platform::MINGW, - :mingw_27 => Gem::Platform::MINGW, - :mingw_30 => Gem::Platform::MINGW, - :mingw_31 => Gem::Platform::MINGW, - :x64_mingw => Gem::Platform::X64_MINGW, - :x64_mingw_20 => Gem::Platform::X64_MINGW, - :x64_mingw_21 => Gem::Platform::X64_MINGW, - :x64_mingw_22 => Gem::Platform::X64_MINGW, - :x64_mingw_23 => Gem::Platform::X64_MINGW, - :x64_mingw_24 => Gem::Platform::X64_MINGW, - :x64_mingw_25 => Gem::Platform::X64_MINGW, - :x64_mingw_26 => Gem::Platform::X64_MINGW, - :x64_mingw_27 => Gem::Platform::X64_MINGW, - :x64_mingw_30 => Gem::Platform::X64_MINGW, - :x64_mingw_31 => Gem::Platform::X64_MINGW, - }.freeze - # rubocop:enable Naming/VariableNumber def initialize(name, version, options = {}, &blk) type = options["type"] || :runtime @@ -12,7 +12,7 @@ module Bundler super() @name = name @version = Gem::Version.create version - @platform = platform.nil? ? nil : Gem::Platform.new(platform) @spec_fetcher = spec_fetcher @dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) } @@ -114,10 +114,10 @@ module Bundler @groups.each do |group| g.add_nodes( group, { - :style => "filled", :fillcolor => "#B9B9D5", - :shape => "box3d", - :fontsize => 16, }.merge(@node_options[group]) ) end @@ -100,9 +100,9 @@ module Bundler private TYPES = { - GIT => Bundler::Source::Git, - GEM => Bundler::Source::Rubygems, - PATH => Bundler::Source::Path, PLUGIN => Bundler::Plugin, }.freeze @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-ADD" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-BINSTUBS" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CACHE" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CHECK" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CLEAN" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CONFIG" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-config\fR \- Set bundler configuration options @@ -0,0 +1,53 @@ @@ -0,0 +1,44 @@ @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-DOCTOR" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-doctor\fR \- Checks the bundle for common problems @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-EXEC" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-exec\fR \- Execute a command in the context of the bundle @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-GEM" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-HELP" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-help\fR \- Displays detailed help for each subcommand @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INFO" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-info\fR \- Show information for the given gem in your bundle @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INIT" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-init\fR \- Generates a Gemfile into the current working directory @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INJECT" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INSTALL" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-LIST" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-list\fR \- List all the gems in the bundle @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-LOCK" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-OPEN" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-OUTDATED" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-outdated\fR \- List installed gems with newer versions available @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-PLATFORM" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-platform\fR \- Displays platform compatibility information @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-PLUGIN" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-plugin\fR \- Manage Bundler plugins @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-PRISTINE" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-REMOVE" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-remove\fR \- Removes gems from the Gemfile @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-SHOW" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-UPDATE" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-update\fR \- Update your gems to the latest available versions @@ -0,0 +1,35 @@ @@ -0,0 +1,24 @@ @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-VIZ" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE" "1" "August 2022" "" "" . .SH "NAME" \fBbundle\fR \- Ruby Dependency Management @@ -124,6 +124,10 @@ Removes gems from the Gemfile \fBbundle plugin(1)\fR \fIbundle\-plugin\.1\.html\fR Manage Bundler plugins . .SH "PLUGINS" When running a command that isn\'t listed in PRIMARY COMMANDS or UTILITIES, Bundler will try to find an executable on your path named \fBbundler\-<command>\fR and execute it, passing down any extra arguments to it\. . @@ -100,6 +100,9 @@ We divide `bundle` subcommands into primary commands and utilities: * [`bundle plugin(1)`](bundle-plugin.1.html): Manage Bundler plugins ## PLUGINS When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES, @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://.com/rtomayko/ronn/tree/0.7.3 . -.TH "GEMFILE" "5" "August 2022" "" "" . .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs @@ -254,19 +254,15 @@ There are a number of \fBGemfile\fR platforms: . .TP \fBruby\fR -C Ruby (MRI), Rubinius or TruffleRuby, but \fBNOT\fR Windows . .TP \fBmri\fR -Same as \fIruby\fR, but only C Ruby (MRI) . .TP -\fBmingw\fR -Windows 32 bit \'mingw32\' platform (aka RubyInstaller) -. -.TP -\fBx64_mingw\fR -Windows 64 bit \'mingw32\' platform (aka RubyInstaller x64) . .TP \fBrbx\fR @@ -280,15 +276,8 @@ JRuby \fBtruffleruby\fR TruffleRuby . -.TP -\fBmswin\fR -Windows -. .P -You can restrict further by platform and version for all platforms \fIexcept\fR for \fBrbx\fR, \fBjruby\fR, \fBtruffleruby\fR and \fBmswin\fR\. -. -.P -To specify a version in addition to a platform, append the version number without the delimiter to the platform\. For example, to specify that a gem should only be used on platforms with Ruby 2\.3, use: . .IP "" 4 . @@ -301,26 +290,7 @@ ruby_23 .IP "" 0 . .P -The full list of platforms and supported versions includes: -. -.TP -\fBruby\fR -1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6 -. -.TP -\fBmri\fR -1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6 -. -.TP -\fBmingw\fR -1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6 -. -.TP -\fBx64_mingw\fR -2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6 -. -.P -As with groups, you can specify one or more platforms: . .IP "" 4 . @@ -328,7 +298,7 @@ As with groups, you can specify one or more platforms: gem "weakling", platforms: :jruby gem "ruby\-debug", platforms: :mri_18 -gem "nokogiri", platforms: [:mri_18, :jruby] . .fi . @@ -190,47 +190,29 @@ platforms. There are a number of `Gemfile` platforms: * `ruby`: - C Ruby (MRI), Rubinius or TruffleRuby, but `NOT` Windows * `mri`: - Same as _ruby_, but only C Ruby (MRI) - * `mingw`: - Windows 32 bit 'mingw32' platform (aka RubyInstaller) - * `x64_mingw`: - Windows 64 bit 'mingw32' platform (aka RubyInstaller x64) * `rbx`: Rubinius * `jruby`: JRuby * `truffleruby`: TruffleRuby - * `mswin`: - Windows -You can restrict further by platform and version for all platforms *except* for -`rbx`, `jruby`, `truffleruby` and `mswin`. - -To specify a version in addition to a platform, append the version number without -the delimiter to the platform. For example, to specify that a gem should only be -used on platforms with Ruby 2.3, use: ruby_23 -The full list of platforms and supported versions includes: - - * `ruby`: - 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 - * `mri`: - 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 - * `mingw`: - 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 - * `x64_mingw`: - 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 - -As with groups, you can specify one or more platforms: gem "weakling", platforms: :jruby gem "ruby-debug", platforms: :mri_18 - gem "nokogiri", platforms: [:mri_18, :jruby] All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`, `Bundler.require`) behave exactly the same as if any groups not @@ -6,6 +6,7 @@ bundle-cache(1) bundle-cache.1 bundle-check(1) bundle-check.1 bundle-clean(1) bundle-clean.1 bundle-config(1) bundle-config.1 bundle-doctor(1) bundle-doctor.1 bundle-exec(1) bundle-exec.1 bundle-gem(1) bundle-gem.1 @@ -24,4 +25,5 @@ bundle-pristine(1) bundle-pristine.1 bundle-remove(1) bundle-remove.1 bundle-show(1) bundle-show.1 bundle-update(1) bundle-update.1 bundle-viz(1) bundle-viz.1 @@ -167,11 +167,11 @@ module Bundler # to be only String key value pairs) def save_index index = { - "commands" => @commands, - "hooks" => @hooks, - "load_paths" => @load_paths, "plugin_paths" => @plugin_paths, - "sources" => @sources, } require_relative "../yaml_serializer" @@ -169,13 +169,13 @@ module Bundler installer = Bundler::RubyGemsGemInstaller.at( path, - :security_policy => Bundler.rubygems.security_policies[Bundler.settings["trust-policy"]], - :install_dir => install_path.to_s, - :bin_dir => bin_path.to_s, :ignore_dependencies => true, - :wrappers => true, - :env_shebang => true, - :build_args => options[:build_args], :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum, :bundler_extension_cache_path => extension_cache_path(spec) ) @@ -73,8 +73,8 @@ class Gem::CommandManager ].freeze ALIAS_COMMANDS = { - "i" => "install", - "login" => "signin", "logout" => "signout", }.freeze @@ -10,7 +10,7 @@ class Gem::Commands::FetchCommand < Gem::Command def initialize defaults = { :suggest_alternate => true, - :version => Gem::Requirement.default, } super "fetch", "Download a gem and place it in the current directory", defaults @@ -21,10 +21,10 @@ class Gem::Commands::InstallCommand < Gem::Command def initialize defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({ :format_executable => false, - :lock => true, :suggest_alternate => true, - :version => Gem::Requirement.default, - :without_groups => [], }) defaults.merge!(install_update_options) @@ -576,7 +576,7 @@ abort "#{deprecation_message}" require_relative "../uninstaller" ui = Gem::Uninstaller.new("gemcutter", :all => true, :ignore => true, - :version => "< 0.4") ui.uninstall rescue Gem::InstallError end @@ -21,7 +21,7 @@ class Gem::Commands::UnpackCommand < Gem::Command super "unpack", "Unpack an installed gem to the current directory", :version => Gem::Requirement.default, - :target => Dir.pwd add_option("--target=DIR", "target directory for unpacking") do |value, options| @@ -16,16 +16,16 @@ class Gem::DependencyInstaller extend Gem::Deprecate DEFAULT_OPTIONS = { # :nodoc: - :env_shebang => false, - :document => %w[ri], - :domain => :both, # HACK dup - :force => false, - :format_executable => false, # HACK dup :ignore_dependencies => false, - :prerelease => false, - :security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low? - :wrappers => true, - :build_args => nil, :build_docs_in_background => false, :install_as_default => false, }.freeze @@ -230,22 +230,22 @@ class Gem::DependencyInstaller @installed_gems = [] options = { - :bin_dir => @bin_dir, - :build_args => @build_args, - :document => @document, - :env_shebang => @env_shebang, - :force => @force, - :format_executable => @format_executable, :ignore_dependencies => @ignore_dependencies, - :prerelease => @prerelease, - :security_policy => @security_policy, - :user_install => @user_install, - :wrappers => @wrappers, - :build_root => @build_root, - :install_as_default => @install_as_default, - :dir_mode => @dir_mode, - :data_mode => @data_mode, - :prog_mode => @prog_mode, } options[:install_dir] = @install_dir if @only_install_dir @@ -397,7 +397,7 @@ class Gem::Indexer dst_name = File.join @dest_directory, file # REFACTOR: duped above FileUtils.mv src_name, dst_name, :verbose => verbose, - :force => true File.utime newest_mtime, newest_mtime, dst_name end @@ -649,9 +649,9 @@ class Gem::Installer def process_options # :nodoc: @options = { - :bin_dir => nil, - :env_shebang => false, - :force => false, :only_install_dir => false, :post_install_message => true, }.merge options @@ -103,22 +103,22 @@ class Gem::Package::TarHeader fields = header.unpack UNPACK_FORMAT - new :name => fields.shift, - :mode => strict_oct(fields.shift), - :uid => oct_or_256based(fields.shift), - :gid => oct_or_256based(fields.shift), - :size => strict_oct(fields.shift), - :mtime => strict_oct(fields.shift), :checksum => strict_oct(fields.shift), :typeflag => fields.shift, :linkname => fields.shift, - :magic => fields.shift, - :version => strict_oct(fields.shift), - :uname => fields.shift, - :gname => fields.shift, :devmajor => strict_oct(fields.shift), :devminor => strict_oct(fields.shift), - :prefix => fields.shift, :empty => empty end @@ -32,22 +32,22 @@ class Gem::RequestSet::GemDependencyAPI ENGINE_MAP = { # :nodoc: - :jruby => %w[jruby], - :jruby_18 => %w[jruby], - :jruby_19 => %w[jruby], - :maglev => %w[maglev], - :mri => %w[ruby], - :mri_18 => %w[ruby], - :mri_19 => %w[ruby], - :mri_20 => %w[ruby], - :mri_21 => %w[ruby], - :rbx => %w[rbx], - :truffleruby => %w[truffleruby], - :ruby => %w[ruby rbx maglev truffleruby], - :ruby_18 => %w[ruby rbx maglev truffleruby], - :ruby_19 => %w[ruby rbx maglev truffleruby], - :ruby_20 => %w[ruby rbx maglev truffleruby], - :ruby_21 => %w[ruby rbx maglev truffleruby], }.freeze mswin = Gem::Platform.new "x86-mswin32" @@ -56,37 +56,37 @@ class Gem::RequestSet::GemDependencyAPI x64_mingw = Gem::Platform.new "x64-mingw32" PLATFORM_MAP = { # :nodoc: - :jruby => Gem::Platform::RUBY, - :jruby_18 => Gem::Platform::RUBY, - :jruby_19 => Gem::Platform::RUBY, - :maglev => Gem::Platform::RUBY, - :mingw => x86_mingw, - :mingw_18 => x86_mingw, - :mingw_19 => x86_mingw, - :mingw_20 => x86_mingw, - :mingw_21 => x86_mingw, - :mri => Gem::Platform::RUBY, - :mri_18 => Gem::Platform::RUBY, - :mri_19 => Gem::Platform::RUBY, - :mri_20 => Gem::Platform::RUBY, - :mri_21 => Gem::Platform::RUBY, - :mswin => mswin, - :mswin_18 => mswin, - :mswin_19 => mswin, - :mswin_20 => mswin, - :mswin_21 => mswin, - :mswin64 => mswin64, - :mswin64_19 => mswin64, - :mswin64_20 => mswin64, - :mswin64_21 => mswin64, - :rbx => Gem::Platform::RUBY, - :ruby => Gem::Platform::RUBY, - :ruby_18 => Gem::Platform::RUBY, - :ruby_19 => Gem::Platform::RUBY, - :ruby_20 => Gem::Platform::RUBY, - :ruby_21 => Gem::Platform::RUBY, - :truffleruby => Gem::Platform::RUBY, - :x64_mingw => x64_mingw, :x64_mingw_20 => x64_mingw, :x64_mingw_21 => x64_mingw, }.freeze @@ -98,68 +98,68 @@ class Gem::RequestSet::GemDependencyAPI tilde_gt_2_1_0 = Gem::Requirement.new "~> 2.1.0" VERSION_MAP = { # :nodoc: - :jruby => gt_eq_0, - :jruby_18 => tilde_gt_1_8_0, - :jruby_19 => tilde_gt_1_9_0, - :maglev => gt_eq_0, - :mingw => gt_eq_0, - :mingw_18 => tilde_gt_1_8_0, - :mingw_19 => tilde_gt_1_9_0, - :mingw_20 => tilde_gt_2_0_0, - :mingw_21 => tilde_gt_2_1_0, - :mri => gt_eq_0, - :mri_18 => tilde_gt_1_8_0, - :mri_19 => tilde_gt_1_9_0, - :mri_20 => tilde_gt_2_0_0, - :mri_21 => tilde_gt_2_1_0, - :mswin => gt_eq_0, - :mswin_18 => tilde_gt_1_8_0, - :mswin_19 => tilde_gt_1_9_0, - :mswin_20 => tilde_gt_2_0_0, - :mswin_21 => tilde_gt_2_1_0, - :mswin64 => gt_eq_0, - :mswin64_19 => tilde_gt_1_9_0, - :mswin64_20 => tilde_gt_2_0_0, - :mswin64_21 => tilde_gt_2_1_0, - :rbx => gt_eq_0, - :ruby => gt_eq_0, - :ruby_18 => tilde_gt_1_8_0, - :ruby_19 => tilde_gt_1_9_0, - :ruby_20 => tilde_gt_2_0_0, - :ruby_21 => tilde_gt_2_1_0, - :truffleruby => gt_eq_0, - :x64_mingw => gt_eq_0, :x64_mingw_20 => tilde_gt_2_0_0, :x64_mingw_21 => tilde_gt_2_1_0, }.freeze WINDOWS = { # :nodoc: - :mingw => :only, - :mingw_18 => :only, - :mingw_19 => :only, - :mingw_20 => :only, - :mingw_21 => :only, - :mri => :never, - :mri_18 => :never, - :mri_19 => :never, - :mri_20 => :never, - :mri_21 => :never, - :mswin => :only, - :mswin_18 => :only, - :mswin_19 => :only, - :mswin_20 => :only, - :mswin_21 => :only, - :mswin64 => :only, - :mswin64_19 => :only, - :mswin64_20 => :only, - :mswin64_21 => :only, - :rbx => :never, - :ruby => :never, - :ruby_18 => :never, - :ruby_19 => :never, - :ruby_20 => :never, - :ruby_21 => :never, - :x64_mingw => :only, :x64_mingw_20 => :only, :x64_mingw_21 => :only, }.freeze @@ -10,13 +10,13 @@ require_relative "version" class Gem::Requirement OPS = { #:nodoc: - "=" => lambda {|v, r| v == r }, - "!=" => lambda {|v, r| v != r }, - ">" => lambda {|v, r| v > r }, - "<" => lambda {|v, r| v < r }, - ">=" => lambda {|v, r| v >= r }, - "<=" => lambda {|v, r| v <= r }, - "~>" => lambda {|v, r| v >= r && v.release < r.bump }, }.freeze SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc: @@ -376,8 +376,8 @@ module Gem::Security # * The certificate contains a subject key identifier EXTENSIONS = { - "basicConstraints" => "CA:FALSE", - "keyUsage" => "keyEncipherment,dataEncipherment,digitalSignature", "subjectKeyIdentifier" => "hash", }.freeze @@ -6,12 +6,12 @@ module Gem::Security NoSecurity = Policy.new( "No Security", - :verify_data => false, - :verify_signer => false, - :verify_chain => false, - :verify_root => false, - :only_trusted => false, - :only_signed => false ) ## @@ -24,12 +24,12 @@ module Gem::Security AlmostNoSecurity = Policy.new( "Almost No Security", - :verify_data => true, - :verify_signer => false, - :verify_chain => false, - :verify_root => false, - :only_trusted => false, - :only_signed => false ) ## @@ -41,12 +41,12 @@ module Gem::Security LowSecurity = Policy.new( "Low Security", - :verify_data => true, - :verify_signer => true, - :verify_chain => false, - :verify_root => false, - :only_trusted => false, - :only_signed => false ) ## @@ -60,12 +60,12 @@ module Gem::Security MediumSecurity = Policy.new( "Medium Security", - :verify_data => true, - :verify_signer => true, - :verify_chain => true, - :verify_root => true, - :only_trusted => true, - :only_signed => false ) ## @@ -79,12 +79,12 @@ module Gem::Security HighSecurity = Policy.new( "High Security", - :verify_data => true, - :verify_signer => true, - :verify_chain => true, - :verify_root => true, - :only_trusted => true, - :only_signed => true ) ## @@ -92,23 +92,23 @@ module Gem::Security SigningPolicy = Policy.new( "Signing Policy", - :verify_data => false, - :verify_signer => true, - :verify_chain => true, - :verify_root => true, - :only_trusted => false, - :only_signed => false ) ## # Hash of configured security policies Policies = { - "NoSecurity" => NoSecurity, "AlmostNoSecurity" => AlmostNoSecurity, - "LowSecurity" => LowSecurity, - "MediumSecurity" => MediumSecurity, - "HighSecurity" => HighSecurity, # SigningPolicy is not intended for use by `gem -P` so do not list it }.freeze @@ -8,7 +8,7 @@ class Gem::Security::TrustDir # Default permissions for the trust directory and its contents DEFAULT_PERMISSIONS = { - :trust_dir => 0700, :trusted_cert => 0600, }.freeze @@ -12,8 +12,8 @@ class Gem::Source include Gem::Text FILES = { # :nodoc: - :released => "specs", - :latest => "latest_specs", :prerelease => "prerelease_specs", }.freeze @@ -75,7 +75,7 @@ class Gem::Specification < Gem::BasicSpecification SPECIFICATION_VERSION_HISTORY = { # :nodoc: -1 => ["(RubyGems versions up to and including 0.7 did not have versioned specifications)"], - 1 => [ 'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"', '"test_file=x" is a shortcut for "test_files=[x]"', ], @@ -93,10 +93,10 @@ class Gem::Specification < Gem::BasicSpecification MARSHAL_FIELDS = { # :nodoc: -1 => 16, - 1 => 16, - 2 => 16, - 3 => 17, - 4 => 18, }.freeze today = Time.now.utc @@ -124,35 +124,35 @@ class Gem::Specification < Gem::BasicSpecification # Map of attribute names to default values. @@default_value = { - :authors => [], - :autorequire => nil, - :bindir => "bin", - :cert_chain => [], - :date => nil, - :dependencies => [], - :description => nil, - :email => nil, - :executables => [], - :extensions => [], - :extra_rdoc_files => [], - :files => [], - :homepage => nil, - :licenses => [], - :metadata => {}, - :name => nil, - :platform => Gem::Platform::RUBY, - :post_install_message => nil, - :rdoc_options => [], - :require_paths => ["lib"], - :required_ruby_version => Gem::Requirement.default, :required_rubygems_version => Gem::Requirement.default, - :requirements => [], - :rubygems_version => Gem::VERSION, - :signing_key => nil, - :specification_version => CURRENT_SPECIFICATION_VERSION, - :summary => nil, - :test_files => [], - :version => nil, }.freeze # rubocop:disable Style/MutableConstant @@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification # These are common require paths. REQUIRE_PATHS = { # :nodoc: - "lib" => "lib".freeze, "test" => "test".freeze, - "ext" => "ext".freeze, }.freeze # These are common require path lists. This hash is used to optimize |