Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6a93a28
[rubygems/rubygems] Ensure removed commands get their docs removed, too
deivid-rodriguez Aug 12, 2025
9763e2d
[rubygems/rubygems] The `bundle clean` command should not be hidden
deivid-rodriguez Aug 12, 2025
2e65f4a
[rubygems/rubygems] No need to print caller location when raising dir…
deivid-rodriguez Aug 13, 2025
cc1770b
[rubygems/rubygems] Introduce `SharedHelpers.feature_removed!`
deivid-rodriguez Aug 13, 2025
834b941
Completely remove `bundle inject` command
deivid-rodriguez Aug 5, 2025
3b6c82c
Completely remove `bundle viz` command
deivid-rodriguez Aug 5, 2025
50d4622
[rubygems/rubygems] Fix `bundle lock` regression when using `update` …
Edouard-chin Aug 13, 2025
b4c9cce
[rubygems/rubygems] Remove unnecessary subject from one spec
deivid-rodriguez Aug 13, 2025
6f8738d
[rubygems/rubygems] Remove unnecessary install
deivid-rodriguez Aug 13, 2025
2052dd1
[rubygems/rubygems] It's not necessary to set `deployment`
deivid-rodriguez Aug 13, 2025
7488b48
[rubygems/rubygems] Improve spec wording and implementation
deivid-rodriguez Aug 27, 2025
2558350
[rubygems/rubygems] Fix `bundle cache` failing in frozen mode if vend…
deivid-rodriguez Aug 13, 2025
c75de0d
[rubygems/rubygems] Add extra spec for another issue that the previou…
deivid-rodriguez Aug 14, 2025
1c7c010
[rubygems/rubygems] Add another spec for yet another issue fixed by t…
deivid-rodriguez Aug 27, 2025
d20936c
[rubygems/rubygems] Improve `deprecations` helper
deivid-rodriguez Jul 15, 2025
2d3fd1f
[rubygems/rubygems] Deprecate `bundle cache --frozen` and `bundle cac…
deivid-rodriguez Aug 14, 2025
cbd0de8
[rubygems/rubygems] Improve source list management testing
deivid-rodriguez Aug 6, 2025
0775c23
[rubygems/rubygems] Let `gem sources` be more clear about which sourc…
deivid-rodriguez Aug 6, 2025
92df7e4
[rubygems/rubygems] Add missing `gem sources --remove` test
deivid-rodriguez Aug 6, 2025
e89eb0b
[rubygems/rubygems] Simplify test for trailing slash handling when ad…
deivid-rodriguez Aug 6, 2025
566cd15
[rubygems/rubygems] Refactor duplicated test logic
deivid-rodriguez Aug 6, 2025
6dcd100
[rubygems/rubygems] Change trailing slash test to not work on default…
deivid-rodriguez Aug 6, 2025
4a6fa17
[rubygems/rubygems] Fix trailing slashes not considered when removing…
deivid-rodriguez Aug 6, 2025
358735b
[rubygems/rubygems] Change more source tests to act on configured sou…
deivid-rodriguez Aug 6, 2025
30b344c
[rubygems/rubygems] Change code examples to not use the default source
deivid-rodriguez Aug 6, 2025
cdb8c9e
[rubygems/rubygems] Improve error output when removing a source throu…
deivid-rodriguez Sep 1, 2025
cc2a70d
[rubygems/rubygems] Warn when trying to remove a default source that'…
deivid-rodriguez Sep 1, 2025
c1a46fe
[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1…
dependabot[bot] Sep 2, 2025
aae9e82
Added x64-mswin64-140 to lockfiles
hsbt Aug 29, 2025
94ddf47
[ruby/strscan] [DOC] Fix link
BurdetteLamar Aug 26, 2025
794e4a3
[ruby/json] Fix a -Wreturn-type warning
byroot Aug 27, 2025
3b38ab9
[ruby/json] Ensure the SWAR encoder in the java extension checks ever…
samyron Aug 15, 2025
242680e
[ruby/json] Added testing for JSON.unsafe_load. Fixes NoMethodError
robinetmiller Sep 2, 2025
9af5af2
[ruby/json] Update method docs for JSON.load and JSON.unsafe_load to …
robinetmiller Sep 2, 2025
837d741
Use Time.new because JSON.unsafe_load losts fractions of a second and
hsbt Sep 3, 2025
45e1839
ZJIT: Handle `opt_case_dispatch` insn (#14433)
st0012 Sep 3, 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
2 changes: 1 addition & 1 deletion doc/strscan/strscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Some examples here assume that certain helper methods are defined:
- `match_values_cleared?(scanner)`:
Returns whether the scanner's [match values][9] are cleared.

See examples [here][ext/strscan/helper_methods_md.html].
See examples at [helper methods](doc/strscan/helper_methods.md).

## The `StringScanner` \Object

Expand Down
2 changes: 1 addition & 1 deletion ext/json/generator/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ static VALUE cState_allow_duplicate_key_p(VALUE self)
return Qtrue;
case JSON_DEPRECATED:
return Qnil;
case JSON_RAISE:
default:
return Qfalse;
}
}
Expand Down
12 changes: 9 additions & 3 deletions ext/json/lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ def pretty_generate(obj, opts = nil)
# when Array
# obj.map! {|v| deserialize_obj v }
# end
# obj
# })
# pp ruby
# Output:
Expand Down Expand Up @@ -703,9 +704,13 @@ def unsafe_load(source, proc = nil, options = nil)
if opts[:allow_blank] && (source.nil? || source.empty?)
source = 'null'
end
result = parse(source, opts)
recurse_proc(result, &proc) if proc
result

if proc
opts = opts.dup
opts[:on_load] = proc.to_proc
end

parse(source, opts)
end

# :call-seq:
Expand Down Expand Up @@ -822,6 +827,7 @@ def unsafe_load(source, proc = nil, options = nil)
# when Array
# obj.map! {|v| deserialize_obj v }
# end
# obj
# })
# pp ruby
# Output:
Expand Down
1 change: 0 additions & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module Bundler
autoload :FREEBSD, File.expand_path("bundler/constants", __dir__)
autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
autoload :Graph, File.expand_path("bundler/graph", __dir__)
autoload :Index, File.expand_path("bundler/index", __dir__)
autoload :Injector, File.expand_path("bundler/injector", __dir__)
autoload :Installer, File.expand_path("bundler/installer", __dir__)
Expand Down
34 changes: 10 additions & 24 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ def cache
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")

%w[frozen no-prune].each do |option|
remembered_flag_deprecation(option)
end

if flag_passed?("--path")
message =
"The `--path` flag is deprecated because its semantics are unclear. " \
Expand Down Expand Up @@ -513,23 +517,9 @@ def licenses
end
end

unless Bundler.feature_flag.bundler_4_mode?
desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
long_desc <<-D
Viz generates a PNG file of the current Gemfile as a dependency graph.
Viz requires the ruby-graphviz gem (and its dependencies).
The associated gems must also be installed via 'bundle install'.
D
method_option :file, type: :string, default: "gem_graph", aliases: "-f", banner: "The name to use for the generated file. see format option"
method_option :format, type: :string, default: "png", aliases: "-F", banner: "This is output format option. Supported format is png, jpg, svg, dot ..."
method_option :requirements, type: :boolean, default: false, aliases: "-R", banner: "Set to show the version of each required dependency."
method_option :version, type: :boolean, default: false, aliases: "-v", banner: "Set to show each gem version."
method_option :without, type: :array, default: [], aliases: "-W", banner: "Exclude gems that are part of the specified named group."
def viz
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
require_relative "cli/viz"
Viz.new(options.dup).run
end
desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
def viz
SharedHelpers.feature_removed! "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
end

desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
Expand Down Expand Up @@ -559,7 +549,7 @@ def self.source_root
File.expand_path("templates", __dir__)
end

desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", hide: true
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
method_option "dry-run", type: :boolean, default: false, banner: "Only print out changes, do not clean gems"
method_option "force", type: :boolean, default: false, banner: "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application."
def clean
Expand All @@ -575,12 +565,8 @@ def platform
end

desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
method_option "source", type: :string, banner: "Install gem from the given source"
method_option "group", type: :string, banner: "Install gem into a bundler group"
def inject(name, version)
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
require_relative "cli/inject"
Inject.new(options.dup, name, version).run
def inject(*)
SharedHelpers.feature_removed! "The `inject` command has been replaced by the `add` command"
end

desc "lock", "Creates a lockfile without installing"
Expand Down
60 changes: 0 additions & 60 deletions lib/bundler/cli/inject.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/bundler/cli/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def run
"before deploying."
end

options[:local] = true if Bundler.app_cache.exist?

Bundler.settings.set_command_option :deployment, true if options[:deployment]
Bundler.settings.set_command_option :frozen, true if options[:frozen]
end
Expand Down
10 changes: 5 additions & 5 deletions lib/bundler/cli/lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ def run
update = { bundler: bundler }
end

file = options[:lockfile]
file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile

Bundler.settings.temporary(frozen: false) do
definition = Bundler.definition(update, file)
definition = Bundler.definition(update, Bundler.default_lockfile)
definition.add_checksums if options["add-checksums"]

Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
Expand Down Expand Up @@ -71,8 +68,11 @@ def run
if print
puts definition.to_lock
else
file = options[:lockfile]
file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile

puts "Writing lockfile to #{file}"
definition.lock
definition.write_lock(file, false)
end
end

Expand Down
31 changes: 0 additions & 31 deletions lib/bundler/cli/viz.rb

This file was deleted.

82 changes: 42 additions & 40 deletions lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ def check!
def setup_domain!(options = {})
prefer_local! if options[:"prefer-local"]

sources.cached!

if options[:add_checksums] || (!options[:local] && install_needed?)
remotely!
sources.remote!
true
else
Bundler.settings.set_command_option(:jobs, 1) unless install_needed? # to avoid the overhead of Bundler::Worker
with_cache!
sources.local!
false
end
end
Expand Down Expand Up @@ -373,6 +375,44 @@ def lock(file_or_preserve_unknown_sections = false, preserve_unknown_sections_or
write_lock(target_lockfile, preserve_unknown_sections)
end

def write_lock(file, preserve_unknown_sections)
return if Definition.no_lock || file.nil?

contents = to_lock

# Convert to \r\n if the existing lock has them
# i.e., Windows with `git config core.autocrlf=true`
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")

if @locked_bundler_version
locked_major = @locked_bundler_version.segments.first
current_major = bundler_version_to_lock.segments.first

updating_major = locked_major < current_major
end

preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))

if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
return if Bundler.frozen_bundle?
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
return
end

if Bundler.frozen_bundle?
Bundler.ui.error "Cannot write a changed lockfile while frozen."
return
end

begin
SharedHelpers.filesystem_access(file) do |p|
File.open(p, "wb") {|f| f.puts(contents) }
end
rescue ReadOnlyFileSystemError
raise ProductionError, lockfile_changes_summary("file system is read-only")
end
end

def locked_ruby_version
return unless ruby_version
if @unlocking_ruby || !@locked_ruby_version
Expand Down Expand Up @@ -574,44 +614,6 @@ def lockfile_exists?
lockfile && File.exist?(lockfile)
end

def write_lock(file, preserve_unknown_sections)
return if Definition.no_lock || file.nil?

contents = to_lock

# Convert to \r\n if the existing lock has them
# i.e., Windows with `git config core.autocrlf=true`
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")

if @locked_bundler_version
locked_major = @locked_bundler_version.segments.first
current_major = bundler_version_to_lock.segments.first

updating_major = locked_major < current_major
end

preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))

if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
return if Bundler.frozen_bundle?
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
return
end

if Bundler.frozen_bundle?
Bundler.ui.error "Cannot write a changed lockfile while frozen."
return
end

begin
SharedHelpers.filesystem_access(file) do |p|
File.open(p, "wb") {|f| f.puts(contents) }
end
rescue ReadOnlyFileSystemError
raise ProductionError, lockfile_changes_summary("file system is read-only")
end
end

def resolver
@resolver ||= new_resolver(resolution_base)
end
Expand Down
1 change: 1 addition & 0 deletions lib/bundler/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SolveFailure < BundlerError; status_code(6); end

class GemNotFound < BundlerError; status_code(7); end
class InstallHookError < BundlerError; status_code(8); end
class RemovedError < BundlerError; status_code(9); end
class GemfileNotFound < BundlerError; status_code(10); end
class GitError < BundlerError; status_code(11); end
class DeprecatedError < BundlerError; status_code(12); end
Expand Down
Loading