Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ The following default gem is added.

The following default gems are updated.

* RubyGems 4.0.0.beta1
* bundler 4.0.0.beta1
* RubyGems 4.0.0.beta2
* bundler 4.0.0.beta2
* date 3.5.0
* digest 3.2.1
* english 0.8.1
Expand Down
2 changes: 1 addition & 1 deletion ext/cgi/escape/escape.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ escaped_length(VALUE str)
static VALUE
optimized_escape_html(VALUE str)
{
VALUE escaped;
VALUE vbuf;
char *buf = ALLOCV_N(char, vbuf, escaped_length(str));
const char *cstr = RSTRING_PTR(str);
Expand All @@ -63,7 +64,6 @@ optimized_escape_html(VALUE str)
}
}

VALUE escaped;
if (RSTRING_LEN(str) < (dest - buf)) {
escaped = rb_str_new(buf, dest - buf);
preserve_original_state(str, escaped);
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: false

module Bundler
VERSION = "4.0.0.beta1".freeze
VERSION = "4.0.0.beta2".freeze

def self.bundler_major_version
@bundler_major_version ||= gem_version.segments.first
Expand Down
28 changes: 9 additions & 19 deletions lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ def candidate(key, icase = false, pat = nil, &_)
Completion.candidate(key, icase, pat, &method(:each))
end

public
def complete(key, icase = false, pat = nil)
candidates = candidate(key, icase, pat, &method(:each)).sort_by {|k, v, kn| kn.size}
if candidates.size == 1
Expand Down Expand Up @@ -562,7 +561,7 @@ def initialize(pattern = nil, conv = nil,
# Parses +arg+ and returns rest of +arg+ and matched portion to the
# argument pattern. Yields when the pattern doesn't match substring.
#
def parse_arg(arg) # :nodoc:
private def parse_arg(arg) # :nodoc:
pattern or return nil, [arg]
unless m = pattern.match(arg)
yield(InvalidArgument, arg)
Expand All @@ -580,14 +579,13 @@ def parse_arg(arg) # :nodoc:
yield(InvalidArgument, arg) # didn't match whole arg
return arg[s.length..-1], m
end
private :parse_arg

#
# Parses argument, converts and returns +arg+, +block+ and result of
# conversion. Yields at semi-error condition instead of raising an
# exception.
#
def conv_arg(arg, val = []) # :nodoc:
private def conv_arg(arg, val = []) # :nodoc:
v, = *val
if conv
val = conv.call(*val)
Expand All @@ -599,7 +597,6 @@ def conv_arg(arg, val = []) # :nodoc:
end
return arg, block, val
end
private :conv_arg

#
# Produces the summary text. Each line of the summary is yielded to the
Expand Down Expand Up @@ -883,14 +880,13 @@ def reject(t)
# +lopts+:: Long style option list.
# +nlopts+:: Negated long style options list.
#
def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
private def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
sopts.each {|o| @short[o] = sw} if sopts
lopts.each {|o| @long[o] = sw} if lopts
nlopts.each {|o| @long[o] = nsw} if nsw and nlopts
used = @short.invert.update(@long.invert)
@list.delete_if {|o| Switch === o and !used[o]}
end
private :update

#
# Inserts +switch+ at the head of the list, and associates short, long
Expand Down Expand Up @@ -1459,14 +1455,13 @@ def to_a; summarize("#{banner}".split(/^/)) end
# +prv+:: Previously specified argument.
# +msg+:: Exception message.
#
def notwice(obj, prv, msg) # :nodoc:
private def notwice(obj, prv, msg) # :nodoc:
unless !prv or prv == obj
raise(ArgumentError, "argument #{msg} given twice: #{obj}",
ParseError.filter_backtrace(caller(2)))
end
obj
end
private :notwice

SPLAT_PROC = proc {|*a| a.length <= 1 ? a.first : a} # :nodoc:

Expand Down Expand Up @@ -1733,7 +1728,7 @@ def order!(argv = default_argv, into: nil, **keywords, &nonopt)
parse_in_order(argv, setter, **keywords, &nonopt)
end

def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, &nonopt) # :nodoc:
private def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **, &nonopt) # :nodoc:
opt, arg, val, rest = nil
nonopt ||= proc {|a| throw :terminate, a}
argv.unshift(arg) if arg = catch(:terminate) {
Expand Down Expand Up @@ -1824,10 +1819,9 @@ def parse_in_order(argv = default_argv, setter = nil, exact: require_exact, **,

argv
end
private :parse_in_order

# Calls callback with _val_.
def callback!(cb, max_arity, *args) # :nodoc:
private def callback!(cb, max_arity, *args) # :nodoc:
args.compact!

if (size = args.size) < max_arity and cb.to_proc.lambda?
Expand All @@ -1837,7 +1831,6 @@ def callback!(cb, max_arity, *args) # :nodoc:
end
cb.call(*args)
end
private :callback!

#
# Parses command line arguments +argv+ in permutation mode and returns
Expand Down Expand Up @@ -1951,24 +1944,22 @@ def self.getopts(*args, symbolize_names: false)
# Traverses @stack, sending each element method +id+ with +args+ and
# +block+.
#
def visit(id, *args, &block) # :nodoc:
private def visit(id, *args, &block) # :nodoc:
@stack.reverse_each do |el|
el.__send__(id, *args, &block)
end
nil
end
private :visit

#
# Searches +key+ in @stack for +id+ hash and returns or yields the result.
#
def search(id, key) # :nodoc:
private def search(id, key) # :nodoc:
block_given = block_given?
visit(:search, id, key) do |k|
return block_given ? yield(k) : k
end
end
private :search

#
# Completes shortened long style option switch and returns pair of
Expand All @@ -1979,7 +1970,7 @@ def search(id, key) # :nodoc:
# +icase+:: Search case insensitive if true.
# +pat+:: Optional pattern for completion.
#
def complete(typ, opt, icase = false, *pat) # :nodoc:
private def complete(typ, opt, icase = false, *pat) # :nodoc:
if pat.empty?
search(typ, opt) {|sw| return [sw, opt]} # exact match or...
end
Expand All @@ -1989,7 +1980,6 @@ def complete(typ, opt, icase = false, *pat) # :nodoc:
exc = ambiguous ? AmbiguousOption : InvalidOption
raise exc.new(opt, additional: proc {|o| additional_message(typ, o)})
end
private :complete

#
# Returns additional info.
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require "rbconfig"

module Gem
VERSION = "4.0.0.beta1"
VERSION = "4.0.0.beta2"
end

require_relative "rubygems/defaults"
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/realworld/fixtures/tapioca/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ DEPENDENCIES
tapioca

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2
2 changes: 1 addition & 1 deletion spec/bundler/realworld/fixtures/warbler/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ DEPENDENCIES
warbler!

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2
4 changes: 2 additions & 2 deletions test/test_timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_fork
end

def test_threadgroup
assert_separately(%w[-W0 -rtimeout], <<-'end;')
assert_separately(%w[-rtimeout], <<-'end;')
tg = ThreadGroup.new
thr = Thread.new do
tg.add(Thread.current)
Expand All @@ -263,7 +263,7 @@ def test_threadgroup

# https://github.com/ruby/timeout/issues/24
def test_handling_enclosed_threadgroup
assert_separately(%w[-W0 -rtimeout], <<-'end;')
assert_separately(%w[-rtimeout], <<-'end;')
Thread.new {
t = Thread.current
group = ThreadGroup.new
Expand Down
2 changes: 1 addition & 1 deletion tool/bundler/dev_gems.rb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ CHECKSUMS
turbo_tests (2.2.5) sha256=3fa31497d12976d11ccc298add29107b92bda94a90d8a0a5783f06f05102509f

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2
2 changes: 1 addition & 1 deletion tool/bundler/rubocop_gems.rb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ CHECKSUMS
unicode-emoji (4.1.0) sha256=4997d2d5df1ed4252f4830a9b6e86f932e2013fbff2182a9ce9ccabda4f325a5

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2
2 changes: 1 addition & 1 deletion tool/bundler/standard_gems.rb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ CHECKSUMS
unicode-emoji (4.1.0) sha256=4997d2d5df1ed4252f4830a9b6e86f932e2013fbff2182a9ce9ccabda4f325a5

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2
2 changes: 1 addition & 1 deletion tool/bundler/test_gems.rb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ CHECKSUMS
tilt (2.6.1) sha256=35a99bba2adf7c1e362f5b48f9b581cce4edfba98117e34696dde6d308d84770

BUNDLED WITH
4.0.0.beta1
4.0.0.beta2