diff options
47 files changed, 353 insertions, 439 deletions
@@ -29,7 +29,7 @@ module Bundler # commit instance variable then we can't determine its commits SHA. git_dir = File.expand_path("../../../.git", __dir__) if File.directory?(git_dir) - return @git_commit_sha = IO.popen(%w[git rev-parse --short HEAD], { :chdir => git_dir }, &:read).strip.freeze end @git_commit_sha ||= "unknown" @@ -17,6 +17,6 @@ end Capistrano::Configuration.instance(:must_exist).load do before "deploy:finalize_update", "bundle:install" - Bundler::Deployment.define_task(self, :task, :except => { :no_release => true }) set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" } end @@ -23,7 +23,7 @@ module Bundler def from_gem(io, pathname, algo = DEFAULT_ALGORITHM) digest = Bundler::SharedHelpers.digest(algo.upcase).new - buf = String.new(:capacity => DEFAULT_BLOCK_SIZE) digest << io.readpartial(DEFAULT_BLOCK_SIZE, buf) until io.eof? Checksum.new(algo, digest.hexdigest!, Source.new(:gem, pathname)) end @@ -80,10 +80,10 @@ module Bundler unprinted_warnings.each {|w| Bundler.ui.warn(w) } end - check_unknown_options!(:except => [:config, :exec]) stop_on_unknown_option! :exec - desc "cli_help", "Prints a summary of bundler commands", :hide => true def cli_help version Bundler.ui.info "\n" @@ -99,19 +99,19 @@ module Bundler shell.say "Bundler commands:\n\n" shell.say " Primary commands:\n" - shell.print_table(primary_commands, :indent => 4, :truncate => true) shell.say shell.say " Utilities:\n" - shell.print_table(utilities, :indent => 4, :truncate => true) shell.say self.class.send(:class_options_help, shell) end default_task(Bundler.feature_flag.default_cli_command) - class_option "no-color", :type => :boolean, :desc => "Disable colorization in output" - class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM", - :desc => "Specify the number of times you wish to attempt network commands" - class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V" def help(cli = nil) case cli @@ -155,8 +155,8 @@ module Bundler Gemfile to a gem with a gemspec, the --gemspec option will automatically add each dependency listed in the gemspec file to the newly created Gemfile. D - method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile" - method_option "gemfile", :type => :string, :banner => "Use the specified name for the gemfile instead of 'Gemfile'" def init require_relative "cli/init" Init.new(options.dup).run @@ -168,12 +168,9 @@ module Bundler all gems are found, Bundler prints a success message and exits with a status of 0. If not, the first missing gem is listed and Bundler exits status 1. D - method_option "dry-run", :type => :boolean, :default => false, :banner => - "Lock the Gemfile" - method_option "gemfile", :type => :string, :banner => - "Use the specified gemfile instead of Gemfile" - method_option "path", :type => :string, :banner => - "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}" def check remembered_flag_deprecation("path") @@ -187,13 +184,12 @@ module Bundler long_desc <<-D Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning. D - method_option "install", :type => :boolean, :banner => - "Runs 'bundle install' after removing the gems from the Gemfile" def remove(*gems) if ARGV.include?("--install") message = "The `--install` flag has been deprecated. `bundle install` is triggered by default." removed_message = "The `--install` flag has been removed. `bundle install` is triggered by default." - SharedHelpers.major_deprecation(2, message, :removed_message => removed_message) end require_relative "cli/remove" @@ -211,47 +207,27 @@ module Bundler If the bundle has already been installed, bundler will tell you so and then exit. D - method_option "binstubs", :type => :string, :lazy_default => "bin", :banner => - "Generate bin stubs for bundled gems to ./bin" - method_option "clean", :type => :boolean, :banner => - "Run bundle clean automatically after install" - method_option "deployment", :type => :boolean, :banner => - "Install using defaults tuned for deployment environments" - method_option "frozen", :type => :boolean, :banner => - "Do not allow the Gemfile.lock to be updated after this install" - method_option "full-index", :type => :boolean, :banner => - "Fall back to using the single-file index of all gems" - method_option "gemfile", :type => :string, :banner => - "Use the specified gemfile instead of Gemfile" - method_option "jobs", :aliases => "-j", :type => :numeric, :banner => - "Specify the number of jobs to run in parallel" - method_option "local", :type => :boolean, :banner => - "Do not attempt to fetch gems remotely and use the gem cache instead" - method_option "prefer-local", :type => :boolean, :banner => - "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely" - method_option "no-cache", :type => :boolean, :banner => - "Don't update the existing gem cache." - method_option "redownload", :type => :boolean, :aliases => "--force", :banner => - "Force downloading every gem." - method_option "no-prune", :type => :boolean, :banner => - "Don't remove stale gems from the cache." - method_option "path", :type => :string, :banner => - "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}" - method_option "quiet", :type => :boolean, :banner => - "Only output warnings and errors." - method_option "shebang", :type => :string, :banner => - "Specify a different shebang executable name than the default (usually 'ruby')" - method_option "standalone", :type => :array, :lazy_default => [], :banner => - "Make a bundle that can work without the Bundler runtime" - method_option "system", :type => :boolean, :banner => - "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application" - method_option "trust-policy", :alias => "P", :type => :string, :banner => - "Gem trust policy (like gem install -P). Must be one of " + - Bundler.rubygems.security_policy_keys.join("|") - method_option "without", :type => :array, :banner => - "Exclude gems that are part of the specified named group." - method_option "with", :type => :array, :banner => - "Include gems that are part of the specified named group." def install SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force") @@ -264,7 +240,7 @@ module Bundler remembered_negative_flag_deprecation("no-deployment") require_relative "cli/install" - Bundler.settings.temporary(:no_install => false) do Install.new(options.dup).run end end @@ -277,44 +253,27 @@ module Bundler update when you have changed the Gemfile, or if you want to get the newest possible versions of the gems in the bundle. D - method_option "full-index", :type => :boolean, :banner => - "Fall back to using the single-file index of all gems" - method_option "gemfile", :type => :string, :banner => - "Use the specified gemfile instead of Gemfile" - method_option "group", :aliases => "-g", :type => :array, :banner => - "Update a specific group" - method_option "jobs", :aliases => "-j", :type => :numeric, :banner => - "Specify the number of jobs to run in parallel" - method_option "local", :type => :boolean, :banner => - "Do not attempt to fetch gems remotely and use the gem cache instead" - method_option "quiet", :type => :boolean, :banner => - "Only output warnings and errors." - method_option "source", :type => :array, :banner => - "Update a specific source (and all gems associated with it)" - method_option "redownload", :type => :boolean, :aliases => "--force", :banner => - "Force downloading every gem." - method_option "ruby", :type => :boolean, :banner => - "Update ruby specified in Gemfile.lock" - method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner => - "Update the locked version of bundler" - method_option "", :type => :boolean, :banner => - "Prefer updating only to next version" - method_option "minor", :type => :boolean, :banner => - "Prefer updating only to next minor version" - method_option "major", :type => :boolean, :banner => - "Prefer updating to next major version (default)" - method_option "pre", :type => :boolean, :banner => - "Always choose the highest allowed version when updating gems, regardless of prerelease status" - method_option "strict", :type => :boolean, :banner => - "Do not allow any gem to be updated past latest -- | --minor | --major" - method_option "conservative", :type => :boolean, :banner => - "Use bundle install conservative update behavior and do not allow shared dependencies to be updated." - method_option "all", :type => :boolean, :banner => - "Update everything." def update(*gems) SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force") require_relative "cli/update" - Bundler.settings.temporary(:no_install => false) do Update.new(options, gems).run end end @@ -324,25 +283,25 @@ module Bundler Show lists the names and versions of all gems that are required by your Gemfile. Calling show with [GEM] will list the exact location of that gem on your machine. D - method_option "paths", :type => :boolean, - :banner => "List the paths of all gems that are required by your Gemfile." - method_option "outdated", :type => :boolean, - :banner => "Show verbose output including whether gems are outdated." def show(gem_name = nil) if ARGV.include?("--outdated") message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement" removed_message = "the `--outdated` flag to `bundle show` was undocumented and has been removed without replacement" - SharedHelpers.major_deprecation(2, message, :removed_message => removed_message) end require_relative "cli/show" Show.new(options, gem_name).run end desc "list", "List all gems in the bundle" - method_option "name-only", :type => :boolean, :banner => "print only the gem names" - method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups" - method_option "without-group", :type => :array, :default => [], :banner => "print all gems except from a given set of groups" - method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle" def list require_relative "cli/list" List.new(options).run @@ -351,8 +310,8 @@ module Bundler map aliases_for("list") desc "info GEM [OPTIONS]", "Show information for the given gem" - method_option "path", :type => :boolean, :banner => "Print full path to gem" - method_option "version", :type => :boolean, :banner => "Print gem version" def info(gem_name) require_relative "cli/info" Info.new(options, gem_name).run @@ -364,18 +323,12 @@ module Bundler or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems. D - method_option "force", :type => :boolean, :default => false, :banner => - "Overwrite existing binstubs if they exist" - method_option "path", :type => :string, :lazy_default => "bin", :banner => - "Binstub destination directory (default bin)" - method_option "shebang", :type => :string, :banner => - "Specify a different shebang executable name than the default (usually 'ruby')" - method_option "standalone", :type => :boolean, :banner => - "Make binstubs that can work without the Bundler runtime" - method_option "all", :type => :boolean, :banner => - "Install binstubs for all gems" - method_option "all-platforms", :type => :boolean, :default => false, :banner => - "Install binstubs for all platforms" def binstubs(*gems) require_relative "cli/binstubs" Binstubs.new(options, gems).run @@ -385,19 +338,18 @@ module Bundler long_desc <<-D Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step. D - method_option "version", :aliases => "-v", :type => :string - method_option "group", :aliases => "-g", :type => :string - method_option "source", :aliases => "-s", :type => :string - method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string." - method_option "path", :type => :string - method_option "git", :type => :string - method_option "", :type => :string - method_option "branch", :type => :string - method_option "ref", :type => :string - method_option "skip-install", :type => :boolean, :banner => - "Adds gem to the Gemfile but does not install it" - method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem" - method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem" def add(*gems) require_relative "cli/add" Add.new(options.dup, gems).run @@ -413,55 +365,46 @@ module Bundler For more information on level options (--major, --minor, --, --strict) see documentation on the same options on the update command. D - method_option "group", :type => :string, :banner => "List gems from a specific group" - method_option "groups", :type => :boolean, :banner => "List gems organized by groups" - method_option "local", :type => :boolean, :banner => - "Do not attempt to fetch gems remotely and use the gem cache instead" - method_option "pre", :type => :boolean, :banner => "Check for newer gems" - method_option "source", :type => :array, :banner => "Check against a specific source" - method_option "filter-strict", :type => :boolean, :aliases => "--strict", :banner => - "Only list newer versions allowed by your Gemfile requirements" - method_option "update-strict", :type => :boolean, :banner => - "Strict conservative resolution, do not allow any gem to be updated past latest -- | --minor | --major" - method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version" - method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)" - method_option "", :type => :boolean, :banner => "Prefer updating only to next version" - method_option "filter-major", :type => :boolean, :banner => "Only list major newer versions" - method_option "filter-minor", :type => :boolean, :banner => "Only list minor newer versions" - method_option "filter-", :type => :boolean, :banner => "Only list newer versions" - method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner => - "Use minimal formatting for more parseable output" - method_option "json", :type => :boolean, :banner => "Produce parseable json output" - method_option "only-explicit", :type => :boolean, :banner => - "Only list gems specified in your Gemfile, not their dependencies" def outdated(*gems) require_relative "cli/outdated" Outdated.new(options, gems).run end desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance" - method_option "group", :aliases => "-g", :type => :array, :banner => - "Fetch funding information for a specific group" def fund require_relative "cli/fund" Fund.new(options).run end desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache" - method_option "all", :type => :boolean, - :default => Bundler.feature_flag.cache_all?, - :banner => "Include all sources (including path and git)." - method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one" - method_option "cache-path", :type => :string, :banner => - "Specify a different cache path than the default (vendor/cache)." - method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile" - method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only update the cache." - method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." - method_option "path", :type => :string, :banner => - "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}" - method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors." - method_option "frozen", :type => :boolean, :banner => - "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install" long_desc <<-D The cache command will copy the .gem files for every gem in the bundle into the directory ./vendor/cache. If you then check that directory into your source @@ -481,7 +424,7 @@ module Bundler "The `--path` flag has been removed because its semantics were unclear. " \ "Use `bundle config cache_path` to configure the path of your cache of gems, " \ "and `bundle config path` to configure the path where your gems are installed." - SharedHelpers.major_deprecation 2, message, :removed_message => removed_message end require_relative "cli/cache" @@ -491,8 +434,8 @@ module Bundler map aliases_for("cache") desc "exec [OPTIONS]", "Run the command in context of the bundle" - method_option :keep_file_descriptors, :type => :boolean, :default => true - method_option :gemfile, :type => :string, :required => false long_desc <<-D Exec runs a command, providing it access to the gems in the bundle. While using bundle exec you can require and call the bundled gems as if they were installed @@ -502,7 +445,7 @@ module Bundler if ARGV.include?("--no-keep-file-descriptors") message = "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to" removed_message = "The `--no-keep-file-descriptors` has been removed. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to" - SharedHelpers.major_deprecation(2, message, :removed_message => removed_message) end require_relative "cli/exec" @@ -527,7 +470,7 @@ module Bundler subcommand "config", Config desc "open GEM", "Opens the source directory of the given bundled gem" - method_option "path", :type => :string, :lazy_default => "", :banner => "Open relative path of the gem source." def open(name) require_relative "cli/open" Open.new(options, name).run @@ -572,17 +515,17 @@ module Bundler end unless Bundler.feature_flag.bundler_3_mode? - desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true long_desc <<-D Viz generates a PNG file of the current Gemfile as a dependency graph. Viz requires the ruby-graphviz gem (and its dependencies). The associated gems must also be installed via 'bundle install'. D - method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option" - method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..." - method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency." - method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version." - method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group." def viz SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://.com/rubygems/bundler-graph" require_relative "cli/viz" @@ -593,23 +536,23 @@ module Bundler old_gem = instance_method(:gem) desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem" - method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library." - method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`." - method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR", - :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, - :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)" - method_option :ext, :type => :string, :desc => "Generate the boilerplate for C extension code.", :enum => EXTENSIONS - method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library." - method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`." - method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`." - method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`." - method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library", - :desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`." - method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "", - :desc => "Generate CI configuration, either Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (|gitlab|circle)`" - method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "", - :desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`" - method_option :_username, :type => :string, :default => Bundler.settings["gem._username"], :banner => "Set your username on ", :desc => "Fill in username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem._username <your_username>`." def gem(name) end @@ -640,29 +583,24 @@ module Bundler File.expand_path("templates", __dir__) end - desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true - method_option "dry-run", :type => :boolean, :default => false, :banner => - "Only print out changes, do not clean gems" - method_option "force", :type => :boolean, :default => false, :banner => - "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application." def clean require_relative "cli/clean" Clean.new(options.dup).run end desc "platform [OPTIONS]", "Displays platform compatibility information" - method_option "ruby", :type => :boolean, :default => false, :banner => - "only display ruby related platform information" def platform require_relative "cli/platform" Platform.new(options).run end - desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true - method_option "source", :type => :string, :banner => - "Install gem from the given source" - method_option "group", :type => :string, :banner => - "Install gem into a bundler group" def inject(name, version) SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command" require_relative "cli/inject" @@ -670,36 +608,21 @@ module Bundler end desc "lock", "Creates a lockfile without installing" - method_option "update", :type => :array, :lazy_default => true, :banner => - "ignore the existing lockfile, update all gems by default, or update list of given gems" - method_option "local", :type => :boolean, :default => false, :banner => - "do not attempt to fetch remote gemspecs and use the local gem cache only" - method_option "print", :type => :boolean, :default => false, :banner => - "print the lockfile to STDOUT instead of writing to the file system" - method_option "gemfile", :type => :string, :banner => - "Use the specified gemfile instead of Gemfile" - method_option "lockfile", :type => :string, :default => nil, :banner => - "the path the lockfile should be written to" - method_option "full-index", :type => :boolean, :default => false, :banner => - "Fall back to using the single-file index of all gems" - method_option "add-platform", :type => :array, :default => [], :banner => - "Add a new platform to the lockfile" - method_option "remove-platform", :type => :array, :default => [], :banner => - "Remove a platform from the lockfile" - method_option "", :type => :boolean, :banner => - "If updating, prefer updating only to next version" - method_option "minor", :type => :boolean, :banner => - "If updating, prefer updating only to next minor version" - method_option "major", :type => :boolean, :banner => - "If updating, prefer updating to next major version (default)" - method_option "pre", :type => :boolean, :banner => - "If updating, always choose the highest allowed version, regardless of prerelease status" - method_option "strict", :type => :boolean, :banner => - "If updating, do not allow any gem to be updated past latest -- | --minor | --major" - method_option "conservative", :type => :boolean, :banner => - "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated" - method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner => - "Update the locked version of bundler" def lock require_relative "cli/lock" Lock.new(options).run @@ -716,10 +639,8 @@ module Bundler missing dependencies are detected, Bundler prints them and exits status 1. Otherwise, Bundler prints a success message and exits with a status of 0. D - method_option "gemfile", :type => :string, :banner => - "Use the specified gemfile instead of Gemfile" - method_option "quiet", :type => :boolean, :banner => - "Only output warnings and errors." def doctor require_relative "cli/doctor" Doctor.new(options).run @@ -783,7 +704,7 @@ module Bundler if deprecated_ext_value?(arguments) message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been deprecated. Please select a language, e.g. `--ext=rust` to generate a Rust extension. This gem will now be generated as if `--ext=c` was used." removed_message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been removed. Please select a language, e.g. `--ext=rust` to generate a Rust extension." - SharedHelpers.major_deprecation 2, message, :removed_message => removed_message arguments[arguments.index("--ext")] = "--ext=c" end end @@ -918,7 +839,7 @@ module Bundler "remembered across bundler invocations, which bundler will no longer " \ "do. Instead please use `bundle config set #{option_name} " \ "#{option_value}`, and stop using this flag" - Bundler::SharedHelpers.major_deprecation 2, message, :removed_message => removed_message end end end @@ -28,9 +28,9 @@ module Bundler dependencies = gems.map {|g| Bundler::Dependency.new(g, version, options) } Injector.inject(dependencies, - :conservative_versioning => options[:version].nil?, # Perform conservative versioning only when version is not specified - :optimistic => options[:optimistic], - :strict => options[:strict]) end def validate_options! @@ -17,9 +17,9 @@ module Bundler installer = Installer.new(Bundler.root, Bundler.definition) installer_opts = { - :force => options[:force], - :binstubs_cmd => true, - :all_platforms => options["all-platforms"], } if options[:all] @@ -45,7 +45,7 @@ module Bundler next end - Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do installer.generate_standalone_bundler_executable_stubs(spec, installer_opts) end else @@ -19,7 +19,7 @@ module Bundler # TODO: move cache contents here now that all bundles are locked custom_path = Bundler.settings[:path] if options[:path] - Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do Bundler.load.cache(custom_path) end end @@ -32,7 +32,7 @@ module Bundler Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present" exit 1 else - Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"] Bundler.ui.info "The Gemfile's dependencies are satisfied" end end @@ -2,17 +2,17 @@ module Bundler class CLI::Config < Thor - class_option :parseable, :type => :boolean, :banner => "Use minimal formatting for more parseable output" def self.scope_options - method_option :global, :type => :boolean, :banner => "Only change the global config" - method_option :local, :type => :boolean, :banner => "Only change the local config" end private_class_method :scope_options - desc "base NAME [VALUE]", "The Bundler 1 config interface", :hide => true scope_options - method_option :delete, :type => :boolean, :banner => "delete" def base(name = nil, *value) new_args = if ARGV.size == 1 @@ -27,7 +27,7 @@ module Bundler message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead." removed_message = "Using the `config` command without a subcommand [list, get, set, unset] is has been removed. Use `bundle #{new_args.join(" ")}` instead." - SharedHelpers.major_deprecation 3, message, :removed_message => removed_message Base.new(options, name, value, self).run end @@ -11,7 +11,7 @@ module Bundler def run message = "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`" removed_message = "bundle console has been replaced by `bin/console` generated by `bundle gem <name>`" - Bundler::SharedHelpers.major_deprecation 2, message, :removed_message => removed_message group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require ARGV.clear @@ -12,7 +12,7 @@ module Bundler @options = options @cmd = args.shift @args = args - @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby? end def run @@ -59,23 +59,23 @@ 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 => extension, - :exe => options[:exe], - :bundler_version => bundler_dependency_version, - :git => use_git, - :_username => _username.empty? ? "[USERNAME]" : _username, - :required_ruby_version => required_ruby_version, - :rust_builder_required_rubygems_version => rust_builder_required_rubygems_version, - :minitest_constant_name => minitest_constant_name, } ensure_safe_gem_name(name, constant_array) @@ -236,7 +236,7 @@ module Bundler end if use_git - IO.popen(%w[git add .], { :chdir => target }, &:read) end # Open gemspec in editor @@ -382,18 +382,18 @@ module Bundler if options[:rubocop] Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop", - :removed_message => "--rubocop has been removed, use --linter=rubocop" "rubocop" else Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter", - :removed_message => "--no-rubocop has been removed, use --linter" false end elsif !Bundler.settings["gem.rubocop"].nil? Bundler::SharedHelpers.major_deprecation 2, "config gem.rubocop is deprecated; we've updated your config to use gem.linter instead", - :removed_message => "config gem.rubocop has been removed; we've updated your config to use gem.linter instead" Bundler.settings["gem.rubocop"] ? "rubocop" : false end end @@ -52,7 +52,7 @@ module Bundler if options["binstubs"] Bundler::SharedHelpers.major_deprecation 2, "The --binstubs option will be removed in favor of `bundle binstubs --all`", - :removed_message => "The --binstubs option have been removed in favor of `bundle binstubs --all`" end Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins? @@ -62,7 +62,7 @@ module Bundler installer = Installer.install(Bundler.root, definition, options) - Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle? end @@ -96,7 +96,7 @@ module Bundler def warn_if_root return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero? Bundler.ui.warn "Don't run Bundler as root. Installing your bundle as root " \ - "will break this application for all non-root users on this machine.", :wrap => true end def dependencies_count_for(definition) @@ -149,7 +149,7 @@ module Bundler Bundler.settings.set_command_option_if_given :path, options[:path] if options["standalone"] && Bundler.settings[:path].nil? && !options["local"] - Bundler.settings.temporary(:path_relative_to_cwd => false) do Bundler.settings.set_command_option :path, "bundle" end end @@ -26,14 +26,14 @@ module Bundler if update.is_a?(Array) # unlocking specific gems Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update) - update = { :gems => update, :conservative => conservative } elsif update && conservative - update = { :conservative => conservative } elsif update && bundler - update = { :bundler => bundler } end - Bundler.settings.temporary(:frozen => false) do definition = Bundler.definition(update) Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update] @@ -21,7 +21,7 @@ module Bundler require "shellwords" command = Shellwords.split(editor) << File.join([root_path, path].compact) Bundler.with_original_env do - system(*command, { :chdir => root_path }) end || Bundler.ui.info("Could not run '#{command.join(" ")}'") end end @@ -41,12 +41,12 @@ module Bundler # We're doing a full update Bundler.definition(true) else - Bundler.definition(:gems => gems, :sources => sources) end Bundler::CLI::Common.configure_gem_version_promoter( Bundler.definition, - options.merge(:strict => @strict) ) definition_resolution = proc do @@ -90,10 +90,10 @@ module Bundler end outdated_gems << { - :active_spec => active_spec, - :current_spec => current_spec, - :dependency => dependency, - :groups => groups, } end @@ -105,7 +105,7 @@ module Bundler end else relevant_outdated_gems = if options_include_groups - by_group(outdated_gems, :filter => options[:group]) else outdated_gems end @@ -188,7 +188,7 @@ module Bundler ) end - data = { :outdated_count => gems_list.count, :outdated_gems => data } Bundler.ui.info data.to_json end @@ -233,21 +233,21 @@ module Bundler def gem_data_for(current_spec, active_spec, dependency, groups) { - :current_spec => spec_data_for(current_spec), - :active_spec => spec_data_for(active_spec), - :dependency => dependency&.to_s, - :groups => (groups || "").split(", "), } end def spec_data_for(spec) { - :name => spec.name, - :version => spec.version.to_s, - :platform => spec.platform, - :source => spec.source.to_s, - :required_ruby_version => spec.required_ruby_version.to_s, - :required_rubygems_version => spec.required_rubygems_version.to_s, } end @@ -7,18 +7,12 @@ module Bundler long_desc <<-D Install plugins either from the rubygems source provided (with --source option) or from a git source provided with --git (for remote repos) or --local_git (for local repos). If no sources are provided, it uses Gem.sources D - method_option "source", :type => :string, :default => nil, :banner => - "URL of the RubyGems source to fetch the plugin from" - method_option "version", :type => :string, :default => nil, :banner => - "The version of the plugin to fetch" - method_option "git", :type => :string, :default => nil, :banner => - "URL of the git repo to fetch from" - method_option "local_git", :type => :string, :default => nil, :banner => - "Path of the local git repo to fetch from" - method_option "branch", :type => :string, :default => nil, :banner => - "The git branch to checkout" - method_option "ref", :type => :string, :default => nil, :banner => - "The git revision to check out" def install(*plugins) Bundler::Plugin.install(plugins, options) end @@ -27,8 +21,7 @@ module Bundler long_desc <<-D Uninstall given list of plugins. To uninstall all the plugins, use -all option. D - method_option "all", :type => :boolean, :default => nil, :banner => - "Uninstall all the installed plugins. If no plugin is installed, then it does nothing." def uninstall(*plugins) Bundler::Plugin.uninstall(plugins, options) end @@ -35,7 +35,7 @@ module Bundler if full_update if conservative - Bundler.definition(:conservative => conservative) else Bundler.definition(true) end @@ -51,9 +51,9 @@ module Bundler gems.concat(deps.map(&:name)) end - Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby], - :conservative => conservative, - :bundler => update_bundler) end Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options) @@ -71,7 +71,7 @@ module Bundler if locked_gems = Bundler.definition.locked_gems previous_locked_info = locked_gems.specs.reduce({}) do |h, s| - h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier } h end end @@ -528,7 +528,7 @@ module Bundler @resolution_packages ||= begin last_resolve = converge_locked_specs remove_invalid_platforms!(current_dependencies) - packages = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, :locked_specs => @originally_locked_specs, :unlock => @unlock[:gems], :prerelease => gem_version_promoter.pre?) additional_base_requirements_for_resolve(packages, last_resolve) end end @@ -916,9 +916,9 @@ module Bundler source_requirements = if precompute_source_requirements_for_indirect_dependencies? all_requirements = source_map.all_requirements all_requirements = pin_locally_available_names(all_requirements) if @prefer_local - { :default => default_source }.merge(all_requirements) else - { :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements) end source_requirements.merge!(source_map.locked_requirements) unless @remote metadata_dependencies.each do |dep| @@ -11,17 +11,17 @@ module Bundler ALL_RUBY_VERSIONS = ((18..27).to_a + (30..33).to_a).freeze PLATFORM_MAP = { - :ruby => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS], - :mri => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS], - :rbx => [Gem::Platform::RUBY], - :truffleruby => [Gem::Platform::RUBY], - :jruby => [Gem::Platform::JAVA, [18, 19]], - :windows => [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS], # deprecated - :mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS], - :mswin64 => [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]], - :mingw => [Gem::Platform::MINGW, ALL_RUBY_VERSIONS], - :x64_mingw => [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]], }.each_with_object({}) do |(platform, spec), hash| hash[platform] = spec[0] spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] } @@ -76,11 +76,11 @@ module Bundler @gemspecs << spec - gem spec.name, :name => spec.name, :path => path, :glob => glob group(development_group) do spec.development_dependencies.each do |dep| - gem dep.name, *(dep.requirement.as_list + [:type => :development]) end end when 0 @@ -435,7 +435,7 @@ module Bundler removed_message = "The source :#{source} is disallowed because HTTP requests are insecure.\n" \ "Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not." - Bundler::SharedHelpers.major_deprecation 2, message, :removed_message => removed_message "http://rubygems.org" when String source @@ -490,7 +490,7 @@ module Bundler "Using `source` more than once without a block is a security risk, and " \ "may result in installing unexpected gems. To resolve this error, use " \ "a block to indicate which gems should come from the secondary source." - Bundler::SharedHelpers.major_deprecation 2, message, :removed_message => removed_message end end @@ -253,7 +253,7 @@ module Bundler Bundler.settings[:ssl_client_cert] raise SSLError if needs_ssl && !defined?(OpenSSL::SSL) - con = PersistentHTTP.new :name => "bundler", :proxy => :ENV if gem_proxy = Gem.configuration[:http_proxy] con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy end @@ -32,7 +32,7 @@ module Bundler if Bundler.ui.debug? Bundler.ui.trace error else - Bundler.ui.error error.message, :wrap => true end when Thor::Error Bundler.ui.error error.message @@ -40,7 +40,7 @@ module Bundler Bundler.ui.error "\nQuitting..." Bundler.ui.trace error when Gem::InvalidSpecificationException - Bundler.ui.error error.message, :wrap => true when SystemExit when *[defined?(Java::JavaLang::OutOfMemoryError) && Java::JavaLang::OutOfMemoryError].compact Bundler.ui.error "\nYour JVM has run out of memory, and Bundler cannot continue. " \ @@ -215,7 +215,7 @@ module Bundler def sh_with_status(cmd, &block) Bundler.ui.debug(cmd) SharedHelpers.chdir(base) do - outbuf = IO.popen(cmd, :err => [:child, :out], &:read) status = $? block&.call(outbuf) if status.success? [outbuf, status] @@ -84,7 +84,7 @@ module Bundler else raise ArgumentError, "2nd argument is invalid" end - label.nil? ? {} : { :label => label } end def spec_for_dependency(dependency) @@ -103,7 +103,7 @@ module Bundler end def g - @g ||= ::GraphViz.digraph(@graph_name, :concentrate => true, :normalize => true, :nodesep => 0.55) do |g| g.edge[:weight] = 2 g.edge[:fontname] = g.node[:fontname] = "Arial, Helvetica, SansSerif" g.edge[:fontsize] = 12 @@ -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 @@ -125,8 +125,8 @@ module Bundler @relations.each do |parent, children| children.each do |child| if @groups.include?(parent) - g.add_nodes(child, { :style => "filled", :fillcolor => "#B9B9D5" }.merge(@node_options[child])) - g.add_edges(parent, child, { :constraint => false }.merge(@edge_options["#{parent}_#{child}"])) else g.add_nodes(child, @node_options[child]) g.add_edges(parent, child, @edge_options["#{parent}_#{child}"]) @@ -135,7 +135,7 @@ module Bundler end if @output_format.to_s == "debug" - $stdout.puts g.output :none => String Bundler.ui.info "debugging bundle viz..." else begin @@ -29,7 +29,7 @@ module Bundler end # temporarily unfreeze - Bundler.settings.temporary(:deployment => false, :frozen => false) do # evaluate the Gemfile we have now builder = Dsl.new builder.eval_gemfile(gemfile_path) @@ -48,14 +48,14 @@ def gemfile(install = false, options = {}, &gemfile) builder.instance_eval(&gemfile) builder.check_primary_source_safety - Bundler.settings.temporary(:deployment => false, :frozen => false) do definition = builder.to_definition(nil, true) def definition.lock(*); end definition.validate_runtime! if install || definition.missing_specs? - Bundler.settings.temporary(:inline => true, :no_install => false) do - installer = Bundler::Installer.install(Bundler.root, definition, :system => true) installer.post_install_messages.each do |name, message| Bundler.ui.info "Post-install message from #{name}:\n#{message}" end @@ -136,12 +136,12 @@ module Bundler mode = Gem.win_platform? ? "wb:UTF-8" : "w" require "erb" - content = ERB.new(template, :trim_mode => "-").result(binding) - File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask) if Gem.win_platform? || options[:all_platforms] prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n" - File.write("#{binstub_path}.cmd", prefix + content, :mode => mode) end end @@ -179,12 +179,12 @@ module Bundler mode = Gem.win_platform? ? "wb:UTF-8" : "w" require "erb" - content = ERB.new(template, :trim_mode => "-").result(binding) - File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755) if Gem.win_platform? || options[:all_platforms] prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n" - File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode) end end end @@ -53,10 +53,10 @@ module Bundler def install spec.source.install( spec, - :force => force, - :ensure_builtin_gems_cached => standalone, - :build_args => Array(spec_settings), - :previous_spec => previous_spec, ) end @@ -77,7 +77,7 @@ module Bundler if Bundler.settings[:bin] && standalone installer.generate_standalone_bundler_executable_stubs(spec) elsif Bundler.settings[:bin] - installer.generate_bundler_executable_stubs(spec, :force => true) end end end @@ -56,7 +56,7 @@ module Bundler if spec.source.instance_of?(Source::Path) && spec.source.path.absolute? full_path else - SharedHelpers.relative_path_to(full_path, :from => Bundler.root.join(bundler_path)) end rescue TypeError error_message = "#{spec.name} #{spec.version} has an invalid gemspec" @@ -102,7 +102,7 @@ module Bundler installable_candidates = GemHelpers.select_best_platform_match(matching_specs, target_platform) - specification = __materialize__(installable_candidates, :fallback_to_non_installable => false) return specification unless specification.nil? if target_platform != platform @@ -101,7 +101,7 @@ module Bundler # @param [Pathname] gemfile path # @param [Proc] block that can be evaluated for (inline) Gemfile def gemfile_install(gemfile = nil, &inline) - Bundler.settings.temporary(:frozen => false, :deployment => false) do builder = DSL.new if block_given? builder.instance_eval(&inline) @@ -96,7 +96,7 @@ module Bundler # # Note: Do not override if you don't know what you are doing. def post_install(spec, disable_exts = false) - opts = { :env_shebang => false, :disable_extensions => disable_exts } installer = Bundler::Source::Path::Installer.new(spec, opts) installer.post_install end @@ -83,7 +83,7 @@ module Bundler Bundler.configure_gem_home_and_path(Plugin.root) - Bundler.settings.temporary(:deployment => false, :frozen => false) do definition = Definition.new(nil, deps, source_list, true) install_definition(definition) @@ -29,7 +29,7 @@ module Bundler Bundler.ui.info "Resolving dependencies...", true - solve_versions(:root => root, :logger => logger) end def setup_solver @@ -77,7 +77,7 @@ module Bundler end def solve_versions(root:, logger:) - solver = PubGrub::VersionSolver.new(:source => self, :root => root, :logger => logger) result = solver.solve result.map {|package, version| version.to_specs(package) }.flatten.uniq rescue PubGrub::SolveFailure => e @@ -152,7 +152,7 @@ module Bundler requirement_to_range(dependency) end - PubGrub::VersionConstraint.new(package, :range => range) end def versions_for(package, range=VersionRange.any) @@ -181,7 +181,7 @@ module Bundler extended_explanation = other_specs_matching_message(specs_matching_other_platforms, label) if specs_matching_other_platforms.any? end - Incompatibility.new([unsatisfied_term], :cause => cause, :custom_explanation => custom_explanation, :extended_explanation => extended_explanation) end def debug? @@ -220,9 +220,9 @@ module Bundler sorted_versions[high] end - range = PubGrub::VersionRange.new(:min => low, :max => high, :include_min => true) - self_constraint = PubGrub::VersionConstraint.new(package, :range => range) dep_term = PubGrub::Term.new(dep_constraint, false) self_term = PubGrub::Term.new(self_constraint, true) @@ -231,7 +231,7 @@ module Bundler "current #{dep_package} version is #{dep_constraint.constraint_string}" end - PubGrub::Incompatibility.new([self_term, dep_term], :cause => :dependency, :custom_explanation => custom_explanation) end end @@ -266,11 +266,11 @@ module Bundler platform_specs.flatten! ruby_specs = select_best_platform_match(specs, Gem::Platform::RUBY) - groups << Resolver::Candidate.new(version, :specs => ruby_specs) if ruby_specs.any? next groups if platform_specs == ruby_specs || package.force_ruby_platform? - groups << Resolver::Candidate.new(version, :specs => platform_specs) groups end @@ -408,19 +408,19 @@ module Bundler when "~>" name = "~> #{ver}" bump = Resolver::Candidate.new(version.bump.to_s + ".A") - PubGrub::VersionRange.new(:name => name, :min => ver, :max => bump, :include_min => true) when ">" - PubGrub::VersionRange.new(:min => platform_ver) when ">=" - PubGrub::VersionRange.new(:min => ver, :include_min => true) when "<" - PubGrub::VersionRange.new(:max => ver) when "<=" - PubGrub::VersionRange.new(:max => platform_ver, :include_max => true) when "=" - PubGrub::VersionRange.new(:min => ver, :max => platform_ver, :include_min => true, :include_max => true) when "!=" - PubGrub::VersionRange.new(:min => ver, :max => platform_ver, :include_min => true, :include_max => true).invert else raise "bad version specifier: #{op}" end @@ -24,7 +24,7 @@ module Bundler name = dep.name - @packages[name] = Package.new(name, dep_platforms, **options.merge(:dependency => dep)) dep end.compact @@ -8,7 +8,7 @@ module Bundler def initialize(terms, cause:, custom_explanation: nil, extended_explanation: nil) @extended_explanation = extended_explanation - super(terms, :cause => cause, :custom_explanation => custom_explanation) end end end @@ -376,7 +376,7 @@ module Gem remove_method :glob_files_in_dir def glob_files_in_dir(glob, base_path) - Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) } end end end @@ -20,7 +20,7 @@ module Bundler strict_rm_rf spec.extension_dir SharedHelpers.filesystem_access(gem_dir, :create) do - FileUtils.mkdir_p gem_dir, :mode => 0o755 end extract_files @@ -32,7 +32,7 @@ module Bundler setup_manpath - lock(:preserve_unknown_sections => true) self end @@ -335,11 +335,11 @@ module Bundler def configs @configs ||= { - :temporary => @temporary, - :local => @local_config, - :env => @env_config, - :global => @global_config, - :default => DEFAULT_CONFIG, } end @@ -203,7 +203,7 @@ module Bundler SharedHelpers.filesystem_access(path, :read) do File.open(path, "rb") do |f| digest = SharedHelpers.digest(digest).new - buf = String.new(:capacity => 16_384, :encoding => Encoding::BINARY) digest << buf while f.read(16_384, buf) digest.hexdigest end @@ -20,7 +20,7 @@ module Bundler # Stringify options that could be set as symbols %w[ref branch tag revision].each {|k| options[k] = options[k].to_s if options[k] } - @uri = URINormalizer.normalize_suffix(options["uri"] || "", :trailing_slash => false) @safe_uri = URICredentialsFilter.credential_filtered_uri(@uri) @branch = options["branch"] @ref = options["ref"] || options["branch"] || options["tag"] @@ -198,7 +198,7 @@ module Bundler @copied = true end - generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] } generate_bin(spec, generate_bin_options) requires_checkout? ? spec.post_install_message : nil @@ -80,13 +80,13 @@ module Bundler def current_branch @current_branch ||= with_path do - git_local("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip end end def contains?(commit) allowed_with_path do - result, status = git_null("branch", "--contains", commit, :dir => path) status.success? && result =~ /^\* (.*)$/ end end @@ -132,18 +132,18 @@ module Bundler ref = @commit_ref || (locked_to_full_sha? && @revision) if ref - git "config", "uploadpack.allowAnySHA1InWant", "true", :dir => path.to_s if @commit_ref.nil? && needs_allow_any_sha1_in_want? - git "fetch", "--force", "--quiet", *extra_fetch_args(ref), :dir => destination end - git "reset", "--hard", @revision, :dir => destination if submodules - git_retry "submodule", "update", "--init", "--recursive", :dir => destination elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0") inner_command = "git -C $toplevel submodule deinit --force $sm_path" - git_retry "submodule", "foreach", "--quiet", inner_command, :dir => destination end end @@ -266,32 +266,32 @@ module Bundler def git_null(*command, dir: nil) check_allowed(command) - capture(command, dir, :ignore_err => true) end def git_retry(*command, dir: nil) command_with_no_credentials = check_allowed(command) Bundler::Retry.new("`#{command_with_no_credentials}` at #{dir || SharedHelpers.pwd}").attempts do - git(*command, :dir => dir) end end def git(*command, dir: nil) - run_command(*command, :dir => dir) do |unredacted_command| check_allowed(unredacted_command) end end def git_local(*command, dir: nil) - run_command(*command, :dir => dir) do |unredacted_command| redact_and_check_presence(unredacted_command) end end def has_revision_cached? return unless @revision && path.exist? - git("cat-file", "-e", @revision, :dir => path) true rescue GitError false @@ -314,7 +314,7 @@ module Bundler end def verify(reference) - git("rev-parse", "--verify", reference, :dir => path).strip end # Adds credentials to the URI @@ -398,7 +398,7 @@ module Bundler if Bundler.feature_flag.bundler_3_mode? || supports_minus_c? ["git", "-C", dir.to_s, *cmd] else - ["git", *cmd, { :chdir => dir.to_s }] end end @@ -86,7 +86,7 @@ module Bundler using_message = "Using #{version_message(spec, options[:previous_spec])} from #{self}" using_message += " and installing its executables" unless spec.executables.empty? print_using_message using_message - generate_bin(spec, :disable_extensions => true) nil # no post-install message end @@ -237,10 +237,10 @@ module Bundler installer = Path::Installer.new( spec, - :env_shebang => false, - :disable_extensions => options[:disable_extensions], - :build_args => options[:build_args], - :bundler_extension_cache_path => extension_cache_path(spec) ) installer.post_install rescue Gem::InvalidSpecificationException => e @@ -171,14 +171,14 @@ 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_extension_cache_path => extension_cache_path(spec) ) if spec.remote @@ -13,5 +13,5 @@ require_relative "deployment" include Rake::DSL if defined? Rake::DSL namespace :vlad do - Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, :roles => :app) end |