diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index ae9b787a007000..60178c2a59c464 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -73,7 +73,7 @@ def create_additions_proc(opts) if opts[:create_additions] != false if class_name = object[JSON.create_id] klass = JSON.deep_const_get(class_name) - if (klass.respond_to?(:json_creatable?) && klass.json_creatable?) || klass.respond_to?(:json_create) + if klass.respond_to?(:json_creatable?) ? klass.json_creatable? : klass.respond_to?(:json_create) create_additions_warning if create_additions.nil? object = klass.json_create(object) end @@ -97,7 +97,7 @@ def create_additions_warning class << self def deprecation_warning(message, uplevel = 3) # :nodoc: - gem_root = File.expand_path("../../../", __FILE__) + "/" + gem_root = File.expand_path("..", __dir__) + "/" caller_locations(uplevel, 10).each do |frame| if frame.path.nil? || frame.path.start_with?(gem_root) || frame.path.end_with?("/truffle/cext_ruby.rb", ".c") uplevel += 1 diff --git a/ext/json/lib/json/generic_object.rb b/ext/json/lib/json/generic_object.rb index ec5aa9dcb2977e..5c8ace354b1f45 100644 --- a/ext/json/lib/json/generic_object.rb +++ b/ext/json/lib/json/generic_object.rb @@ -52,14 +52,6 @@ def to_hash table end - def [](name) - __send__(name) - end unless method_defined?(:[]) - - def []=(name, value) - __send__("#{name}=", value) - end unless method_defined?(:[]=) - def |(other) self.class[other.to_hash.merge(to_hash)] end diff --git a/lib/bundler.rb b/lib/bundler.rb index f5b2abcd101891..e76dfde122d7e8 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -218,8 +218,7 @@ def load end def environment - SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", print_caller_location: true - load + SharedHelpers.feature_removed! "Bundler.environment has been removed in favor of Bundler.load" end # Returns an instance of Bundler::Definition for given Gemfile and lockfile @@ -364,16 +363,11 @@ def original_env ORIGINAL_ENV.clone end - # @deprecated Use `unbundled_env` instead def clean_env - message = - "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ - "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`" removed_message = "`Bundler.clean_env` has been removed in favor of `Bundler.unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`" - Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true) - unbundled_env + Bundler::SharedHelpers.feature_removed!(removed_message) end # @return [Hash] Environment with all bundler-related variables removed @@ -391,16 +385,11 @@ def with_original_env with_env(original_env) { yield } end - # @deprecated Use `with_unbundled_env` instead def with_clean_env - message = - "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ - "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`" removed_message = "`Bundler.with_clean_env` has been removed in favor of `Bundler.with_unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`" - Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true) - with_env(unbundled_env) { yield } + Bundler::SharedHelpers.feature_removed!(removed_message) end # Run block with all bundler-related variables removed @@ -413,16 +402,11 @@ def original_system(*args) with_original_env { Kernel.system(*args) } end - # @deprecated Use `unbundled_system` instead def clean_system(*args) - message = - "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \ - "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`" removed_message = "`Bundler.clean_system` has been removed in favor of `Bundler.unbundled_system`. " \ "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`" - Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true) - with_env(unbundled_env) { Kernel.system(*args) } + Bundler::SharedHelpers.feature_removed!(removed_message) end # Run subcommand in an environment with all bundler related variables removed @@ -435,16 +419,11 @@ def original_exec(*args) with_original_env { Kernel.exec(*args) } end - # @deprecated Use `unbundled_exec` instead def clean_exec(*args) - message = - "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \ - "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`" removed_message = "`Bundler.clean_exec` has been removed in favor of `Bundler.unbundled_exec`. " \ "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`" - Bundler::SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true) - with_env(unbundled_env) { Kernel.exec(*args) } + Bundler::SharedHelpers.feature_removed!(removed_message) end # Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb index 705840143fa909..6d2437d895a9bb 100644 --- a/lib/bundler/capistrano.rb +++ b/lib/bundler/capistrano.rb @@ -1,22 +1,4 @@ # frozen_string_literal: true require_relative "shared_helpers" -Bundler::SharedHelpers.major_deprecation 2, - "The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler" - -# Capistrano task for Bundler. -# -# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and -# Bundler will be activated after each new deployment. -require_relative "deployment" -require "capistrano/version" - -if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0") - raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler" -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 +Bundler::SharedHelpers.feature_removed! "The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler" diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 0d993e570220e7..e59265e8b2ed13 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -173,7 +173,7 @@ def init 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?}" + method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)" def check remembered_flag_deprecation("path") @@ -211,9 +211,9 @@ def remove(*gems) 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 "clean", type: :boolean, banner: "Run bundle clean automatically after install (removed)" + method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments (removed)" + method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install (removed)" 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" @@ -221,16 +221,16 @@ def remove(*gems) 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 "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed" - 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 "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)." + method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)." 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 "shebang", type: :string, banner: "Specify a different shebang executable name than the default, usually 'ruby' (removed)" 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 "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 (removed)" 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 "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform" - 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." + method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group (removed)." + method_option "with", type: :array, banner: "Include gems that are part of the specified named group (removed)." def install %w[clean deployment frozen no-prune path shebang without with].each do |option| remembered_flag_deprecation(option) @@ -323,7 +323,7 @@ def info(gem_name) 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 "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory, `bin` by default (removed)" 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" @@ -396,15 +396,15 @@ def fund 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", type: :boolean, default: Bundler.settings[:cache_all], banner: "Include all sources (including path and git) (removed)." 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 "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)." + method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)." 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" + method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install (removed)" 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 @@ -420,16 +420,12 @@ def cache end if flag_passed?("--path") - message = - "The `--path` flag is deprecated because its semantics are 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, " \ - "and stop using this flag" removed_message = "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 + "and `bundle config path` to configure the path where your gems are installed, " \ + "and stop using this flag" + raise InvalidOption, removed_message end require_relative "cli/cache" @@ -749,17 +745,12 @@ def remembered_flag_deprecation(name, negative: false, option_name: nil) end def print_remembered_flag_deprecation(flag_name, option_name, option_value) - message = - "The `#{flag_name}` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no longer " \ - "do in future versions. Instead please use `bundle config set #{option_name} " \ - "#{option_value}`, and stop using this flag" removed_message = "The `#{flag_name}` flag has been removed because it relied on being " \ - "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 + "remembered across bundler invocations, which bundler no longer does. " \ + "Instead please use `bundle config set #{option_name} #{option_value}`, " \ + "and stop using this flag" + raise InvalidOption, removed_message end def flag_passed?(name) diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb index 92d7a1c519c219..59605df847db94 100644 --- a/lib/bundler/cli/cache.rb +++ b/lib/bundler/cli/cache.rb @@ -10,16 +10,12 @@ def initialize(options) def run Bundler.ui.level = "warn" if options[:quiet] - Bundler.settings.set_command_option_if_given :path, options[:path] Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"] - setup_cache_all install - custom_path = Bundler.settings[:path] if options[:path] - Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do - Bundler.load.cache(custom_path) + Bundler.load.cache end end @@ -32,11 +28,5 @@ def install options["no-cache"] = true Bundler::CLI::Install.new(options).run end - - def setup_cache_all - all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil) - - Bundler.settings.set_command_option_if_given :cache_all, all - end end end diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 5eeba0c8d84508..a676e2d6f1f573 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -20,36 +20,18 @@ def run Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform? - # Disable color in deployment mode - Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment] - if target_rbconfig_path = options[:"target-rbconfig"] Bundler.rubygems.set_target_rbconfig(target_rbconfig_path) end - check_for_options_conflicts - check_trust_policy - if options[:deployment] || options[:frozen] || Bundler.frozen_bundle? - unless Bundler.default_lockfile.exist? - flag = "--deployment flag" if options[:deployment] - flag ||= "--frozen flag" if options[:frozen] - flag ||= "deployment setting" if Bundler.settings[:deployment] - flag ||= "frozen setting" if Bundler.settings[:frozen] - raise ProductionError, "The #{flag} requires a lockfile. Please make " \ - "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \ - "before deploying." - end - - Bundler.settings.set_command_option :deployment, true if options[:deployment] - Bundler.settings.set_command_option :frozen, true if options[:frozen] - end - - # When install is called with --no-deployment, disable deployment mode - if options[:deployment] == false - Bundler.settings.set_command_option :frozen, nil - options[:system] = true + if Bundler.frozen_bundle? && !Bundler.default_lockfile.exist? + flag = "deployment setting" if Bundler.settings[:deployment] + flag = "frozen setting" if Bundler.settings[:frozen] + raise ProductionError, "The #{flag} requires a lockfile. Please make " \ + "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \ + "before deploying." end normalize_settings @@ -118,22 +100,6 @@ def gems_installed_for(definition) "#{count} #{count == 1 ? "gem" : "gems"} now installed" end - def check_for_group_conflicts_in_cli_options - conflicting_groups = Array(options[:without]) & Array(options[:with]) - return if conflicting_groups.empty? - raise InvalidOption, "You can't list a group in both with and without." \ - " The offending groups are: #{conflicting_groups.join(", ")}." - end - - def check_for_options_conflicts - if (options[:path] || options[:deployment]) && options[:system] - error_message = String.new - error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path] - error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment] - raise InvalidOption.new(error_message) - end - end - def check_trust_policy trust_policy = options["trust-policy"] unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy) @@ -143,28 +109,11 @@ def check_trust_policy Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy end - def normalize_groups - check_for_group_conflicts_in_cli_options - - # need to nil them out first to get around validation for backwards compatibility - Bundler.settings.set_command_option :without, nil - Bundler.settings.set_command_option :with, nil - Bundler.settings.set_command_option :without, options[:without] - Bundler.settings.set_command_option :with, options[:with] - end - def normalize_settings - Bundler.settings.set_command_option :path, nil if options[:system] - Bundler.settings.set_command_option_if_given :path, options[:path] - if options["standalone"] && Bundler.settings[:path].nil? && !options["local"] Bundler.settings.set_command_option :path, "bundle" end - bin_option = options["binstubs"] - 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"] Bundler.settings.set_command_option_if_given :jobs, options["jobs"] @@ -175,8 +124,6 @@ def normalize_settings Bundler.settings.set_command_option_if_given :clean, options["clean"] - normalize_groups if options[:without] || options[:with] - options[:force] = options[:redownload] if options[:redownload] end diff --git a/lib/bundler/deployment.rb b/lib/bundler/deployment.rb index b432ae6ae1a4d9..3344449e82a848 100644 --- a/lib/bundler/deployment.rb +++ b/lib/bundler/deployment.rb @@ -1,69 +1,6 @@ # frozen_string_literal: true require_relative "shared_helpers" -Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \ +Bundler::SharedHelpers.feature_removed! "Bundler no longer integrates with " \ "Capistrano, but Capistrano provides its own integration with " \ "Bundler via the capistrano-bundler gem. Use it instead." - -module Bundler - class Deployment - def self.define_task(context, task_method = :task, opts = {}) - if defined?(Capistrano) && context.is_a?(Capistrano::Configuration) - context_name = "capistrano" - role_default = "{:except => {:no_release => true}}" - error_type = ::Capistrano::CommandError - else - context_name = "vlad" - role_default = "[:app]" - error_type = ::Rake::CommandFailedError - end - - roles = context.fetch(:bundle_roles, false) - opts[:roles] = roles if roles - - context.send :namespace, :bundle do - send :desc, <<-DESC - Install the current Bundler environment. By default, gems will be \ - installed to the shared/bundle path. Gems in the development and \ - test group will not be installed. The install command is executed \ - with the --deployment and --quiet flags. If the bundle cmd cannot \ - be found then you can override the bundle_cmd variable to specify \ - which one it should use. The base path to the app is fetched from \ - the :latest_release variable. Set it for custom deploy layouts. - - You can override any of these defaults by setting the variables shown below. - - N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \ - in your deploy.rb file. - - set :bundle_gemfile, "Gemfile" - set :bundle_dir, File.join(fetch(:shared_path), 'bundle') - set :bundle_flags, "--deployment --quiet" - set :bundle_without, [:development, :test] - set :bundle_with, [:mysql] - set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle" - set :bundle_roles, #{role_default} # e.g. [:app, :batch] - DESC - send task_method, :install, opts do - bundle_cmd = context.fetch(:bundle_cmd, "bundle") - bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet") - bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), "bundle")) - bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile") - bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact - bundle_with = [*context.fetch(:bundle_with, [])].compact - app_path = context.fetch(:latest_release) - if app_path.to_s.empty? - raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.") - end - args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"] - args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty? - args << bundle_flags.to_s - args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty? - args << "--with #{bundle_with.join(" ")}" unless bundle_with.empty? - - run "cd #{app_path} && #{bundle_cmd} install #{args.join(" ")}" - end - end - end - end -end diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb index c06684657d598b..95c6deea26bf4e 100644 --- a/lib/bundler/endpoint_specification.rb +++ b/lib/bundler/endpoint_specification.rb @@ -60,28 +60,6 @@ def load_paths end end - # needed for binstubs - def executables - if @remote_specification - @remote_specification.executables - elsif _local_specification - _local_specification.executables - else - super - end - end - - # needed for bundle clean - def bindir - if @remote_specification - @remote_specification.bindir - elsif _local_specification - _local_specification.bindir - else - super - end - end - # needed for post_install_messages during install def post_install_message if @remote_specification diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index 2cf58eefd60f27..ec61dd521184c6 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -29,7 +29,6 @@ def self.settings_method(name, key, &default) settings_flag(:allow_offline_install) { bundler_4_mode? } settings_flag(:cache_all) { bundler_4_mode? } - settings_flag(:forget_cli_options) { bundler_4_mode? } settings_flag(:global_gem_cache) { bundler_5_mode? } settings_flag(:lockfile_checksums) { bundler_4_mode? } settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") } diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index 1da91857bd57b5..5c4fa7825325c4 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -16,7 +16,6 @@ def initialize(spec, installer, standalone = false, worker = 0, force = false, l def install_from_spec post_install_message = install Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" - generate_executable_stubs [true, post_install_message] rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError, Bundler::InsecureInstallPathError raise @@ -71,15 +70,5 @@ def previous_spec def out_of_space_message "#{install_error_message}\nYour disk is out of space. Free some space to be able to install your bundle." end - - def generate_executable_stubs - return if Bundler.feature_flag.forget_cli_options? - return if Bundler.settings[:inline] - 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 end diff --git a/lib/bundler/man/bundle-add.1 b/lib/bundler/man/bundle-add.1 index 74422cbd313ddf..4474969db608f1 100644 --- a/lib/bundler/man/bundle-add.1 +++ b/lib/bundler/man/bundle-add.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ADD" "1" "August 2025" "" +.TH "BUNDLE\-ADD" "1" "September 2025" "" .SH "NAME" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-binstubs.1 b/lib/bundler/man/bundle-binstubs.1 index be9c6d0d097390..b8c153696bba92 100644 --- a/lib/bundler/man/bundle-binstubs.1 +++ b/lib/bundler/man/bundle-binstubs.1 @@ -1,24 +1,21 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-BINSTUBS" "1" "August 2025" "" +.TH "BUNDLE\-BINSTUBS" "1" "September 2025" "" .SH "NAME" \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems .SH "SYNOPSIS" -\fBbundle binstubs\fR \fIGEM_NAME\fR [\-\-force] [\-\-path PATH] [\-\-standalone] [\-\-all\-platforms] +\fBbundle binstubs\fR \fIGEM_NAME\fR [\-\-force] [\-\-standalone] [\-\-all\-platforms] .SH "DESCRIPTION" Binstubs are scripts that wrap around executables\. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it into \fBbin/\fR\. Binstubs are a shortcut\-or alternative\- to always using \fBbundle exec\fR\. This gives you a file that can be run directly, and one that will always run the correct gem version used by the application\. .P For example, if you run \fBbundle binstubs rspec\-core\fR, Bundler will create the file \fBbin/rspec\fR\. That file will contain enough code to load Bundler, tell it to load the bundled gems, and then run rspec\. .P -This command generates binstubs for executables in \fBGEM_NAME\fR\. Binstubs are put into \fBbin\fR, or the \fB\-\-path\fR directory if one has been set\. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems\. +This command generates binstubs for executables in \fBGEM_NAME\fR\. Binstubs are put into \fBbin\fR, or the directory specified by \fBbin\fR setting if it has been configured\. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems\. .SH "OPTIONS" .TP \fB\-\-force\fR Overwrite existing binstubs if they exist\. .TP -\fB\-\-path[=PATH]\fR -The location to install the specified binstubs to\. This defaults to \fBbin\fR\. -.TP \fB\-\-standalone\fR Makes binstubs that can work without depending on Rubygems or Bundler at runtime\. .TP diff --git a/lib/bundler/man/bundle-binstubs.1.ronn b/lib/bundler/man/bundle-binstubs.1.ronn index ec2cfd80db9053..cbe5983f4dfbcb 100644 --- a/lib/bundler/man/bundle-binstubs.1.ronn +++ b/lib/bundler/man/bundle-binstubs.1.ronn @@ -3,7 +3,7 @@ bundle-binstubs(1) -- Install the binstubs of the listed gems ## SYNOPSIS -`bundle binstubs` [--force] [--path PATH] [--standalone] [--all-platforms] +`bundle binstubs` [--force] [--standalone] [--all-platforms] ## DESCRIPTION @@ -19,17 +19,15 @@ the file `bin/rspec`. That file will contain enough code to load Bundler, tell it to load the bundled gems, and then run rspec. This command generates binstubs for executables in `GEM_NAME`. -Binstubs are put into `bin`, or the `--path` directory if one has been set. -Calling binstubs with [GEM [GEM]] will create binstubs for all given gems. +Binstubs are put into `bin`, or the directory specified by `bin` setting if it +has been configured. Calling binstubs with [GEM [GEM]] will create binstubs for +all given gems. ## OPTIONS * `--force`: Overwrite existing binstubs if they exist. -* `--path[=PATH]`: - The location to install the specified binstubs to. This defaults to `bin`. - * `--standalone`: Makes binstubs that can work without depending on Rubygems or Bundler at runtime. diff --git a/lib/bundler/man/bundle-cache.1 b/lib/bundler/man/bundle-cache.1 index 1d16b164fa2806..c1dafbf07052d3 100644 --- a/lib/bundler/man/bundle-cache.1 +++ b/lib/bundler/man/bundle-cache.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CACHE" "1" "August 2025" "" +.TH "BUNDLE\-CACHE" "1" "September 2025" "" .SH "NAME" \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application .SH "SYNOPSIS" @@ -11,9 +11,6 @@ alias: \fBpackage\fR, \fBpack\fR Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\. .SH "OPTIONS" .TP -\fB\-\-all\fR -Include all sources (including path and git)\. -.TP \fB\-\-all\-platforms\fR Include gems for all platforms present in the lockfile, not only the current one\. .TP @@ -26,19 +23,10 @@ Use the specified gemfile instead of Gemfile\. \fB\-\-no\-install\fR Don't install the gems, only update the cache\. .TP -\fB\-\-no\-prune\fR -Don't remove stale gems from the cache\. -.TP -\fB\-\-path=PATH\fR -Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME)\. -.TP \fB\-\-quiet\fR Only output warnings and errors\. -.TP -\fB\-\-frozen\fR -Do not allow the Gemfile\.lock to be updated after this bundle cache operation's install\. .SH "GIT AND PATH GEMS" -The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\. +The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This can be disabled setting \fBcache_all\fR to false\. .SH "SUPPORT FOR MULTIPLE PLATFORMS" When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\. .SH "REMOTE FETCHING" diff --git a/lib/bundler/man/bundle-cache.1.ronn b/lib/bundler/man/bundle-cache.1.ronn index ffcc07c7b122a7..51846c96b42a25 100644 --- a/lib/bundler/man/bundle-cache.1.ronn +++ b/lib/bundler/man/bundle-cache.1.ronn @@ -15,9 +15,6 @@ use the gems in the cache in preference to the ones on `rubygems.org`. ## OPTIONS -* `--all`: - Include all sources (including path and git). - * `--all-platforms`: Include gems for all platforms present in the lockfile, not only the current one. @@ -30,23 +27,13 @@ use the gems in the cache in preference to the ones on `rubygems.org`. * `--no-install`: Don't install the gems, only update the cache. -* `--no-prune`: - Don't remove stale gems from the cache. - -* `--path=PATH`: - Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). - * `--quiet`: Only output warnings and errors. -* `--frozen`: - Do not allow the Gemfile.lock to be updated after this bundle cache operation's install. - ## GIT AND PATH GEMS The `bundle cache` command can also package `:git` and `:path` dependencies -besides .gem files. This needs to be explicitly enabled via the `--all` option. -Once used, the `--all` option will be remembered. +besides .gem files. This can be disabled setting `cache_all` to false. ## SUPPORT FOR MULTIPLE PLATFORMS diff --git a/lib/bundler/man/bundle-check.1 b/lib/bundler/man/bundle-check.1 index 4f0d51bb71472e..f83af1eb557765 100644 --- a/lib/bundler/man/bundle-check.1 +++ b/lib/bundler/man/bundle-check.1 @@ -1,10 +1,10 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CHECK" "1" "August 2025" "" +.TH "BUNDLE\-CHECK" "1" "September 2025" "" .SH "NAME" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems .SH "SYNOPSIS" -\fBbundle check\fR [\-\-dry\-run] [\-\-gemfile=FILE] [\-\-path=PATH] +\fBbundle check\fR [\-\-dry\-run] [\-\-gemfile=FILE] .SH "DESCRIPTION" \fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\. .P @@ -18,7 +18,4 @@ Locks the [\fBGemfile(5)\fR][Gemfile(5)] before running the command\. .TP \fB\-\-gemfile=GEMFILE\fR Use the specified gemfile instead of the [\fBGemfile(5)\fR][Gemfile(5)]\. -.TP -\fB\-\-path=PATH\fR -Specify a different path than the system default (\fB$BUNDLE_PATH\fR or \fB$GEM_HOME\fR)\. Bundler will remember this value for future installs on this machine\. diff --git a/lib/bundler/man/bundle-check.1.ronn b/lib/bundler/man/bundle-check.1.ronn index 23bb6f3eb88cd7..92589159c91e6b 100644 --- a/lib/bundler/man/bundle-check.1.ronn +++ b/lib/bundler/man/bundle-check.1.ronn @@ -5,7 +5,6 @@ bundle-check(1) -- Verifies if dependencies are satisfied by installed gems `bundle check` [--dry-run] [--gemfile=FILE] - [--path=PATH] ## DESCRIPTION @@ -25,7 +24,3 @@ installed on the local machine, if they satisfy the requirements. * `--gemfile=GEMFILE`: Use the specified gemfile instead of the [`Gemfile(5)`][Gemfile(5)]. - -* `--path=PATH`: - Specify a different path than the system default (`$BUNDLE_PATH` or `$GEM_HOME`). - Bundler will remember this value for future installs on this machine. diff --git a/lib/bundler/man/bundle-clean.1 b/lib/bundler/man/bundle-clean.1 index df66523829d35e..c4d148c5df8358 100644 --- a/lib/bundler/man/bundle-clean.1 +++ b/lib/bundler/man/bundle-clean.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CLEAN" "1" "August 2025" "" +.TH "BUNDLE\-CLEAN" "1" "September 2025" "" .SH "NAME" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-config.1 b/lib/bundler/man/bundle-config.1 index 5157e514531238..e3ce81155ca2e1 100644 --- a/lib/bundler/man/bundle-config.1 +++ b/lib/bundler/man/bundle-config.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CONFIG" "1" "August 2025" "" +.TH "BUNDLE\-CONFIG" "1" "September 2025" "" .SH "NAME" \fBbundle\-config\fR \- Set bundler configuration options .SH "SYNOPSIS" @@ -77,7 +77,7 @@ Allow Bundler to use cached data when installing without network access\. Automatically run \fBbundle install\fR when gems are missing\. .TP \fBbin\fR (\fBBUNDLE_BIN\fR) -Install executables from gems in the bundle to the specified directory\. Defaults to \fBfalse\fR\. +If configured, \fBbundle binstubs\fR will install executables from gems in the bundle to the specified directory\. Otherwise it will create them in a \fBbin\fR directory relative to the Gemfile directory\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, \fBbundle binstubs\fR will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\. .TP \fBcache_all\fR (\fBBUNDLE_CACHE_ALL\fR) Cache all gems, including path and git gems\. This needs to be explicitly before bundler 4, but will be the default on bundler 4\. @@ -158,10 +158,10 @@ Whether \fBbundle package\fR should skip installing gems\. Whether Bundler should leave outdated gems unpruned when caching\. .TP \fBonly\fR (\fBBUNDLE_ONLY\fR) -A space\-separated list of groups to install only gems of the specified groups\. +A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, because they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\. .TP \fBpath\fR (\fBBUNDLE_PATH\fR) -The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. Defaults to \fB\.bundle\fR relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\. +The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\. That means that before Bundler 4, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 4\. .TP \fBpath\.system\fR (\fBBUNDLE_PATH__SYSTEM\fR) Whether Bundler will install gems into the default system path (\fBGem\.dir\fR)\. @@ -222,30 +222,6 @@ A space\-separated or \fB:\fR\-separated list of groups whose gems bundler shoul .TP \fBwithout\fR (\fBBUNDLE_WITHOUT\fR) A space\-separated or \fB:\fR\-separated list of groups whose gems bundler should not install\. -.SH "REMEMBERING OPTIONS" -Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are remembered between commands and saved to your local application's configuration (normally, \fB\./\.bundle/config\fR)\. -.P -However, this will be changed in bundler 4, so it's better not to rely on this behavior\. If these options must be remembered, it's better to set them using \fBbundle config\fR (e\.g\., \fBbundle config set \-\-local path foo\fR)\. -.P -The flags that can be configured are: -.TP -\fB\-\-bin\fR -Creates a directory (defaults to \fB~/bin\fR) and place any executables from the gem there\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\. -.TP -\fB\-\-deployment\fR -In deployment mode, Bundler will 'roll\-out' the bundle for \fBproduction\fR use\. Please check carefully if you want to have this option enabled in \fBdevelopment\fR or \fBtest\fR environments\. -.TP -\fB\-\-only\fR -A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, cause they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\. -.TP -\fB\-\-path\fR -The location to install the specified gems to\. This defaults to Rubygems' setting\. Bundler shares this location with Rubygems, \fBgem install \|\.\|\.\|\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \|\.\|\.\|\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\. -.TP -\fB\-\-without\fR -A space\-separated or \fB:\fR\-separated list of groups referencing gems to skip during installation\. -.TP -\fB\-\-with\fR -A space\-separated or \fB:\fR\-separated list of \fBoptional\fR groups referencing gems to include during installation\. .SH "BUILD OPTIONS" You can use \fBbundle config\fR to give Bundler the flags to pass to the gem installer every time bundler tries to install a particular gem\. .P diff --git a/lib/bundler/man/bundle-config.1.ronn b/lib/bundler/man/bundle-config.1.ronn index 2b2e39f03eb7f0..b2f0f462f83c8f 100644 --- a/lib/bundler/man/bundle-config.1.ronn +++ b/lib/bundler/man/bundle-config.1.ronn @@ -111,8 +111,14 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html). * `auto_install` (`BUNDLE_AUTO_INSTALL`): Automatically run `bundle install` when gems are missing. * `bin` (`BUNDLE_BIN`): - Install executables from gems in the bundle to the specified directory. - Defaults to `false`. + If configured, `bundle binstubs` will install executables from gems in the + bundle to the specified directory. Otherwise it will create them in a `bin` + directory relative to the Gemfile directory. These executables run in + Bundler's context. If used, you might add this directory to your + environment's `PATH` variable. For instance, if the `rails` gem comes with a + `rails` executable, `bundle binstubs` will create a `bin/rails` executable + that ensures that all referred dependencies will be resolved using the + bundled gems. * `cache_all` (`BUNDLE_CACHE_ALL`): Cache all gems, including path and git gems. This needs to be explicitly before bundler 4, but will be the default on bundler 4. @@ -193,12 +199,19 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html). Whether Bundler should leave outdated gems unpruned when caching. * `only` (`BUNDLE_ONLY`): A space-separated list of groups to install only gems of the specified groups. + Please check carefully if you want to install also gems without a group, because + they get put inside `default` group. For example `only test:default` will install + all gems specified in test group and without one. * `path` (`BUNDLE_PATH`): The location on disk where all gems in your bundle will be located regardless of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location - will be installed by `bundle install`. Defaults to `.bundle` relative to - repository root in Bundler 4, and to the default system path (`Gem.dir`) - before Bundler 4. + will be installed by `bundle install`. When not set, Bundler install by + default to a `.bundle` directory relative to repository root in Bundler 4, + and to the default system path (`Gem.dir`) before Bundler 4. That means that + before Bundler 4, Bundler shares this location with Rubygems, and `gem + install ...` will have gems installed in the same location and therefore, + gems installed without `path` set will show up by calling `gem list`. This + will not be the case in Bundler 4. * `path.system` (`BUNDLE_PATH__SYSTEM`): Whether Bundler will install gems into the default system path (`Gem.dir`). * `plugins` (`BUNDLE_PLUGINS`): @@ -253,52 +266,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html). * `without` (`BUNDLE_WITHOUT`): A space-separated or `:`-separated list of groups whose gems bundler should not install. -## REMEMBERING OPTIONS - -Flags passed to `bundle install` or the Bundler runtime, such as `--path foo` or -`--without production`, are remembered between commands and saved to your local -application's configuration (normally, `./.bundle/config`). - -However, this will be changed in bundler 4, so it's better not to rely on this -behavior. If these options must be remembered, it's better to set them using -`bundle config` (e.g., `bundle config set --local path foo`). - -The flags that can be configured are: - -* `--bin`: - Creates a directory (defaults to `~/bin`) and place any executables from the - gem there. These executables run in Bundler's context. If used, you might add - this directory to your environment's `PATH` variable. For instance, if the - `rails` gem comes with a `rails` executable, this flag will create a - `bin/rails` executable that ensures that all referred dependencies will be - resolved using the bundled gems. - -* `--deployment`: - In deployment mode, Bundler will 'roll-out' the bundle for - `production` use. Please check carefully if you want to have this option - enabled in `development` or `test` environments. - -* `--only`: - A space-separated list of groups to install only gems of the specified groups. - Please check carefully if you want to install also gems without a group, cause - they get put inside `default` group. For example `only test:default` will install - all gems specified in test group and without one. - -* `--path`: - The location to install the specified gems to. This defaults to Rubygems' - setting. Bundler shares this location with Rubygems, `gem install ...` will - have gem installed there, too. Therefore, gems installed without a - `--path ...` setting will show up by calling `gem list`. Accordingly, gems - installed to other locations will not get listed. - -* `--without`: - A space-separated or `:`-separated list of groups referencing gems to skip during - installation. - -* `--with`: - A space-separated or `:`-separated list of **optional** groups referencing gems to - include during installation. - ## BUILD OPTIONS You can use `bundle config` to give Bundler the flags to pass to the gem diff --git a/lib/bundler/man/bundle-console.1 b/lib/bundler/man/bundle-console.1 index 18c765372b4230..5ab15668be7b9f 100644 --- a/lib/bundler/man/bundle-console.1 +++ b/lib/bundler/man/bundle-console.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-CONSOLE" "1" "August 2025" "" +.TH "BUNDLE\-CONSOLE" "1" "September 2025" "" .SH "NAME" \fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-doctor.1 b/lib/bundler/man/bundle-doctor.1 index 6d4b0376a68ad8..a0329dfc481347 100644 --- a/lib/bundler/man/bundle-doctor.1 +++ b/lib/bundler/man/bundle-doctor.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-DOCTOR" "1" "August 2025" "" +.TH "BUNDLE\-DOCTOR" "1" "September 2025" "" .SH "NAME" \fBbundle\-doctor\fR \- Checks the bundle for common problems .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-env.1 b/lib/bundler/man/bundle-env.1 index 28ccc17f03aa9f..eee3ca05d0c680 100644 --- a/lib/bundler/man/bundle-env.1 +++ b/lib/bundler/man/bundle-env.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ENV" "1" "August 2025" "" +.TH "BUNDLE\-ENV" "1" "September 2025" "" .SH "NAME" \fBbundle\-env\fR \- Print information about the environment Bundler is running under .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-exec.1 b/lib/bundler/man/bundle-exec.1 index cd53916cffcc34..93788a850f463d 100644 --- a/lib/bundler/man/bundle-exec.1 +++ b/lib/bundler/man/bundle-exec.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-EXEC" "1" "August 2025" "" +.TH "BUNDLE\-EXEC" "1" "September 2025" "" .SH "NAME" \fBbundle\-exec\fR \- Execute a command in the context of the bundle .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-fund.1 b/lib/bundler/man/bundle-fund.1 index a91c1809514aee..fe24a25ca12c0f 100644 --- a/lib/bundler/man/bundle-fund.1 +++ b/lib/bundler/man/bundle-fund.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-FUND" "1" "August 2025" "" +.TH "BUNDLE\-FUND" "1" "September 2025" "" .SH "NAME" \fBbundle\-fund\fR \- Lists information about gems seeking funding assistance .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-gem.1 b/lib/bundler/man/bundle-gem.1 index 5fe27772306930..884badb584ebd2 100644 --- a/lib/bundler/man/bundle-gem.1 +++ b/lib/bundler/man/bundle-gem.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-GEM" "1" "August 2025" "" +.TH "BUNDLE\-GEM" "1" "September 2025" "" .SH "NAME" \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-help.1 b/lib/bundler/man/bundle-help.1 index 9ea28bef14d082..05fd5a7c48449b 100644 --- a/lib/bundler/man/bundle-help.1 +++ b/lib/bundler/man/bundle-help.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-HELP" "1" "August 2025" "" +.TH "BUNDLE\-HELP" "1" "September 2025" "" .SH "NAME" \fBbundle\-help\fR \- Displays detailed help for each subcommand .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-info.1 b/lib/bundler/man/bundle-info.1 index 29d649d342cc42..96c7d876f64a08 100644 --- a/lib/bundler/man/bundle-info.1 +++ b/lib/bundler/man/bundle-info.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INFO" "1" "August 2025" "" +.TH "BUNDLE\-INFO" "1" "September 2025" "" .SH "NAME" \fBbundle\-info\fR \- Show information for the given gem in your bundle .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-init.1 b/lib/bundler/man/bundle-init.1 index be9399c20f2367..83dad5c050bf85 100644 --- a/lib/bundler/man/bundle-init.1 +++ b/lib/bundler/man/bundle-init.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INIT" "1" "August 2025" "" +.TH "BUNDLE\-INIT" "1" "September 2025" "" .SH "NAME" \fBbundle\-init\fR \- Generates a Gemfile into the current working directory .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-install.1 b/lib/bundler/man/bundle-install.1 index f9bbade2fd59fb..47e8858f732940 100644 --- a/lib/bundler/man/bundle-install.1 +++ b/lib/bundler/man/bundle-install.1 @@ -1,10 +1,10 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-INSTALL" "1" "August 2025" "" +.TH "BUNDLE\-INSTALL" "1" "September 2025" "" .SH "NAME" \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile .SH "SYNOPSIS" -\fBbundle install\fR [\-\-binstubs[=DIRECTORY]] [\-\-clean] [\-\-deployment] [\-\-force] [\-\-frozen] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-no\-prune] [\-\-path PATH] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-shebang=SHEBANG] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-system] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG] [\-\-with=GROUP[ GROUP\|\.\|\.\|\.]] [\-\-without=GROUP[ GROUP\|\.\|\.\|\.]] +\fBbundle install\fR [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG] .SH "DESCRIPTION" Install the gems specified in your Gemfile(5)\. If this is the first time you run bundle install (and a \fBGemfile\.lock\fR does not exist), Bundler will fetch all remote sources, resolve dependencies and install all needed gems\. .P @@ -12,31 +12,15 @@ If a \fBGemfile\.lock\fR does exist, and you have not updated your Gemfile(5), B .P If a \fBGemfile\.lock\fR does exist, and you have updated your Gemfile(5), Bundler will use the dependencies in the \fBGemfile\.lock\fR for all gems that you did not update, but will re\-resolve the dependencies of gems that you did update\. You can find more information about this update process below under \fICONSERVATIVE UPDATING\fR\. .SH "OPTIONS" -The \fB\-\-clean\fR, \fB\-\-deployment\fR, \fB\-\-frozen\fR, \fB\-\-no\-prune\fR, \fB\-\-path\fR, \fB\-\-shebang\fR, \fB\-\-system\fR, \fB\-\-without\fR and \fB\-\-with\fR options are deprecated because they only make sense if they are applied to every subsequent \fBbundle install\fR run automatically and that requires \fBbundler\fR to silently remember them\. Since \fBbundler\fR will no longer remember CLI flags in future versions, \fBbundle config\fR (see bundle\-config(1)) should be used to apply them permanently\. .TP \fB\-\-binstubs[=BINSTUBS]\fR Binstubs are scripts that wrap around executables\. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it in \fBbin/\fR\. This lets you link the binstub inside of an application to the exact gem version the application needs\. .IP Creates a directory (defaults to \fB~/bin\fR when the option is used without a value, or to the given \fB\fR directory otherwise) and places any executables from the gem there\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\. .TP -\fB\-\-clean\fR -On finishing the installation Bundler is going to remove any gems not present in the current Gemfile(5)\. Don't worry, gems currently in use will not be removed\. -.IP -This option is deprecated in favor of the \fBclean\fR setting\. -.TP -\fB\-\-deployment\fR -In \fIdeployment mode\fR, Bundler will 'roll\-out' the bundle for production or CI use\. Please check carefully if you want to have this option enabled in your development environment\. -.IP -This option is deprecated in favor of the \fBdeployment\fR setting\. -.TP \fB\-\-force\fR, \fB\-\-redownload\fR Force reinstalling every gem, even if already installed\. .TP -\fB\-\-frozen\fR -Do not allow the Gemfile\.lock to be updated after this install\. Exits non\-zero if there are going to be changes to the Gemfile\.lock\. -.IP -This option is deprecated in favor of the \fBfrozen\fR setting\. -.TP \fB\-\-full\-index\fR Bundler will not call Rubygems' API endpoint (default) but download and cache a (currently big) index file of all gems\. Performance can be improved for large bundles that seldom change by enabling this option\. .TP @@ -55,52 +39,22 @@ Force using locally installed gems, or gems already present in Rubygems' cache o \fB\-\-no\-cache\fR Do not update the cache in \fBvendor/cache\fR with the newly bundled gems\. This does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install\. .TP -\fB\-\-no\-prune\fR -Don't remove stale gems from the cache when the installation finishes\. -.IP -This option is deprecated in favor of the \fBno_prune\fR setting\. -.TP -\fB\-\-path=PATH\fR -The location to install the specified gems to\. This defaults to Rubygems' setting\. Bundler shares this location with Rubygems, \fBgem install \|\.\|\.\|\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \|\.\|\.\|\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\. -.IP -This option is deprecated in favor of the \fBpath\fR setting\. -.TP \fB\-\-quiet\fR Do not print progress information to the standard output\. .TP \fB\-\-retry=[]\fR Retry failed network or git requests for \fInumber\fR times\. .TP -\fB\-\-shebang=SHEBANG\fR -Uses the specified ruby executable (usually \fBruby\fR) to execute the scripts created with \fB\-\-binstubs\fR\. In addition, if you use \fB\-\-binstubs\fR together with \fB\-\-shebang jruby\fR these executables will be changed to execute \fBjruby\fR instead\. -.IP -This option is deprecated in favor of the \fBshebang\fR setting\. -.TP \fB\-\-standalone[=]\fR -Makes a bundle that can work without depending on Rubygems or Bundler at runtime\. A space separated list of groups to install can be specified\. Bundler creates a directory named \fBbundle\fR and installs the bundle there\. It also generates a \fBbundle/bundler/setup\.rb\fR file to replace Bundler's own setup in the manner required\. Using this option implicitly sets \fBpath\fR, which is a [remembered option][REMEMBERED OPTIONS]\. -.TP -\fB\-\-system\fR -Installs the gems specified in the bundle to the system's Rubygems location\. This overrides any previous configuration of \fB\-\-path\fR\. -.IP -This option is deprecated in favor of the \fBsystem\fR setting\. +Makes a bundle that can work without depending on Rubygems or Bundler at runtime\. A space separated list of groups to install can be specified\. Bundler creates a directory named \fBbundle\fR and installs the bundle there\. It also generates a \fBbundle/bundler/setup\.rb\fR file to replace Bundler's own setup in the manner required\. .TP \fB\-\-trust\-policy=TRUST\-POLICY\fR Apply the Rubygems security policy \fIpolicy\fR, where policy is one of \fBHighSecurity\fR, \fBMediumSecurity\fR, \fBLowSecurity\fR, \fBAlmostNoSecurity\fR, or \fBNoSecurity\fR\. For more details, please see the Rubygems signing documentation linked below in \fISEE ALSO\fR\. .TP \fB\-\-target\-rbconfig=TARGET\-RBCONFIG\fR Path to rbconfig\.rb for the deployment target platform\. -.TP -\fB\-\-with=\fR -A space\-separated list of groups referencing gems to install\. If an optional group is given it is installed\. If a group is given that is in the remembered list of groups given to \-\-without, it is removed from that list\. -.IP -This option is deprecated in favor of the \fBwith\fR setting\. -.TP -\fB\-\-without=\fR -A space\-separated list of groups referencing gems to skip during installation\. If a group is given that is in the remembered list of groups given to \-\-with, it is removed from that list\. -.IP -This option is deprecated in favor of the \fBwithout\fR setting\. .SH "DEPLOYMENT MODE" -Bundler's defaults are optimized for development\. To switch to defaults optimized for deployment and for CI, use the \fB\-\-deployment\fR flag\. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified\. +Bundler's defaults are optimized for development\. To switch to defaults optimized for deployment and for CI, use the \fBdeployment\fR setting\. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified\. .IP "1." 4 A \fBGemfile\.lock\fR is required\. .IP @@ -120,14 +74,14 @@ In development, it's convenient to share the gems used in your application with .IP In deployment, isolation is a more important default\. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them\. .IP -As a result, \fBbundle install \-\-deployment\fR installs gems to the \fBvendor/bundle\fR directory in the application\. This may be overridden using the \fB\-\-path\fR option\. +As a result, when \fBdeployment\fR is configured, \fBbundle install\fR installs gems to the \fBvendor/bundle\fR directory in the application\. This may be overridden using the \fBpath\fR setting\. .IP "" 0 .SH "INSTALLING GROUPS" By default, \fBbundle install\fR will install all gems in all groups in your Gemfile(5), except those declared for a different platform\. .P -However, you can explicitly tell Bundler to skip installing certain groups with the \fB\-\-without\fR option\. This option takes a space\-separated list of groups\. +However, you can explicitly tell Bundler to skip installing certain groups with the \fBwithout\fR setting\. This setting takes a space\-separated list of groups\. .P -While the \fB\-\-without\fR option will skip \fIinstalling\fR the gems in the specified groups, it will still \fIdownload\fR those gems and use them to resolve the dependencies of every gem in your Gemfile(5)\. +While the \fBwithout\fR setting will skip \fIinstalling\fR the gems in the specified groups, \fBbundle install\fR will still \fIdownload\fR those gems and use them to resolve the dependencies of every gem in your Gemfile(5)\. .P This is so that installing a different set of groups on another machine (such as a production server) will not change the gems and versions that you have already developed and tested against\. .P @@ -148,7 +102,7 @@ end .P In this case, \fBsinatra\fR depends on any version of Rack (\fB>= 1\.0\fR), while \fBrack\-perftools\-profiler\fR depends on 1\.x (\fB~> 1\.0\fR)\. .P -When you run \fBbundle install \-\-without production\fR in development, we look at the dependencies of \fBrack\-perftools\-profiler\fR as well\. That way, you do not spend all your time developing against Rack 2\.0, using new APIs unavailable in Rack 1\.x, only to have Bundler switch to Rack 1\.2 when the \fBproduction\fR group \fIis\fR used\. +When you configure \fBbundle config without production\fR in development, we look at the dependencies of \fBrack\-perftools\-profiler\fR as well\. That way, you do not spend all your time developing against Rack 2\.0, using new APIs unavailable in Rack 1\.x, only to have Bundler switch to Rack 1\.2 when the \fBproduction\fR group \fIis\fR used\. .P This should not cause any problems in practice, because we do not attempt to \fBinstall\fR the gems in the excluded groups, and only evaluate as part of the dependency resolution process\. .P diff --git a/lib/bundler/man/bundle-install.1.ronn b/lib/bundler/man/bundle-install.1.ronn index cc6241dd672921..c37ec1eeb41c4c 100644 --- a/lib/bundler/man/bundle-install.1.ronn +++ b/lib/bundler/man/bundle-install.1.ronn @@ -3,28 +3,18 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile ## SYNOPSIS -`bundle install` [--binstubs[=DIRECTORY]] - [--clean] - [--deployment] - [--force] - [--frozen] +`bundle install` [--force] [--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--local] [--no-cache] - [--no-prune] - [--path PATH] [--prefer-local] [--quiet] [--retry=NUMBER] - [--shebang=SHEBANG] [--standalone[=GROUP[ GROUP...]]] - [--system] [--trust-policy=TRUST-POLICY] [--target-rbconfig=TARGET-RBCONFIG] - [--with=GROUP[ GROUP...]] - [--without=GROUP[ GROUP...]] ## DESCRIPTION @@ -45,13 +35,6 @@ update process below under [CONSERVATIVE UPDATING][]. ## OPTIONS -The `--clean`, `--deployment`, `--frozen`, `--no-prune`, `--path`, `--shebang`, -`--system`, `--without` and `--with` options are deprecated because they only -make sense if they are applied to every subsequent `bundle install` run -automatically and that requires `bundler` to silently remember them. Since -`bundler` will no longer remember CLI flags in future versions, `bundle config` -(see bundle-config(1)) should be used to apply them permanently. - * `--binstubs[=BINSTUBS]`: Binstubs are scripts that wrap around executables. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it in `bin/`. @@ -66,29 +49,9 @@ automatically and that requires `bundler` to silently remember them. Since create a `bin/rails` executable that ensures that all referred dependencies will be resolved using the bundled gems. -* `--clean`: - On finishing the installation Bundler is going to remove any gems not present - in the current Gemfile(5). Don't worry, gems currently in use will not be - removed. - - This option is deprecated in favor of the `clean` setting. - -* `--deployment`: - In [deployment mode][DEPLOYMENT MODE], Bundler will 'roll-out' the bundle for - production or CI use. Please check carefully if you want to have this option - enabled in your development environment. - - This option is deprecated in favor of the `deployment` setting. - * `--force`, `--redownload`: Force reinstalling every gem, even if already installed. -* `--frozen`: - Do not allow the Gemfile.lock to be updated after this install. Exits - non-zero if there are going to be changes to the Gemfile.lock. - - This option is deprecated in favor of the `frozen` setting. - * `--full-index`: Bundler will not call Rubygems' API endpoint (default) but download and cache a (currently big) index file of all gems. Performance can be improved for @@ -122,47 +85,18 @@ automatically and that requires `bundler` to silently remember them. Since does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install. -* `--no-prune`: - Don't remove stale gems from the cache when the installation finishes. - - This option is deprecated in favor of the `no_prune` setting. - -* `--path=PATH`: - The location to install the specified gems to. This defaults to Rubygems' - setting. Bundler shares this location with Rubygems, `gem install ...` will - have gem installed there, too. Therefore, gems installed without a - `--path ...` setting will show up by calling `gem list`. Accordingly, gems - installed to other locations will not get listed. - - This option is deprecated in favor of the `path` setting. - * `--quiet`: Do not print progress information to the standard output. * `--retry=[]`: Retry failed network or git requests for times. -* `--shebang=SHEBANG`: - Uses the specified ruby executable (usually `ruby`) to execute the scripts - created with `--binstubs`. In addition, if you use `--binstubs` together with - `--shebang jruby` these executables will be changed to execute `jruby` - instead. - - This option is deprecated in favor of the `shebang` setting. - * `--standalone[=]`: Makes a bundle that can work without depending on Rubygems or Bundler at runtime. A space separated list of groups to install can be specified. Bundler creates a directory named `bundle` and installs the bundle there. It also generates a `bundle/bundler/setup.rb` file to replace Bundler's own setup - in the manner required. Using this option implicitly sets `path`, which is a - [remembered option][REMEMBERED OPTIONS]. - -* `--system`: - Installs the gems specified in the bundle to the system's Rubygems location. - This overrides any previous configuration of `--path`. - - This option is deprecated in favor of the `system` setting. + in the manner required. * `--trust-policy=TRUST-POLICY`: Apply the Rubygems security policy , where policy is one of @@ -173,26 +107,11 @@ automatically and that requires `bundler` to silently remember them. Since * `--target-rbconfig=TARGET-RBCONFIG`: Path to rbconfig.rb for the deployment target platform. -* `--with=`: - A space-separated list of groups referencing gems to install. If an - optional group is given it is installed. If a group is given that is - in the remembered list of groups given to --without, it is removed - from that list. - - This option is deprecated in favor of the `with` setting. - -* `--without=`: - A space-separated list of groups referencing gems to skip during installation. - If a group is given that is in the remembered list of groups given - to --with, it is removed from that list. - - This option is deprecated in favor of the `without` setting. - ## DEPLOYMENT MODE Bundler's defaults are optimized for development. To switch to -defaults optimized for deployment and for CI, use the `--deployment` -flag. Do not activate deployment mode on development machines, as it +defaults optimized for deployment and for CI, use the `deployment` +setting. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified. 1. A `Gemfile.lock` is required. @@ -224,9 +143,9 @@ will cause an error when the Gemfile(5) is modified. gems to the system, or the web server may not have permission to read them. - As a result, `bundle install --deployment` installs gems to - the `vendor/bundle` directory in the application. This may be - overridden using the `--path` option. + As a result, when `deployment` is configured, `bundle install` installs gems + to the `vendor/bundle` directory in the application. This may be + overridden using the `path` setting. ## INSTALLING GROUPS @@ -234,12 +153,12 @@ By default, `bundle install` will install all gems in all groups in your Gemfile(5), except those declared for a different platform. However, you can explicitly tell Bundler to skip installing -certain groups with the `--without` option. This option takes +certain groups with the `without` setting. This setting takes a space-separated list of groups. -While the `--without` option will skip _installing_ the gems in the -specified groups, it will still _download_ those gems and use them to -resolve the dependencies of every gem in your Gemfile(5). +While the `without` setting will skip _installing_ the gems in the +specified groups, `bundle install` will still _download_ those gems and use them +to resolve the dependencies of every gem in your Gemfile(5). This is so that installing a different set of groups on another machine (such as a production server) will not change the @@ -265,7 +184,7 @@ For a simple illustration, consider the following Gemfile(5): In this case, `sinatra` depends on any version of Rack (`>= 1.0`), while `rack-perftools-profiler` depends on 1.x (`~> 1.0`). -When you run `bundle install --without production` in development, we +When you configure `bundle config without production` in development, we look at the dependencies of `rack-perftools-profiler` as well. That way, you do not spend all your time developing against Rack 2.0, using new APIs unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2 diff --git a/lib/bundler/man/bundle-issue.1 b/lib/bundler/man/bundle-issue.1 index 3c7e5305f3721a..394d6c54691043 100644 --- a/lib/bundler/man/bundle-issue.1 +++ b/lib/bundler/man/bundle-issue.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-ISSUE" "1" "August 2025" "" +.TH "BUNDLE\-ISSUE" "1" "September 2025" "" .SH "NAME" \fBbundle\-issue\fR \- Get help reporting Bundler issues .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-licenses.1 b/lib/bundler/man/bundle-licenses.1 index eb0ad5ae405cd3..2931e42dd7e84e 100644 --- a/lib/bundler/man/bundle-licenses.1 +++ b/lib/bundler/man/bundle-licenses.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LICENSES" "1" "August 2025" "" +.TH "BUNDLE\-LICENSES" "1" "September 2025" "" .SH "NAME" \fBbundle\-licenses\fR \- Print the license of all gems in the bundle .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-list.1 b/lib/bundler/man/bundle-list.1 index a345787a5e9ee0..d8bcf20585a449 100644 --- a/lib/bundler/man/bundle-list.1 +++ b/lib/bundler/man/bundle-list.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LIST" "1" "August 2025" "" +.TH "BUNDLE\-LIST" "1" "September 2025" "" .SH "NAME" \fBbundle\-list\fR \- List all the gems in the bundle .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-lock.1 b/lib/bundler/man/bundle-lock.1 index 79aa1e2452f6d3..478d173535074e 100644 --- a/lib/bundler/man/bundle-lock.1 +++ b/lib/bundler/man/bundle-lock.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-LOCK" "1" "August 2025" "" +.TH "BUNDLE\-LOCK" "1" "September 2025" "" .SH "NAME" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-open.1 b/lib/bundler/man/bundle-open.1 index b1c2022f40195b..2f13b1329fc161 100644 --- a/lib/bundler/man/bundle-open.1 +++ b/lib/bundler/man/bundle-open.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-OPEN" "1" "August 2025" "" +.TH "BUNDLE\-OPEN" "1" "September 2025" "" .SH "NAME" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-outdated.1 b/lib/bundler/man/bundle-outdated.1 index d4790f8876a54d..7e10d202bedf0d 100644 --- a/lib/bundler/man/bundle-outdated.1 +++ b/lib/bundler/man/bundle-outdated.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-OUTDATED" "1" "August 2025" "" +.TH "BUNDLE\-OUTDATED" "1" "September 2025" "" .SH "NAME" \fBbundle\-outdated\fR \- List installed gems with newer versions available .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-platform.1 b/lib/bundler/man/bundle-platform.1 index 78de506b57b838..6a3a08c3a93a84 100644 --- a/lib/bundler/man/bundle-platform.1 +++ b/lib/bundler/man/bundle-platform.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PLATFORM" "1" "August 2025" "" +.TH "BUNDLE\-PLATFORM" "1" "September 2025" "" .SH "NAME" \fBbundle\-platform\fR \- Displays platform compatibility information .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-plugin.1 b/lib/bundler/man/bundle-plugin.1 index 5fcc88b50df308..9da6927dc4d8f0 100644 --- a/lib/bundler/man/bundle-plugin.1 +++ b/lib/bundler/man/bundle-plugin.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PLUGIN" "1" "August 2025" "" +.TH "BUNDLE\-PLUGIN" "1" "September 2025" "" .SH "NAME" \fBbundle\-plugin\fR \- Manage Bundler plugins .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-pristine.1 b/lib/bundler/man/bundle-pristine.1 index e39f264ceff298..a8316b5cca1e7d 100644 --- a/lib/bundler/man/bundle-pristine.1 +++ b/lib/bundler/man/bundle-pristine.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-PRISTINE" "1" "August 2025" "" +.TH "BUNDLE\-PRISTINE" "1" "September 2025" "" .SH "NAME" \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-remove.1 b/lib/bundler/man/bundle-remove.1 index 67508176802bf4..63ffe0f1576e39 100644 --- a/lib/bundler/man/bundle-remove.1 +++ b/lib/bundler/man/bundle-remove.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-REMOVE" "1" "August 2025" "" +.TH "BUNDLE\-REMOVE" "1" "September 2025" "" .SH "NAME" \fBbundle\-remove\fR \- Removes gems from the Gemfile .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-show.1 b/lib/bundler/man/bundle-show.1 index 67b387559d7ca5..3a6d157903d6bb 100644 --- a/lib/bundler/man/bundle-show.1 +++ b/lib/bundler/man/bundle-show.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-SHOW" "1" "August 2025" "" +.TH "BUNDLE\-SHOW" "1" "September 2025" "" .SH "NAME" \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-update.1 b/lib/bundler/man/bundle-update.1 index fbcabb69a8d61f..2f9932dc1e5e24 100644 --- a/lib/bundler/man/bundle-update.1 +++ b/lib/bundler/man/bundle-update.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-UPDATE" "1" "August 2025" "" +.TH "BUNDLE\-UPDATE" "1" "September 2025" "" .SH "NAME" \fBbundle\-update\fR \- Update your gems to the latest available versions .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle-version.1 b/lib/bundler/man/bundle-version.1 index 261140ff3816f5..6462ec79583247 100644 --- a/lib/bundler/man/bundle-version.1 +++ b/lib/bundler/man/bundle-version.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE\-VERSION" "1" "August 2025" "" +.TH "BUNDLE\-VERSION" "1" "September 2025" "" .SH "NAME" \fBbundle\-version\fR \- Prints Bundler version information .SH "SYNOPSIS" diff --git a/lib/bundler/man/bundle.1 b/lib/bundler/man/bundle.1 index ece080b3e9d99e..9f7feb4133d7a4 100644 --- a/lib/bundler/man/bundle.1 +++ b/lib/bundler/man/bundle.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "BUNDLE" "1" "August 2025" "" +.TH "BUNDLE" "1" "September 2025" "" .SH "NAME" \fBbundle\fR \- Ruby Dependency Management .SH "SYNOPSIS" diff --git a/lib/bundler/man/gemfile.5 b/lib/bundler/man/gemfile.5 index cd04d3d1983d37..4e1a63578076e2 100644 --- a/lib/bundler/man/gemfile.5 +++ b/lib/bundler/man/gemfile.5 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 -.TH "GEMFILE" "5" "August 2025" "" +.TH "GEMFILE" "5" "September 2025" "" .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs .SH "SYNOPSIS" diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index cc20598fd9c2c2..cefbf0b1f0691e 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -20,7 +20,6 @@ class Settings disable_shared_gems disable_version_check force_ruby_platform - forget_cli_options frozen gem.changelog gem.coc @@ -43,20 +42,6 @@ class Settings verbose ].freeze - REMEMBERED_KEYS = %w[ - bin - cache_all - clean - deployment - frozen - no_prune - path - shebang - path.system - without - with - ].freeze - NUMBER_KEYS = %w[ jobs redirect @@ -128,12 +113,8 @@ def [](name) end def set_command_option(key, value) - if !is_remembered(key) || Bundler.feature_flag.forget_cli_options? - temporary(key => value) - value - else - set_local(key, value) - end + temporary(key => value) + value end def set_command_option_if_given(key, value) @@ -387,10 +368,6 @@ def is_array(key) ARRAY_KEYS.include?(self.class.key_to_s(key)) end - def is_remembered(key) - REMEMBERED_KEYS.include?(self.class.key_to_s(key)) - end - def is_credential(key) key == "gem.push_key" end diff --git a/lib/bundler/vlad.rb b/lib/bundler/vlad.rb index 6179d0e4eb5d12..c3a3d949a6cc78 100644 --- a/lib/bundler/vlad.rb +++ b/lib/bundler/vlad.rb @@ -1,17 +1,4 @@ # frozen_string_literal: true require_relative "shared_helpers" -Bundler::SharedHelpers.major_deprecation 2, - "The Bundler task for Vlad" - -# Vlad task for Bundler. -# -# Add "require 'bundler/vlad'" in your Vlad deploy.rb, and -# include the vlad:bundle:install task in your vlad:deploy task. -require_relative "deployment" - -include Rake::DSL if defined? Rake::DSL - -namespace :vlad do - Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, roles: :app) -end +Bundler::SharedHelpers.feature_removed! "The Bundler task for Vlad" diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb index 991bc6fb95d038..fe4c3a80cf923c 100644 --- a/lib/rubygems/uninstaller.rb +++ b/lib/rubygems/uninstaller.rb @@ -42,10 +42,25 @@ class Gem::Uninstaller attr_reader :spec ## - # Constructs an uninstaller that will uninstall +gem+ + # Constructs an uninstaller that will uninstall gem named +gem+. + # +options+ is a Hash with the following keys: + # + # :version:: Version requirement for the gem to uninstall. If not specified, + # uses Gem::Requirement.default. + # :install_dir:: The directory where the gem is installed. If not specified, + # uses Gem.dir. + # :executables:: Whether executables should be removed without confirmation or not. If nil, asks the user explicitly. + # :all:: If more than one version matches the requirement, whether to forcefully remove all matching versions or ask the user to select specific matching versions that should be removed. + # :ignore:: Ignore broken dependency checks when uninstalling. + # :bin_dir:: Directory containing executables to remove. If not specified, + # uses Gem.bindir. + # :format_executable:: In order to find executables to be removed, format executable names using Gem::Installer.exec_format. + # :abort_on_dependent:: Directly abort uninstallation if dependencies would be broken, rather than asking the user for confirmation. + # :check_dev:: When checking if uninstalling gem would leave broken dependencies around, also consider development dependencies. + # :force:: Set both :all and :ignore to true for forced uninstallation. + # :user_install:: Uninstall from user gem directory instead of system directory. def initialize(gem, options = {}) - # TODO: document the valid options @gem = gem @version = options[:version] || Gem::Requirement.default @install_dir = options[:install_dir] @@ -57,10 +72,6 @@ def initialize(gem, options = {}) @bin_dir = options[:bin_dir] @format_executable = options[:format_executable] @abort_on_dependent = options[:abort_on_dependent] - - # Indicate if development dependencies should be checked when - # uninstalling. (default: false) - # @check_dev = options[:check_dev] if options[:force] diff --git a/spec/bundler/cache/path_spec.rb b/spec/bundler/cache/path_spec.rb index 526b7369ef35a5..2a64397417ba82 100644 --- a/spec/bundler/cache/path_spec.rb +++ b/spec/bundler/cache/path_spec.rb @@ -122,48 +122,4 @@ expect(err).to be_empty expect(bundled_app("vendor/cache/foo-1.0")).to exist end - - it "stores the given flag" do - build_lib "foo" - - install_gemfile <<-G - source "https://gem.repo1" - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle "config set cache_all true" - bundle :cache - build_lib "bar" - - install_gemfile <<-G - source "https://gem.repo1" - gem "foo", :path => '#{lib_path("foo-1.0")}' - gem "bar", :path => '#{lib_path("bar-1.0")}' - G - - bundle :cache - expect(bundled_app("vendor/cache/bar-1.0")).to exist - end - - it "can rewind chosen configuration" do - build_lib "foo" - - install_gemfile <<-G - source "https://gem.repo1" - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle "config set cache_all true" - bundle :cache - build_lib "baz" - - gemfile <<-G - source "https://gem.repo1" - gem "foo", :path => '#{lib_path("foo-1.0")}' - gem "baz", :path => '#{lib_path("baz-1.0")}' - G - - bundle "cache --no-all", raise_on_error: false - expect(bundled_app("vendor/cache/baz-1.0")).not_to exist - end end diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index e0424dcba4e03a..306cbbc412d57e 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -156,29 +156,20 @@ end end - context "--path" do - it "sets the binstubs dir" do - install_gemfile <<-G - source "https://gem.repo1" - gem "myrack" - G - - bundle "binstubs myrack --path exec" - - expect(bundled_app("exec/myrackup")).to exist + context "with the binstubs dir configured" do + before do + bundle "config bin exec" end - it "setting is saved for bundle install" do + it "creates the binstubs in the configured dir" do install_gemfile <<-G source "https://gem.repo1" gem "myrack" - gem "rails" G - bundle "binstubs myrack", path: "exec" - bundle :install + bundle "binstubs myrack" - expect(bundled_app("exec/rails")).to exist + expect(bundled_app("exec/myrackup")).to exist end end @@ -201,11 +192,10 @@ expect(File.read(bundled_app("bin/myrackup"))).to_not include("Gem.bin_path") end - context "when specified --path option" do - it "generates a standalone binstub at the given path" do - bundle "binstubs myrack --standalone --path foo" - expect(bundled_app("foo/myrackup")).to exist - end + it "generates a standalone binstub at the given path when configured" do + bundle "config bin foo" + bundle "binstubs myrack --standalone" + expect(bundled_app("foo/myrackup")).to exist end context "when specified --all-platforms option" do diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index ff70d0337dd2f4..80c2ebf68f34ff 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -28,7 +28,7 @@ end end - context "with --all" do + context "with cache_all configured" do context "without a gemspec" do it "caches all dependencies except bundler itself" do gemfile <<-D @@ -158,20 +158,6 @@ end end - context "with --path" do - it "sets root directory for gems" do - gemfile <<-D - source "https://gem.repo1" - gem 'myrack' - D - - bundle "cache --path #{bundled_app("test")}" - - expect(the_bundle).to include_gems "myrack 1.0.0" - expect(bundled_app("test/vendor/cache/")).to exist - end - end - context "with --no-install" do it "puts the gems in vendor/cache but does not install them" do gemfile <<-D @@ -290,39 +276,6 @@ end end - it "enforces frozen mode when --frozen is passed" do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "myrack-obama" - G - - lockfile <<-L - GEM - remote: https://gem.repo1/ - specs: - myrack (1.0.0) - - PLATFORMS - #{lockfile_platforms} - - DEPENDENCIES - myrack - - BUNDLED WITH - #{Bundler::VERSION} - L - - bundle "cache --frozen", raise_on_error: false - - expect(exitstatus).to eq(16) - expect(err).to include("frozen mode") - expect(err).to include("You have added to the Gemfile") - expect(err).to include("* myrack-obama") - bundle "env" - expect(out).to include("frozen") - end - context "with frozen configured" do let(:app_cache) { bundled_app("vendor/cache") } diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 4793210e977f49..ecc23c772f1875 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -123,19 +123,6 @@ expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.") end - it "remembers --without option from install" do - gemfile <<-G - source "https://gem.repo1" - group :foo do - gem "myrack" - end - G - - bundle "install --without foo" - bundle "check" - expect(out).to include("The Gemfile's dependencies are satisfied") - end - it "uses the without setting" do bundle "config set without foo" install_gemfile <<-G @@ -272,46 +259,6 @@ expect(last_command).to be_failure end - context "--path" do - context "after installing gems in the proper directory" do - before do - gemfile <<-G - source "https://gem.repo1" - gem "rails" - G - bundle "install --path vendor/bundle" - - FileUtils.rm_r(bundled_app(".bundle")) - end - - it "returns success" do - bundle "check --path vendor/bundle" - expect(out).to include("The Gemfile's dependencies are satisfied") - end - - it "should write to .bundle/config" do - bundle "check --path vendor/bundle" - bundle "check" - end - end - - context "after installing gems on a different directory" do - before do - install_gemfile <<-G - source "https://gem.repo1" - gem "rails" - G - - bundle "check --path vendor/bundle", raise_on_error: false - end - - it "returns false" do - expect(exitstatus).to eq(1) - expect(err).to match(/The following gems are missing/) - end - end - end - describe "when locked" do before :each do system_gems "myrack-1.0.0" diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index fd5a0fdbcaa2ff..f2cd8868935d7b 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -383,50 +383,6 @@ def should_not_have_gems(*gems) expect(out).to include("myrack (1.0.0)").and include("thin (1.0)") end - it "--clean should override the bundle setting on install" do - gemfile <<-G - source "https://gem.repo1" - - gem "thin" - gem "myrack" - G - bundle "config set path vendor/bundle" - bundle "config set clean false" - bundle "install --clean true" - - gemfile <<-G - source "https://gem.repo1" - - gem "myrack" - G - bundle "install" - - should_have_gems "myrack-1.0.0" - should_not_have_gems "thin-1.0" - end - - it "--clean should override the bundle setting on update" do - build_repo2 - - gemfile <<-G - source "https://gem.repo2" - - gem "foo" - G - bundle "config set path vendor/bundle" - bundle "config set clean false" - bundle "install --clean true" - - update_repo2 do - build_gem "foo", "1.0.1" - end - - bundle "update", all: true - - should_have_gems "foo-1.0.1" - should_not_have_gems "foo-1.0" - end - it "automatically cleans when path has not been set", bundler: "5" do build_repo2 @@ -451,7 +407,7 @@ def should_not_have_gems(*gems) ] end - it "does not clean automatically on --path" do + it "does not clean automatically when path configured" do gemfile <<-G source "https://gem.repo1" @@ -471,7 +427,7 @@ def should_not_have_gems(*gems) should_have_gems "myrack-1.0.0", "thin-1.0" end - it "does not clean on bundle update with --path" do + it "does not clean on bundle update when path configured" do build_repo2 gemfile <<-G @@ -490,7 +446,7 @@ def should_not_have_gems(*gems) should_have_gems "foo-1.0", "foo-1.0.1" end - it "does not clean on bundle update when using --system" do + it "does not clean on bundle update when installing to system gems" do bundle "config set path.system true" build_repo2 diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 77c7dff0ce38a8..ae2e84766a63cc 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -340,20 +340,6 @@ bundle "install" expect(the_bundle).to include_gems "myrack 1.0" end - - it "allows running bundle install --system without deleting foo" do - bundle "install --path vendor" - bundle "install --system" - FileUtils.rm_r(bundled_app("vendor")) - expect(the_bundle).to include_gems "myrack 1.0" - end - - it "allows running bundle install --system after deleting foo" do - bundle "install --path vendor" - FileUtils.rm_r(bundled_app("vendor")) - bundle "install --system" - expect(the_bundle).to include_gems "myrack 1.0" - end end it "finds gems in multiple sources" do diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index b66b8c9e532f27..c7d285cd369593 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -819,7 +819,7 @@ def test_group_option(group) expect(out).to include("Installing foo 1.0") end - context "after bundle install --deployment" do + context "in deployment mode" do before do build_repo2 @@ -830,7 +830,7 @@ def test_group_option(group) gem "foo" G bundle :lock - bundle :install, deployment: true + bundle "config deployment true" end it "outputs a helpful message about being in deployment mode" do diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb index 1dfa58dfd7b748..257443526089ad 100644 --- a/spec/bundler/commands/post_bundle_message_spec.rb +++ b/spec/bundler/commands/post_bundle_message_spec.rb @@ -155,33 +155,6 @@ end end - describe "for second bundle install run after first run using --without" do - it "with --without one group" do - bundle "install --without emo" - bundle :install - expect(out).to include(bundle_show_system_message) - expect(out).to include("Gems in the group 'emo' were not installed") - expect(out).to include(bundle_complete_message) - expect(out).to include(installed_gems_stats) - end - - it "with --without two groups" do - bundle "install --without emo test" - bundle :install - expect(out).to include(bundle_show_system_message) - expect(out).to include("Gems in the groups 'emo' and 'test' were not installed") - expect(out).to include(bundle_complete_message) - end - - it "with --without more groups" do - bundle "install --without emo obama test" - bundle :install - expect(out).to include(bundle_show_system_message) - expect(out).to include("Gems in the groups 'emo', 'obama' and 'test' were not installed") - expect(out).to include(bundle_complete_message) - end - end - describe "for bundle update" do it "shows proper messages according to the configured groups" do bundle :update, all: true diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 7702c723977559..ef856edf3799aa 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -816,7 +816,7 @@ end it "should fail loudly" do - bundle "install --deployment" + bundle "config deployment true" bundle "update", all: true, raise_on_error: false expect(last_command).to be_failure diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb index 3560a3965c762c..e401f26a16ece2 100644 --- a/spec/bundler/install/deploy_spec.rb +++ b/spec/bundler/install/deploy_spec.rb @@ -8,72 +8,6 @@ G end - context "with CLI flags" do - it "fails without a lockfile and says that --deployment requires a lock" do - bundle "install --deployment", raise_on_error: false - expect(err).to include("The --deployment flag requires a lockfile") - end - - it "fails without a lockfile and says that --frozen requires a lock" do - bundle "install --frozen", raise_on_error: false - expect(err).to include("The --frozen flag requires a lockfile") - end - - it "disallows --deployment --system" do - bundle "install --deployment --system", raise_on_error: false - expect(err).to include("You have specified both --deployment") - expect(err).to include("Please choose only one option") - expect(exitstatus).to eq(15) - end - - it "disallows --deployment --path --system" do - bundle "install --deployment --path . --system", raise_on_error: false - expect(err).to include("You have specified both --path") - expect(err).to include("as well as --system") - expect(err).to include("Please choose only one option") - expect(exitstatus).to eq(15) - end - - it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do - bundle "install --deployment", raise_on_error: false - bundle :install - expect(the_bundle).to include_gems "myrack 1.0" - end - - it "installs gems by default to vendor/bundle" do - bundle :lock - bundle "install --deployment" - expect(out).to include("vendor/bundle") - end - - it "installs gems to custom path if specified" do - bundle :lock - bundle "install --path vendor/bundle2 --deployment" - expect(out).to include("vendor/bundle2") - end - - it "works with the --frozen flag" do - bundle :lock - bundle "install --frozen" - end - - it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do - bundle :lock - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "myrack-obama" - G - - bundle "install --deployment", raise_on_error: false - expect(err).to include("frozen mode") - expect(err).to include("You have added to the Gemfile") - expect(err).to include("* myrack-obama") - expect(err).not_to include("You have deleted from the Gemfile") - expect(err).not_to include("You have changed in the Gemfile") - end - end - it "fails without a lockfile and says that deployment requires a lock" do bundle "config deployment true" bundle "install", raise_on_error: false diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb index 52a34715780a04..32de3f2be2dcc3 100644 --- a/spec/bundler/install/gemfile/groups_spec.rb +++ b/spec/bundler/install/gemfile/groups_spec.rb @@ -113,13 +113,6 @@ expect(the_bundle).not_to include_gems "activesupport 2.3.5", groups: [:default] end - it "remembers previous exclusion with `--without`" do - bundle "install --without emo" - expect(the_bundle).not_to include_gems "activesupport 2.3.5" - bundle :install - expect(the_bundle).not_to include_gems "activesupport 2.3.5" - end - it "does not say it installed gems from the excluded group" do bundle "config set --local without emo" bundle :install @@ -159,20 +152,6 @@ ENV["BUNDLE_WITHOUT"] = nil end - it "clears --without when passed an empty list" do - bundle "install --without emo" - - bundle "install --without ''" - expect(the_bundle).to include_gems "activesupport 2.3.5" - end - - it "doesn't clear without when nothing is passed" do - bundle "install --without emo" - - bundle :install - expect(the_bundle).not_to include_gems "activesupport 2.3.5" - end - it "does not install gems from the optional group" do bundle :install expect(the_bundle).not_to include_gems "thin 1.0" @@ -184,13 +163,6 @@ expect(the_bundle).to include_gems "thin 1.0" end - it "installs gems from the previously requested group" do - bundle "install --with debugging" - expect(the_bundle).to include_gems "thin 1.0" - bundle :install - expect(the_bundle).to include_gems "thin 1.0" - end - it "installs gems from the optional groups requested with BUNDLE_WITH" do ENV["BUNDLE_WITH"] = "debugging" bundle :install @@ -198,30 +170,6 @@ ENV["BUNDLE_WITH"] = nil end - it "clears --with when passed an empty list" do - bundle "install --with debugging" - bundle "install --with ''" - expect(the_bundle).not_to include_gems "thin 1.0" - end - - it "removes groups from without when passed at --with" do - bundle "config set --local without emo" - bundle "install --with emo" - expect(the_bundle).to include_gems "activesupport 2.3.5" - end - - it "removes groups from with when passed at --without" do - bundle "config set --local with debugging" - bundle "install --without debugging", raise_on_error: false - expect(the_bundle).not_to include_gem "thin 1.0" - end - - it "errors out when passing a group to with and without via CLI flags" do - bundle "install --with emo debugging --without emo", raise_on_error: false - expect(last_command).to be_failure - expect(err).to include("The offending groups are: emo") - end - it "allows the BUNDLE_WITH setting to override BUNDLE_WITHOUT" do ENV["BUNDLE_WITH"] = "debugging" @@ -235,12 +183,6 @@ expect(the_bundle).to include_gem "thin 1.0" end - it "can add and remove a group at the same time" do - bundle "install --with debugging --without emo" - expect(the_bundle).to include_gems "thin 1.0" - expect(the_bundle).not_to include_gems "activesupport 2.3.5" - end - it "has no effect when listing a not optional group in with" do bundle "config set --local with emo" bundle :install @@ -365,7 +307,7 @@ end end - describe "when locked and installed with `without` option" do + describe "when locked and installed with `without` setting" do before(:each) do build_repo2 @@ -382,7 +324,7 @@ G end - it "uses the correct versions even if --without was used on the original" do + it "uses versions from excluded gems in a machine without the without configuration" do expect(the_bundle).to include_gems "myrack 0.9.1" expect(the_bundle).not_to include_gems "myrack_middleware 1.0" simulate_new_machine diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb index e5f7380855befd..3e4b18a188e8cc 100644 --- a/spec/bundler/install/gems/compact_index_spec.rb +++ b/spec/bundler/install/gems/compact_index_spec.rb @@ -529,40 +529,6 @@ def require(*args) expect(out).to include("Fetching gem metadata from #{source_uri}") end - it "installs the binstubs" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --binstubs", artifice: "compact_index" - - gembin "myrackup" - expect(out).to eq("1.0.0") - end - - it "installs the bins when using --path and uses autoclean" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --path vendor/bundle", artifice: "compact_index" - - expect(vendored_gems("bin/myrackup")).to exist - end - - it "installs the bins when using --path and uses bundle clean" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --path vendor/bundle --no-clean", artifice: "compact_index" - - expect(vendored_gems("bin/myrackup")).to exist - end - it "prints post_install_messages" do gemfile <<-G source "#{source_uri}" diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb index b7953b3d61c307..012e2d3995b4a2 100644 --- a/spec/bundler/install/gems/dependency_api_spec.rb +++ b/spec/bundler/install/gems/dependency_api_spec.rb @@ -471,40 +471,6 @@ def require(*args) expect(out).to include("Fetching gem metadata from #{source_uri}") end - it "installs the binstubs" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --binstubs", artifice: "endpoint" - - gembin "myrackup" - expect(out).to eq("1.0.0") - end - - it "installs the bins when using --path and uses autoclean" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --path vendor/bundle", artifice: "endpoint" - - expect(vendored_gems("bin/myrackup")).to exist - end - - it "installs the bins when using --path and uses bundle clean" do - gemfile <<-G - source "#{source_uri}" - gem "myrack" - G - - bundle "install --path vendor/bundle --no-clean", artifice: "endpoint" - - expect(vendored_gems("bin/myrackup")).to exist - end - it "prints post_install_messages" do gemfile <<-G source "#{source_uri}" diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb index d9c22254796c87..d5f6c896cd6642 100644 --- a/spec/bundler/install/gems/standalone_spec.rb +++ b/spec/bundler/install/gems/standalone_spec.rb @@ -464,53 +464,6 @@ include_examples "common functionality" end end - - describe "with --binstubs" do - before do - gemfile <<-G - source "https://gem.repo1" - gem "rails" - G - bundle "config set --local path #{bundled_app("bundle")}" - bundle :install, standalone: true, binstubs: true, dir: cwd - end - - let(:expected_gems) do - { - "actionpack" => "2.3.2", - "rails" => "2.3.2", - } - end - - include_examples "common functionality" - - it "creates stubs that use the standalone load path" do - expect(in_bundled_app("bin/rails -v").chomp).to eql "2.3.2" - end - - it "creates stubs that can be executed from anywhere" do - require "tmpdir" - sys_exec(%(#{bundled_app("bin/rails")} -v), dir: Dir.tmpdir) - expect(out).to eq("2.3.2") - end - - it "creates stubs that can be symlinked" do - skip "symlinks unsupported" if Gem.win_platform? - - symlink_dir = tmp("symlink") - FileUtils.mkdir_p(symlink_dir) - symlink = File.join(symlink_dir, "rails") - - File.symlink(bundled_app("bin/rails"), symlink) - sys_exec("#{symlink} -v") - expect(out).to eq("2.3.2") - end - - it "creates stubs with the correct load path" do - extension_line = File.read(bundled_app("bin/rails")).each_line.find {|line| line.include? "$:.unshift" }.strip - expect(extension_line).to eq %($:.unshift File.expand_path "../bundle", __dir__) - end - end end RSpec.describe "bundle install --standalone run in a subdirectory" do diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb index 0ede8df8ffcdf9..beea1e36dbc73d 100644 --- a/spec/bundler/install/path_spec.rb +++ b/spec/bundler/install/path_spec.rb @@ -44,21 +44,6 @@ expect(out).to include("gems are installed into `./vendor/bundle`") end - it "disallows --path vendor/bundle --system" do - bundle "install --path vendor/bundle --system", raise_on_error: false - expect(err).to include("Please choose only one option.") - expect(exitstatus).to eq(15) - end - - it "remembers to disable system gems after the first time with bundle --path vendor/bundle" do - bundle "install --path vendor/bundle" - FileUtils.rm_r bundled_app("vendor") - bundle "install" - - expect(vendored_gems("gems/myrack-1.0.0")).to be_directory - expect(the_bundle).to include_gems "myrack 1.0.0" - end - it "installs the bundle relatively to repository root, when Bundler run from the same directory" do bundle "config path vendor/bundle", dir: bundled_app.parent bundle "install --gemfile='#{bundled_app}/Gemfile'", dir: bundled_app.parent @@ -75,21 +60,12 @@ expect(the_bundle).to include_gems "myrack 1.0.0" end - it "installs the bundle relatively to Gemfile folder, when repository root can't be inferred from settings" do - bundle "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle", dir: bundled_app.parent - expect(out).to include("installed into `./bundled_app/vendor/bundle`") - expect(bundled_app("vendor/bundle")).to be_directory - expect(the_bundle).to include_gems "myrack 1.0.0" - end - it "installs the standalone bundle relative to the cwd" do bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app.parent expect(out).to include("installed into `./bundled_app/bundle`") expect(bundled_app("bundle")).to be_directory expect(bundled_app("bundle/ruby")).to be_directory - bundle "config unset path" - bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app("subdir").tap(&:mkpath) expect(out).to include("installed into `../bundle`") expect(bundled_app("bundle")).to be_directory diff --git a/spec/bundler/other/cli_man_pages_spec.rb b/spec/bundler/other/cli_man_pages_spec.rb index f6560106593cf5..4e8f155309fade 100644 --- a/spec/bundler/other/cli_man_pages_spec.rb +++ b/spec/bundler/other/cli_man_pages_spec.rb @@ -63,7 +63,11 @@ def check_option!(option, man_page) "* #{names.map {|name| "`#{name}#{value}`" }.join(", ")}:" end - expect(man_page_content).to include(help) + if option.banner.include?("(removed)") + expect(man_page_content).not_to include(help) + else + expect(man_page_content).to include(help) + end end def check_subcommand!(name, man_page) diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb index d36a9ee40c0db4..65fcd43c393dfa 100644 --- a/spec/bundler/other/major_deprecation_spec.rb +++ b/spec/bundler/other/major_deprecation_spec.rb @@ -14,81 +14,67 @@ describe ".clean_env" do before do source = "Bundler.clean_env" - bundle "exec ruby -e #{source.dump}" + bundle "exec ruby -e #{source.dump}", raise_on_error: false end - it "is deprecated in favor of .unbundled_env" do - expect(deprecations).to include \ - "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ - "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env` " \ - "(called at -e:1)" + it "is removed in favor of .unbundled_env and shows a helpful error message about it" do + expect(err).to include \ + "`Bundler.clean_env` has been removed in favor of `Bundler.unbundled_env`. " \ + "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`" \ end - - pending "is removed and shows a helpful error message about it", bundler: "4" end describe ".with_clean_env" do before do source = "Bundler.with_clean_env {}" - bundle "exec ruby -e #{source.dump}" + bundle "exec ruby -e #{source.dump}", raise_on_error: false end - it "is deprecated in favor of .unbundled_env" do - expect(deprecations).to include( - "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ - "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env` " \ - "(called at -e:1)" + it "is removed in favor of .unbundled_env and shows a helpful error message about it" do + expect(err).to include( + "`Bundler.with_clean_env` has been removed in favor of `Bundler.with_unbundled_env`. " \ + "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`" ) end - - pending "is removed and shows a helpful error message about it", bundler: "4" end describe ".clean_system" do before do source = "Bundler.clean_system('ls')" - bundle "exec ruby -e #{source.dump}" + bundle "exec ruby -e #{source.dump}", raise_on_error: false end - it "is deprecated in favor of .unbundled_system" do - expect(deprecations).to include( - "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \ - "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system` " \ - "(called at -e:1)" + it "is removed in favor of .unbundled_system and shows a helpful error message about it" do + expect(err).to include( + "`Bundler.clean_system` has been removed in favor of `Bundler.unbundled_system`. " \ + "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`" \ ) end - - pending "is removed and shows a helpful error message about it", bundler: "4" end describe ".clean_exec" do before do source = "Bundler.clean_exec('ls')" - bundle "exec ruby -e #{source.dump}" + bundle "exec ruby -e #{source.dump}", raise_on_error: false end - it "is deprecated in favor of .unbundled_exec" do - expect(deprecations).to include( - "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \ - "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec` " \ - "(called at -e:1)" + it "is removed in favor of .unbundled_exec and shows a helpful error message about it" do + expect(err).to include( + "`Bundler.clean_exec` has been removed in favor of `Bundler.unbundled_exec`. " \ + "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`" \ ) end - - pending "is removed and shows a helpful error message about it", bundler: "4" end describe ".environment" do before do source = "Bundler.environment" - bundle "exec ruby -e #{source.dump}" + bundle "exec ruby -e #{source.dump}", raise_on_error: false end - it "is deprecated in favor of .load" do - expect(deprecations).to include "Bundler.environment has been removed in favor of Bundler.load (called at -e:1)" + it "is removed in favor of .load and shows a helpful error message about it" do + expect(err).to include "Bundler.environment has been removed in favor of Bundler.load" end - - pending "is removed and shows a helpful error message about it", bundler: "4" end end @@ -121,16 +107,14 @@ bundle "check --path vendor/bundle", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--path` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "path 'vendor/bundle'`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--path` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set path 'vendor/bundle'`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle check --path=" do @@ -143,16 +127,14 @@ bundle "check --path=vendor/bundle", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--path` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "path 'vendor/bundle'`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--path` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set path 'vendor/bundle'`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle binstubs --path=" do @@ -165,16 +147,14 @@ bundle "binstubs myrack --path=binpath", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--path` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "bin 'binpath'`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--path` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set bin 'binpath'`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --all" do @@ -184,19 +164,17 @@ gem "myrack" G - bundle "cache --all", raise_on_error: false + bundle "cache --all --verbose", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--all` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "cache_all true`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--all` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set cache_all true`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --no-all" do @@ -209,16 +187,14 @@ bundle "cache --no-all", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--no-all` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "cache_all false`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--no-all` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set cache_all false`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --path" do @@ -231,16 +207,14 @@ bundle "cache --path foo", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--path` flag is deprecated because its semantics are unclear. " \ + it "should print a removal error" do + expect(err).to include( + "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, " \ "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --path=" do @@ -254,15 +228,13 @@ end it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--path` flag is deprecated because its semantics are unclear. " \ + expect(err).to include( + "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, " \ "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --frozen" do @@ -275,16 +247,14 @@ bundle "cache --frozen", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--frozen` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "frozen true`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--frozen` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set frozen true`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end context "bundle cache --no-prune" do @@ -297,16 +267,14 @@ bundle "cache --no-prune", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `--no-prune` flag is deprecated because it relies on being " \ - "remembered across bundler invocations, which bundler will no " \ - "longer do in future versions. Instead please use `bundle config set " \ - "no_prune true`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `--no-prune` flag has been removed because it relied on being " \ + "remembered across bundler invocations, which bundler no longer " \ + "does. Instead please use `bundle config set no_prune true`, " \ + "and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end describe "bundle config" do @@ -493,23 +461,23 @@ }.each do |name, expectations| option_name, value = *expectations flag_name = "--#{name}" + args = %w[true false].include?(value) ? flag_name : "#{flag_name} #{value}" context "with the #{flag_name} flag" do before do bundle "install" # to create a lockfile, which deployment or frozen need - bundle "install #{flag_name} #{value}" + + bundle "install #{args}", raise_on_error: false end - it "should print a deprecation warning" do - expect(deprecations).to include( - "The `#{flag_name}` flag is deprecated because it relies on " \ - "being remembered across bundler invocations, which bundler " \ - "will no longer do in future versions. Instead please use " \ - "`bundle config set #{option_name} #{value}`, and stop using this flag" + it "fails with a helpful error" do + expect(err).to include( + "The `#{flag_name}` flag has been removed because it relied on " \ + "being remembered across bundler invocations, which bundler no " \ + "longer does. Instead please use `bundle config set " \ + "#{option_name} #{value}`, and stop using this flag" ) end - - pending "fails with a helpful error", bundler: "4" end end end @@ -629,19 +597,41 @@ context "when `bundler/deployment` is required in a ruby script" do before do - ruby <<-RUBY + ruby <<-RUBY, raise_on_error: false require 'bundler/deployment' RUBY end it "should print a capistrano deprecation warning" do - expect(deprecations).to include("Bundler no longer integrates " \ + expect(err).to include("Bundler no longer integrates " \ "with Capistrano, but Capistrano provides " \ "its own integration with Bundler via the " \ "capistrano-bundler gem. Use it instead.") end + end - pending "fails with a helpful error", bundler: "4" + context "when `bundler/capistrano` is required in a ruby script" do + before do + ruby <<-RUBY, raise_on_error: false + require 'bundler/capistrano' + RUBY + end + + it "fails with a helpful error" do + expect(err).to include("[REMOVED] The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler") + end + end + + context "when `bundler/vlad` is required in a ruby script" do + before do + ruby <<-RUBY, raise_on_error: false + require 'bundler/vlad' + RUBY + end + + it "fails with a helpful error" do + expect(err).to include("[REMOVED] The Bundler task for Vlad") + end end context "bundle show" do diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb index 3e5a960a960f2e..34e6c26272346d 100644 --- a/spec/bundler/quality_spec.rb +++ b/spec/bundler/quality_spec.rb @@ -136,7 +136,6 @@ def check_for_specific_pronouns(filename) it "documents all used settings" do exemptions = %w[ - forget_cli_options gem.changelog gem.ci gem.coc diff --git a/spec/bundler/runtime/env_helpers_spec.rb b/spec/bundler/runtime/env_helpers_spec.rb index 42605b6ea00073..c4ebdd1fd28998 100644 --- a/spec/bundler/runtime/env_helpers_spec.rb +++ b/spec/bundler/runtime/env_helpers_spec.rb @@ -71,10 +71,10 @@ def run_bundler_script(env, script) end end - shared_examples_for "an unbundling helper" do + describe "Bundler.unbundled_env" do it "should delete BUNDLE_PATH" do create_file("source.rb", <<-RUBY) - print #{modified_env}.has_key?('BUNDLE_PATH') + print Bundler.unbundled_env.has_key?('BUNDLE_PATH') RUBY ENV["BUNDLE_PATH"] = "./foo" bundle_exec_ruby bundled_app("source.rb") @@ -83,7 +83,7 @@ def run_bundler_script(env, script) it "should remove absolute path to 'bundler/setup' from RUBYOPT even if it was present in original env" do create_file("source.rb", <<-RUBY) - print #{modified_env}['RUBYOPT'] + print Bundler.unbundled_env['RUBYOPT'] RUBY setup_require = "-r#{lib_dir}/bundler/setup" ENV["BUNDLER_ORIG_RUBYOPT"] = "-W2 #{setup_require} #{ENV["RUBYOPT"]}" @@ -93,7 +93,7 @@ def run_bundler_script(env, script) it "should remove relative path to 'bundler/setup' from RUBYOPT even if it was present in original env" do create_file("source.rb", <<-RUBY) - print #{modified_env}['RUBYOPT'] + print Bundler.unbundled_env['RUBYOPT'] RUBY ENV["BUNDLER_ORIG_RUBYOPT"] = "-W2 -rbundler/setup #{ENV["RUBYOPT"]}" bundle_exec_ruby bundled_app("source.rb") @@ -102,7 +102,7 @@ def run_bundler_script(env, script) it "should delete BUNDLER_SETUP even if it was present in original env" do create_file("source.rb", <<-RUBY) - print #{modified_env}.has_key?('BUNDLER_SETUP') + print Bundler.unbundled_env.has_key?('BUNDLER_SETUP') RUBY ENV["BUNDLER_ORIG_BUNDLER_SETUP"] = system_gem_path("gems/bundler-#{Bundler::VERSION}/lib/bundler/setup").to_s bundle_exec_ruby bundled_app("source.rb") @@ -111,7 +111,7 @@ def run_bundler_script(env, script) it "should restore RUBYLIB", :ruby_repo do create_file("source.rb", <<-RUBY) - print #{modified_env}['RUBYLIB'] + print Bundler.unbundled_env['RUBYLIB'] RUBY ENV["RUBYLIB"] = lib_dir.to_s + File::PATH_SEPARATOR + "/foo" ENV["BUNDLER_ORIG_RUBYLIB"] = lib_dir.to_s + File::PATH_SEPARATOR + "/foo-original" @@ -121,7 +121,7 @@ def run_bundler_script(env, script) it "should restore the original MANPATH" do create_file("source.rb", <<-RUBY) - print #{modified_env}['MANPATH'] + print Bundler.unbundled_env['MANPATH'] RUBY ENV["MANPATH"] = "/foo" ENV["BUNDLER_ORIG_MANPATH"] = "/foo-original" @@ -130,18 +130,6 @@ def run_bundler_script(env, script) end end - describe "Bundler.unbundled_env" do - let(:modified_env) { "Bundler.unbundled_env" } - - it_behaves_like "an unbundling helper" - end - - describe "Bundler.clean_env" do - let(:modified_env) { "Bundler.clean_env" } - - it_behaves_like "an unbundling helper" - end - describe "Bundler.with_original_env" do it "should set ENV to original_env in the block" do expected = Bundler.original_env @@ -158,26 +146,6 @@ def run_bundler_script(env, script) end end - describe "Bundler.with_clean_env" do - it "should set ENV to unbundled_env in the block" do - expected = Bundler.unbundled_env - - actual = Bundler.ui.silence do - Bundler.with_clean_env { ENV.to_hash } - end - - expect(actual).to eq(expected) - end - - it "should restore the environment after execution" do - Bundler.ui.silence do - Bundler.with_clean_env { ENV["FOO"] = "hello" } - end - - expect(ENV).not_to have_key("FOO") - end - end - describe "Bundler.with_unbundled_env" do it "should set ENV to unbundled_env in the block" do expected = Bundler.unbundled_env @@ -209,21 +177,6 @@ def run_bundler_script(env, script) end end - describe "Bundler.clean_system" do - before do - create_file("source.rb", <<-'RUBY') - Bundler.ui.silence { Bundler.clean_system("ruby", "-e", "exit(42) unless ENV['BUNDLE_FOO'] == 'bar'") } - - exit $?.exitstatus - RUBY - end - - it "runs system inside with_clean_env" do - run_bundler_script({ "BUNDLE_FOO" => "bar" }, bundled_app("source.rb")) - expect($?.exitstatus).to eq(42) - end - end - describe "Bundler.unbundled_system" do before do create_file("source.rb", <<-'RUBY') @@ -260,27 +213,6 @@ def run_bundler_script(env, script) end end - describe "Bundler.clean_exec" do - before do - create_file("source.rb", <<-'RUBY') - Process.fork do - exit Bundler.ui.silence { Bundler.clean_exec(%(test "\$BUNDLE_FOO" = "bar")) } - end - - _, status = Process.wait2 - - exit(status.exitstatus) - RUBY - end - - it "runs exec inside with_clean_env" do - skip "Fork not implemented" if Gem.win_platform? - - run_bundler_script({ "BUNDLE_FOO" => "bar" }, bundled_app("source.rb")) - expect($?.exitstatus).to eq(1) - end - end - describe "Bundler.unbundled_exec" do before do create_file("source.rb", <<-'RUBY') @@ -294,7 +226,7 @@ def run_bundler_script(env, script) RUBY end - it "runs exec inside with_clean_env" do + it "runs exec inside with_unbundled_env" do skip "Fork not implemented" if Gem.win_platform? run_bundler_script({ "BUNDLE_FOO" => "bar" }, bundled_app("source.rb")) diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb index 7cab24218f869a..86cd1d00395629 100644 --- a/spec/bundler/runtime/executable_spec.rb +++ b/spec/bundler/runtime/executable_spec.rb @@ -19,8 +19,9 @@ expect(out).to eq("1.0.0") end - it "allows the location of the gem stubs to be specified" do - bundle "binstubs myrack", path: "gbin" + it "allows the location of the gem stubs to be configured" do + bundle "config bin gbin" + bundle "binstubs myrack" expect(bundled_app("bin")).not_to exist expect(bundled_app("gbin/myrackup")).to exist @@ -30,7 +31,8 @@ end it "allows absolute paths as a specification of where to install bin stubs" do - bundle "binstubs myrack", path: tmp("bin") + bundle "config bin #{tmp("bin")}" + bundle "binstubs myrack" gembin tmp("bin/myrackup") expect(out).to eq("1.0.0") @@ -96,38 +98,6 @@ expect(bundled_app("bin/myrackup")).not_to exist end - it "allows you to stop installing binstubs" do - skip "delete permission error" if Gem.win_platform? - - bundle "install --binstubs bin/" - bundled_app("bin/myrackup").rmtree - bundle "install --binstubs \"\"" - - expect(bundled_app("bin/myrackup")).not_to exist - - bundle "config bin" - expect(out).to include("You have not configured a value for `bin`") - end - - it "remembers that the option was specified" do - gemfile <<-G - source "https://gem.repo1" - gem "activesupport" - G - - bundle :install, binstubs: "bin" - - gemfile <<-G - source "https://gem.repo1" - gem "activesupport" - gem "myrack" - G - - bundle "install" - - expect(bundled_app("bin/myrackup")).to exist - end - it "rewrites bins on binstubs with --force option" do install_gemfile <<-G source "https://gem.repo1" diff --git a/test/json/json_encoding_test.rb b/test/json/json_encoding_test.rb index 873e96fddddd84..caf335d521f994 100644 --- a/test/json/json_encoding_test.rb +++ b/test/json/json_encoding_test.rb @@ -145,19 +145,11 @@ def test_very_large_json_strings end def test_invalid_utf8_sequences - # Create strings with invalid UTF-8 sequences invalid_utf8 = "\xFF\xFF" - - # Test that generating JSON with invalid UTF-8 raises an error - # Different JSON implementations may handle this differently, - # so we'll check if any exception is raised - begin + error = assert_raise(JSON::GeneratorError) do generate(invalid_utf8) - raise "Expected an exception when generating JSON with invalid UTF8" - rescue StandardError => e - assert true - assert_match(%r{source sequence is illegal/malformed utf-8}, e.message) end + assert_match(%r{source sequence is illegal/malformed utf-8}, error.message) end def test_surrogate_pair_handling diff --git a/test/json/json_generic_object_test.rb b/test/json/json_generic_object_test.rb index 471534192e94ab..995d57edafe2dd 100644 --- a/test/json/json_generic_object_test.rb +++ b/test/json/json_generic_object_test.rb @@ -4,11 +4,13 @@ class JSONGenericObjectTest < Test::Unit::TestCase def setup - if defined?(GenericObject) + if defined?(JSON::GenericObject) @go = JSON::GenericObject[ :a => 1, :b => 2 ] else omit("JSON::GenericObject is not available") end + rescue NameError + omit("JSON::GenericObject is not available") end def test_attributes @@ -40,10 +42,10 @@ def test_parse_json ) assert_equal 1, l.a assert_equal @go, - l = JSON('{ "a": 1, "b": 2 }', :object_class => GenericObject) + l = JSON('{ "a": 1, "b": 2 }', :object_class => JSON::GenericObject) assert_equal 1, l.a - assert_equal GenericObject[:a => GenericObject[:b => 2]], - l = JSON('{ "a": { "b": 2 } }', :object_class => GenericObject) + assert_equal JSON::GenericObject[:a => JSON::GenericObject[:b => 2]], + l = JSON('{ "a": { "b": 2 } }', :object_class => JSON::GenericObject) assert_equal 2, l.a.b end end @@ -51,12 +53,12 @@ def test_parse_json def test_from_hash result = JSON::GenericObject.from_hash( :foo => { :bar => { :baz => true }, :quux => [ { :foobar => true } ] }) - assert_kind_of GenericObject, result.foo - assert_kind_of GenericObject, result.foo.bar + assert_kind_of JSON::GenericObject, result.foo + assert_kind_of JSON::GenericObject, result.foo.bar assert_equal true, result.foo.bar.baz - assert_kind_of GenericObject, result.foo.quux.first + assert_kind_of JSON::GenericObject, result.foo.quux.first assert_equal true, result.foo.quux.first.foobar - assert_equal true, GenericObject.from_hash(true) + assert_equal true, JSON::GenericObject.from_hash(true) end def test_json_generic_object_load diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb index 3c60fec8753ea5..a9b0624f6bab58 100644 --- a/test/json/json_parser_test.rb +++ b/test/json/json_parser_test.rb @@ -347,7 +347,7 @@ def test_parse_duplicate_key assert_equal expected_sym, parse('{"a": 1, "a": 2}', symbolize_names: true) end - if RUBY_ENGINE == 'RUBY_ENGINE' + if RUBY_ENGINE == 'ruby' assert_deprecated_warning(/#{File.basename(__FILE__)}\:#{__LINE__ + 1}/) do assert_equal expected, parse('{"a": 1, "a": 2}') end @@ -397,10 +397,8 @@ def test_freeze assert_predicate parse('[]', :freeze => true), :frozen? assert_predicate parse('"foo"', :freeze => true), :frozen? - if string_deduplication_available? - assert_same(-'foo', parse('"foo"', :freeze => true)) - assert_same(-'foo', parse('{"foo": 1}', :freeze => true).keys.first) - end + assert_same(-'foo', parse('"foo"', :freeze => true)) + assert_same(-'foo', parse('{"foo": 1}', :freeze => true).keys.first) end def test_parse_comments @@ -637,6 +635,7 @@ def test_parse_array_custom_array_derived_class def test_parse_array_custom_non_array_derived_class res = parse('[1,2]', :array_class => SubArrayWrapper) assert_equal([1,2], res.data) + assert_equal(1, res[0]) assert_equal(SubArrayWrapper, res.class) assert res.shifted? end @@ -698,6 +697,7 @@ def item_set? def test_parse_object_custom_non_hash_derived_class res = parse('{"foo":"bar"}', :object_class => SubOpenStruct) assert_equal "bar", res.foo + assert_equal "bar", res[:foo] assert_equal(SubOpenStruct, res.class) assert res.item_set? end @@ -794,16 +794,6 @@ def test_parse_leading_slash private - def string_deduplication_available? - r1 = rand.to_s - r2 = r1.dup - begin - (-r1).equal?(-r2) - rescue NoMethodError - false # No String#-@ - end - end - def assert_equal_float(expected, actual, delta = 1e-2) Array === expected and expected = expected.first Array === actual and actual = actual.first diff --git a/test/json/test_helper.rb b/test/json/test_helper.rb index d849e28b9b862b..cf592debfd8c43 100644 --- a/test/json/test_helper.rb +++ b/test/json/test_helper.rb @@ -1,5 +1,13 @@ $LOAD_PATH.unshift(File.expand_path('../../../ext', __FILE__), File.expand_path('../../../lib', __FILE__)) +begin + require 'simplecov' +rescue LoadError + # Don't fail Ruby's test suite +else + SimpleCov.start +end + require 'json' require 'test/unit' diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb index 50a2270e3d246e..f980e7d63bd0c9 100644 --- a/test/rubygems/test_gem_command_manager.rb +++ b/test/rubygems/test_gem_command_manager.rb @@ -72,7 +72,6 @@ def test_find_command_unknown end def test_find_command_unknown_suggestions - omit "randomly fails on ruby/ruby CI" if ENV["GITHUB_REPOSITORY"] == "ruby/ruby" e = assert_raise Gem::UnknownCommandError do @command_manager.find_command "pish" end