Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b4334f8
[rubygems/rubygems] Completely remove `Bundle.*clean*` and `Bundler.e…
deivid-rodriguez Sep 9, 2025
4eb13c6
[rubygems/rubygems] Remove implementation of `deployment`, `capistran…
deivid-rodriguez Sep 9, 2025
ce19fb5
[rubygems/rubygems] Add missing part in `bundle cache --path` removal…
deivid-rodriguez Sep 9, 2025
3486f4d
[rubygems/rubygems] Fix grammar in remembered options removal message
deivid-rodriguez Sep 9, 2025
c218c66
[rubygems/rubygems] Remove deprecated usages of `bundle install --dep…
deivid-rodriguez Sep 9, 2025
881b585
[rubygems/rubygems] Introduce a way to ensure that removed flags get …
deivid-rodriguez Sep 9, 2025
ecd1284
[rubygems/rubygems] Complete remembered options removal
deivid-rodriguez Sep 9, 2025
4febdbc
[rubygems/rubygems] Remove spec originally meant to test remembering …
deivid-rodriguez Sep 9, 2025
d0c7f9a
[rubygems/rubygems] Added document for Gem::Uninstaller
hsbt Sep 10, 2025
bfd1b30
[ruby/json] Enable test coverage when simplecov is available
etiennebarrie Sep 8, 2025
30da3b5
[ruby/json] Don't call json_create if json_creatable? returns false
etiennebarrie Sep 8, 2025
fa5bebb
[ruby/json] Fix JSON::GenericObject tests
etiennebarrie Sep 8, 2025
3097a7b
[ruby/json] Fix deprecation warning backtrace
etiennebarrie Sep 8, 2025
b19b4b7
[ruby/json] Change invalid encoding test to use assert_raise
etiennebarrie Sep 8, 2025
0438b77
[ruby/json] Stop checking for String#@-
etiennebarrie Sep 8, 2025
72888b7
[ruby/json] Stop checking for OpenStruct#[] and #[]=
etiennebarrie Sep 8, 2025
e4a9394
[ruby/json] Improve test coverage
etiennebarrie Sep 8, 2025
5e7e6c5
Revert "test_gem_command_manager.rb.
hsbt Sep 11, 2025
0dc1cd4
Handle `uninitialized constant JSON::GenericObject` at ruby/ruby.
hsbt Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/json/lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions ext/json/lib/json/generic_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 5 additions & 26 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
20 changes: 1 addition & 19 deletions lib/bundler/capistrano.rb
Original file line number Diff line number Diff line change
@@ -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"
53 changes: 22 additions & 31 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -211,26 +211,26 @@ 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"
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
method_option "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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 1 addition & 11 deletions lib/bundler/cli/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Loading