Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
449cc25
Use `File` instead of `IO`, for read/write singleton methods
nobu Aug 1, 2025
ddbfe35
Use autogen.sh if exists
nobu Aug 1, 2025
3c1244a
Define targets for packages also in common.mk
nobu Aug 1, 2025
75a968d
Add the recipe to fix/update depend files
nobu Aug 1, 2025
6e10267
[rubygems/rubygems] Removed to workaround for Bundler 2.2.
hsbt Aug 6, 2025
d4bf58b
[rubygems/rubygems] Don't worry about missing Makefile.
ioquatix Jul 27, 2025
3c669e2
[rubygems/rubygems] Remove unnecessary rubygems filters
deivid-rodriguez Aug 8, 2025
a6aa8e6
[rubygems/rubygems] Fix spec no longer run since rubygems timeout was…
deivid-rodriguez Aug 8, 2025
2e98328
[rubygems/rubygems] Use a rubygems filter for the timeout spec
deivid-rodriguez Aug 8, 2025
f074f82
[rubygems/rubygems] Fix `bundle cache --no-all` not printing a deprec…
deivid-rodriguez Aug 8, 2025
8d5f00c
[rubygems/rubygems] Fix Bundler printing more flags than actually pas…
deivid-rodriguez Aug 8, 2025
8136039
[rubygems/rubygems] Introduce `bundle list --format=json`
schneems May 29, 2025
bcc287f
[rubygems/rubygems] Fix `bundle update foo` not upgrading foo to late…
deivid-rodriguez Aug 1, 2025
679e8b1
[rubygems/rubygems] Fix `bundle show --verbose` and recommend it as a…
deivid-rodriguez Aug 8, 2025
9983d2b
[rubygems/rubygems] Delay pending spec
deivid-rodriguez Aug 8, 2025
302c5ae
[rubygems/rubygems] Consistently use banner of desc when defining CLI…
deivid-rodriguez Aug 11, 2025
12c200a
[rubygems/rubygems] Improve `bundle config` documentation
deivid-rodriguez Aug 11, 2025
f3d62db
[rubygems/rubygems] Improve `doctor` CLI flag documentation
deivid-rodriguez Aug 11, 2025
4a3a544
[rubygems/rubygems] Improve `bundle plugin` documentation
deivid-rodriguez Aug 11, 2025
d04f187
[rubygems/rubygems] Refactor git specs
deivid-rodriguez Jul 30, 2025
50c1fae
[rubygems/rubygems] Fix incorrect error message capitalization
deivid-rodriguez Jul 30, 2025
8576da4
[rubygems/rubygems] Enforce checksums strictly for registry gems
deivid-rodriguez Jul 30, 2025
7125f76
[rubygems/rubygems] Use spaces around optional parameter values
deivid-rodriguez Aug 11, 2025
f0ee763
Merge specs checking CLI flags and subcommands are documented
deivid-rodriguez Aug 11, 2025
5be3ebb
[ruby/json] Remove trailing spaces [ci skip]
nobu Aug 7, 2025
0de695e
[ruby/json] Append newline at EOF [ci skip]
nobu Aug 8, 2025
e3ce56c
Fix typos
dduugg Aug 13, 2025
7ddc53b
Exclude prism/generate-srcs.mk.rb from sync targets of prism
hsbt Aug 18, 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
6 changes: 1 addition & 5 deletions .github/workflows/check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ jobs:
- name: Run configure
run: ./configure -C --disable-install-doc --disable-rubygems --with-gcc 'optflags=-O0' 'debugflags=-save-temps=obj -g'

- run: make all golf

- run: ./goruby -veh

- run: ruby tool/update-deps --fix
- run: make fix-depends

- run: git diff --no-ext-diff --ignore-submodules --exit-code

Expand Down
3 changes: 3 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,9 @@ clean-gems:

CLEAN_CACHE = clean-extlibs

prepare-package: prereq after-update
clean-cache: $(CLEAN_CACHE)

info: info-program info-libruby_a info-libruby_so info-arch
info-program: PHONY
@echo PROGRAM=$(PROGRAM)
Expand Down
3 changes: 3 additions & 0 deletions defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ update-deps:
$(GIT) --git-dir=$(GIT_DIR) merge --no-edit --ff-only $(update_deps)
$(GIT) --git-dir=$(GIT_DIR) branch --delete $(update_deps)

fix-depends check-depends: all hello
$(BASERUBY) -C $(srcdir) tool/update-deps $(if $(filter fix-%,$@),--fix)

# order-only-prerequisites doesn't work for $(RUBYSPEC_CAPIEXT)
# because the same named directory exists in the source tree.
$(RUBYSPEC_CAPIEXT)/%.$(DLEXT): $(srcdir)/$(RUBYSPEC_CAPIEXT)/%.c $(RUBYSPEC_CAPIEXT_DEPS) \
Expand Down
4 changes: 2 additions & 2 deletions ext/json/generator/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ static inline FORCE_INLINE void search_flush(search_state *search)
{
// Do not remove this conditional without profiling, specifically escape-heavy text.
// escape_UTF8_char_basic will advance search->ptr and search->cursor (effectively a search_flush).
// For back-to-back characters that need to be escaped, specifcally for the SIMD code paths, this method
// will be called just before calling escape_UTF8_char_basic. There will be no characers to append for the
// For back-to-back characters that need to be escaped, specifically for the SIMD code paths, this method
// will be called just before calling escape_UTF8_char_basic. There will be no characters to append for the
// consecutive characters that need to be escaped. While the fbuffer_append is a no-op if
// nothing needs to be flushed, we can save a few memory references with this conditional.
if (search->ptr > search->cursor) {
Expand Down
2 changes: 1 addition & 1 deletion ext/json/lib/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
# When not specified:
# # The last value is used and a deprecation warning emitted.
# JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
# # waring: detected duplicate keys in JSON object.
# # warning: detected duplicate keys in JSON object.
# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
#
# When set to `+true+`
Expand Down
8 changes: 4 additions & 4 deletions ext/json/lib/json/add/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

class String
# call-seq: json_create(o)
#
#
# Raw Strings are JSON Objects (the raw bytes are stored in an array for the
# key "raw"). The Ruby String can be created by this class method.
def self.json_create(object)
object["raw"].pack("C*")
end

# call-seq: to_json_raw_object()
#
#
# This method creates a raw object hash, that can be nested into
# other data structures and will be generated as a raw string. This
# method should be used, if you want to convert raw strings to JSON
Expand All @@ -26,10 +26,10 @@ def to_json_raw_object
end

# call-seq: to_json_raw(*args)
#
#
# This method creates a JSON text from the result of a call to
# to_json_raw_object of this String.
def to_json_raw(...)
to_json_raw_object.to_json(...)
end
end
end
2 changes: 1 addition & 1 deletion ext/json/lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ class Coder
# See {Parsing Options}[#module-JSON-label-Parsing+Options], and {Generating Options}[#module-JSON-label-Generating+Options].
#
# For generation, the <tt>strict: true</tt> option is always set. When a Ruby object with no native \JSON counterpart is
# encoutered, the block provided to the initialize method is invoked, and must return a Ruby object that has a native
# encountered, the block provided to the initialize method is invoked, and must return a Ruby object that has a native
# \JSON counterpart:
#
# module MyApp
Expand Down
2 changes: 1 addition & 1 deletion ext/json/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ static VALUE json_parse_any(JSON_ParserState *state, JSON_ParserConfig *config)
break;
}

raise_parse_error("unreacheable: %s", state);
raise_parse_error("unreachable: %s", state);
}

static void json_ensure_eof(JSON_ParserState *state)
Expand Down
6 changes: 6 additions & 0 deletions lib/bundler/checksum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ def missing?(spec)
@store[spec.lock_name].nil?
end

def empty?(spec)
return false unless spec.source.is_a?(Bundler::Source::Rubygems)

@store[spec.lock_name].empty?
end

def register(spec, checksum)
register_checksum(spec.lock_name, checksum)
end
Expand Down
45 changes: 26 additions & 19 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def update(*gems)
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
def show(gem_name = nil)
if ARGV.include?("--outdated")
message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
removed_message = "the `--outdated` flag to `bundle show` was undocumented and has been removed without replacement"
message = "the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`"
removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
end
require_relative "cli/show"
Expand All @@ -299,6 +299,7 @@ def show(gem_name = nil)
method_option "name-only", type: :boolean, banner: "print only the gem names"
method_option "only-group", type: :array, default: [], banner: "print gems from a given set of groups"
method_option "without-group", type: :array, default: [], banner: "print all gems except from a given set of groups"
method_option "format", type: :string, banner: "format output ('json' is the only supported format)"
method_option "paths", type: :boolean, banner: "print the path to each gem in the bundle"
def list
require_relative "cli/list"
Expand Down Expand Up @@ -412,6 +413,7 @@ def fund
D
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")

if flag_passed?("--path")
message =
Expand Down Expand Up @@ -518,11 +520,11 @@ def licenses
Viz requires the ruby-graphviz gem (and its dependencies).
The associated gems must also be installed via 'bundle install'.
D
method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
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"
Expand All @@ -531,19 +533,19 @@ def viz
end

desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library."
method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library."
method_option :mit, type: :boolean, banner: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
method_option :rubocop, type: :boolean, banner: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
method_option :changelog, type: :boolean, banner: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], banner: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], banner: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], desc: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], banner: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"

def gem(name)
require_relative "cli/gem"
Expand Down Expand Up @@ -713,7 +715,12 @@ def print_command
command_name = cmd.name
return if PARSEABLE_COMMANDS.include?(command_name)
command = ["bundle", command_name] + args
command << Thor::Options.to_switches(options.sort_by(&:first)).strip
options_to_print = options.dup
options_to_print.delete_if do |k, v|
next unless o = cmd.options[k]
o.default == v
end
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
command.reject!(&:empty?)
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
end
Expand Down
35 changes: 33 additions & 2 deletions lib/bundler/cli/list.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# frozen_string_literal: true

require "json"

module Bundler
class CLI::List
def initialize(options)
@options = options
@without_group = options["without-group"].map(&:to_sym)
@only_group = options["only-group"].map(&:to_sym)
@format = options["format"]
end

def run
Expand All @@ -25,6 +28,36 @@ def run
end
end.reject {|s| s.name == "bundler" }.sort_by(&:name)

case @format
when "json"
print_json(specs: specs)
when nil
print_human(specs: specs)
else
raise InvalidOption, "Unknown option`--format=#{@format}`. Supported formats: `json`"
end
end

private

def print_json(specs:)
gems = if @options["name-only"]
specs.map {|s| { name: s.name } }
else
specs.map do |s|
{
name: s.name,
version: s.version.to_s,
git_version: s.git_version&.strip,
}.tap do |h|
h[:path] = s.full_gem_path if @options["paths"]
end
end
end
Bundler.ui.info({ gems: gems }.to_json)
end

def print_human(specs:)
return Bundler.ui.info "No gems in the Gemfile" if specs.empty?

return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
Expand All @@ -37,8 +70,6 @@ def run
Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
end

private

def verify_group_exists(groups)
(@without_group + @only_group).each do |group|
raise InvalidOption, "`#{group}` group could not be found." unless groups.include?(group)
Expand Down
8 changes: 2 additions & 6 deletions lib/bundler/cli/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ def run

def fetch_latest_specs
definition = Bundler.definition(true)
if options[:outdated]
Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
Bundler.ui.silence { definition.remotely! }
else
definition.with_cache!
end
Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
Bundler.ui.silence { definition.remotely! }
Bundler.reset!
definition.specs
end
Expand Down
Loading