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
2 changes: 0 additions & 2 deletions depend
Original file line number Diff line number Diff line change
Expand Up @@ -14598,7 +14598,6 @@ ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_string.h
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_strncasecmp.h
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_strpbrk.h
ruby.$(OBJEXT): $(top_srcdir)/version.h
ruby.$(OBJEXT): {$(VPATH)}assert.h
ruby.$(OBJEXT): {$(VPATH)}atomic.h
ruby.$(OBJEXT): {$(VPATH)}backward/2/assume.h
Expand Down Expand Up @@ -14782,7 +14781,6 @@ ruby.$(OBJEXT): {$(VPATH)}prism/ast.h
ruby.$(OBJEXT): {$(VPATH)}prism/diagnostic.h
ruby.$(OBJEXT): {$(VPATH)}prism/version.h
ruby.$(OBJEXT): {$(VPATH)}prism_compile.h
ruby.$(OBJEXT): {$(VPATH)}revision.h
ruby.$(OBJEXT): {$(VPATH)}ruby.c
ruby.$(OBJEXT): {$(VPATH)}ruby_assert.h
ruby.$(OBJEXT): {$(VPATH)}ruby_atomic.h
Expand Down
2 changes: 1 addition & 1 deletion doc/ruby/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ $ ruby -n -e 'p $_' desiderata.txt
"be on good terms with all persons.\n"
```

With option `-l' (chopped):
With option `-l` (chopped):

```console
$ ruby -ln -e 'p $_' desiderata.txt
Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ostruct 0.6.3 https://github.com/ruby/ostruct
pstore 0.2.0 https://github.com/ruby/pstore
benchmark 0.4.1 https://github.com/ruby/benchmark
logger 1.7.0 https://github.com/ruby/logger
rdoc 6.14.2 https://github.com/ruby/rdoc f4a90c6010b2346cb5426d4496f5a37a136a82fb # for markdown
rdoc 6.14.2 https://github.com/ruby/rdoc
win32ole 1.9.2 https://github.com/ruby/win32ole
irb 1.15.2 https://github.com/ruby/irb 331c4e851296b115db766c291e8cf54a2492fb36
reline 0.6.2 https://github.com/ruby/reline
Expand Down
1 change: 1 addition & 0 deletions lib/resolv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'timeout'
require 'io/wait'
require 'securerandom'
require 'rbconfig'

# Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can
# handle multiple DNS requests concurrently without blocking the entire Ruby
Expand Down
9 changes: 5 additions & 4 deletions ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#include "ruby/util.h"
#include "ruby/version.h"
#include "ruby/internal/error.h"
#include "version.h"

#define singlebit_only_p(x) !((x) & ((x)-1))
STATIC_ASSERT(Qnil_1bit_from_Qfalse, singlebit_only_p(Qnil^Qfalse));
Expand Down Expand Up @@ -302,6 +301,8 @@ ruby_show_usage_line(const char *name, const char *secondary, const char *descri
description, help, highlight, width, columns);
}

RUBY_EXTERN const char ruby_api_version_name[];

static void
usage(const char *name, int help, int highlight, int columns)
{
Expand Down Expand Up @@ -404,9 +405,9 @@ usage(const char *name, int help, int highlight, int columns)
unsigned int w = (columns > 80 ? (columns - 79) / 2 : 0) + 16;
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)

printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n\n", sb, se, name);
printf("Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
RUBY_PATCHLEVEL == -1 ? "master" : STRINGIZE(RUBY_VERSION_MAJOR) "." STRINGIZE(RUBY_VERSION_MINOR));
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
printf("\n""Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
ruby_api_version_name);

for (i = 0; i < num; ++i)
SHOW(usage_msg[i]);
Expand Down
19 changes: 10 additions & 9 deletions test/ruby/test_rubyoptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,27 @@ def test_source_file
assert_in_out_err([], "", [], [])
end

version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
OPTIONS_LINK = "https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html"

def test_usage
assert_in_out_err(%w(-h)) do |r, e|
assert_operator(r.size, :<=, 26)
longer = r[3..-1].select {|x| x.size >= 80}
_, _, link, *r = r
assert_include(link, OPTIONS_LINK)
assert_operator(r.size, :<=, 24)
longer = r.select {|x| x.size >= 80}
assert_equal([], longer)
assert_equal([], e)

version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
end
end

def test_usage_long
assert_in_out_err(%w(--help)) do |r, e|
longer = r[3..-1].select {|x| x.size > 80}
_, _, link, *r = r
assert_include(link, OPTIONS_LINK)
longer = r.select {|x| x.size > 80}
assert_equal([], longer)
assert_equal([], e)

version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
end
end

Expand Down
14 changes: 9 additions & 5 deletions tool/test-bundled-gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@

github_actions = ENV["GITHUB_ACTIONS"] == "true"

DEFAULT_ALLOWED_FAILURES = RUBY_PLATFORM =~ /mswin|mingw/ ? [
'rbs',
'debug',
'irb',
'power_assert',
'net-imap',
] : []
allowed_failures = ENV['TEST_BUNDLED_GEMS_ALLOW_FAILURES'] || ''
if RUBY_PLATFORM =~ /mswin|mingw/
allowed_failures = [allowed_failures, "rbs,debug,irb,power_assert"].join(',')
end
allowed_failures = allowed_failures.split(',').uniq.reject(&:empty?)
allowed_failures = allowed_failures.split(',').concat(DEFAULT_ALLOWED_FAILURES).uniq.reject(&:empty?)

# make test-bundled-gems BUNDLED_GEMS=gem1,gem2,gem3
bundled_gems = ARGV.first || ''
Expand Down Expand Up @@ -113,7 +117,7 @@
"with exit code #{$?.exitstatus}")
puts colorize.decorate(mesg, "fail")
if allowed_failures.include?(gem)
mesg = "Ignoring test failures for #{gem} due to \$TEST_BUNDLED_GEMS_ALLOW_FAILURES"
mesg = "Ignoring test failures for #{gem} due to \$TEST_BUNDLED_GEMS_ALLOW_FAILURES or DEFAULT_ALLOWED_FAILURES"
puts colorize.decorate(mesg, "skip")
else
failed << gem
Expand Down
9 changes: 8 additions & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

#ifdef RUBY_REVISION
# if RUBY_PATCHLEVEL == -1
# define RUBY_API_VERSION_NAME "master"
# ifndef RUBY_BRANCH_NAME
# define RUBY_BRANCH_NAME "master"
# define RUBY_BRANCH_NAME RUBY_API_VERSION_NAME
# endif
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "RUBY_REVISION
# else
# define RUBY_API_VERSION_NAME RUBY_API_VERSION_STR
# define RUBY_REVISION_STR " revision "RUBY_REVISION
# endif
#else
Expand All @@ -44,6 +46,10 @@
#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
#define MKINT(name) INT2FIX(ruby_##name)

#define RUBY_API_VERSION_STR \
STRINGIZE(RUBY_API_VERSION_MAJOR) "." \
STRINGIZE(RUBY_API_VERSION_MINOR) "." \
""
const int ruby_api_version[] = {
RUBY_API_VERSION_MAJOR,
RUBY_API_VERSION_MINOR,
Expand Down Expand Up @@ -81,6 +87,7 @@ const char ruby_revision[] = RUBY_FULL_REVISION;
const char ruby_release_date[] = RUBY_RELEASE_DATE;
const char ruby_platform[] = RUBY_PLATFORM;
const int ruby_patchlevel = RUBY_PATCHLEVEL;
const char ruby_api_version_name[] = RUBY_API_VERSION_NAME;
const char ruby_description[] =
"ruby " RUBY_VERSION RUBY_PATCHLEVEL_STR " "
"(" RUBY_RELEASE_DATETIME RUBY_REVISION_STR ") "
Expand Down