Commit graph

57149 commits

Author SHA1 Message Date
aycabta
b64911f4e2 Parser was replaced 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
bad937b00b Gem::TestCase is based on Minitest 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
daf5ce3ba1 Use omit instead of skip for test-unit. 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
e87e10e5e7 Use test/unit instead of test-unit. Because test-unit is only provided standalone gem. 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
2066dae991 Cleanup commented-out code. 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
9218655660 Removed needless alias for capture_io. 2019-08-16 06:07:11 +09:00
Hiroshi SHIBATA
8a18a639b7 Use Gemfile instead of add_development_dependency. 2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
71fd26b195 Fallback for older Rubygems 2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
787b437a2a Use Gem.default_specifications_dir
Gem::Specification.default_specifications_dir is deprecated.
2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
5555e3ef57 Renamed minitest_helper.rb as helper.rb 2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
8045ebbf78 Use locale directory for the tests 2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
1a5304228a Use test-unit instead of minitest
Minitest 6 will err `assert_equal` with `nil`.
https://github.com/seattlerb/minitest/issues/779
2019-08-16 06:07:11 +09:00
aycabta
64f9f512c5 Treat linking to Markdown label correctly 2019-08-16 06:02:45 +09:00
Yusuke Endoh
723a37d038 Separate RDoc::TokenStream#add_tokens and #add_token
The old version of `add_tokens` accepts an array of tokens, and
multiple arguments of tokens by using `Array#flatten`.
And `add_token` was an alias to `add_tokens`.

I think it is unnecessarily flexible; in fact, all callsites of
`add_tokens` (except test) passes only an array of tokens.
And the code created a lot of temporal arrays.

This change makes `add_tokens` accept only one array of tokens,
and does `add_token` accept one token.  It is a bit faster (about
1 second in Ruby's `make rdoc`), and it ls also cleaner in my point of
view.
2019-08-16 06:02:45 +09:00
Yusuke Endoh
0a0760aa63 Refactor and improve performance of RDoc::Markup::Parser
This change introduces a wrapper of StringScanner that is aware of the
current position (column and lineno).
It has two advantages: faster and more modular.

The old code frequently runs `@input.byteslice(0, byte_offset).length`
to get the current position, but it was painfully slow.  This change
keeps track of the position at each scan, which reduces about half of
time of "Generating RI format into ..." in Ruby's `make rdoc`
(5.5 sec -> 3.0 sec).

And the old code used four instance variables (`@input`, `@line`,
`@line_pos`, and `@s`) to track the position.  This change factors them
out into MyStringScanner, so now only one variable (`@s`) is needed.
2019-08-16 06:02:45 +09:00
Steven Willis
9d2fed2ccd Don't echo results of assignment expressions 2019-08-16 06:02:45 +09:00
OKURA Masafumi
74726691ba Add details about parameters to define_method doc (#2165)
When we use `define_method` and `define_singleton_method`,
if we supply block parameters to a block then a generated
method has corresponding parameters.
However, the doc doesn't mention it, so this info has been added.
2019-08-16 02:21:17 +09:00
Takashi Kokubun
409ce8c3da
Also clean up branch for worktree 2019-08-16 01:51:22 +09:00
Takashi Kokubun
d21616eeb0
Clean up temporary git resources
after `make update-github`
2019-08-16 01:45:11 +09:00
Espartaco Palma
2665e5858f Adding missing test for Net::HTTPGenericRequest initializer (#1835)
A new exception is raised if an URI::HTTP is received and that object doesn't
have a hostname property.
Complementary to #1278
2019-08-16 01:38:46 +09:00
Takashi Kokubun
2f919a92ba
Improve make update-github to avoid configure
after doing it once.
2019-08-16 01:37:22 +09:00
Takashi Kokubun
789f17665e
Make make update-github idempotent 2019-08-16 01:18:28 +09:00
Takashi Kokubun
d013d8e02e
Fix crash on $(PULL_REQUEST) expansion
by directly passing it to Ruby without passing a shell.
Formerly it was broken when $(PULL_REQUEST) included quotes.
2019-08-16 01:11:19 +09:00
Olivier Lacan
7c46aa6911 Avoid confusion in Array#- and Array#difference docs (#2070)
My previous attempt to correct #2068 apparently failed and the confusing
wording ("instances") was merged into trunk instead.

This should address any potential confusion.
2019-08-16 00:42:17 +09:00
Nobuyoshi Nakada
7704bbd640
Marked up command line options [ci skip] 2019-08-16 00:28:22 +09:00
songhuangcn
d2070f2e45 Fix doc in Object#respond_to_missing? (#2239) 2019-08-16 00:20:52 +09:00
git
715218c430 * 2019-08-16 [ci skip] 2019-08-16 00:02:38 +09:00
Nobuyoshi Nakada
40806793a9
Fixed class, module and method references [ci skip] 2019-08-16 00:00:50 +09:00
Nobuyoshi Nakada
b1003301af
Fixed a markup in different format [ci skip] 2019-08-15 23:59:28 +09:00
Nobuyoshi Nakada
d5c33364e3
Fixed heap-use-after-free
* string.c (rb_str_sub_bang): retrieves a pointer to the
  replacement string buffer just before using it, for the case of
  replacement with the receiver string itself.  [Bug #16105]
2019-08-15 23:39:14 +09:00
Nobuyoshi Nakada
c4152b11a7
Prepare to pull commits notes [ci skip] 2019-08-15 21:34:34 +09:00
Nobuyoshi Nakada
fff2b231a3
Simplified GITHUB_TOKEN argument [ci skip] 2019-08-15 21:26:51 +09:00
Koichi Sasada
53a55aeff3
introduce RUBY_ON_BUG envval. (#2331)
`rb_bug()` is called at critical bug, MRI can't run anymore.
To make debug easy, this patch introduces RUBY_ON_BUG environment
variable to specify the process which is called with pid.
[Feature #16090] [GH #2331]

  RUBY_ON_BUG='gdb -p' ruby xxx.rb

In this case, if ruby interpreter causes critical bug, and call
rb_bug(), then "gdb -p [PID]' is called by system(3). You can
debug on invoked gdb.

This feature is limited on RUBY_DEVEL build.
2019-08-15 13:48:58 +09:00
git
132b7eb104 * expand tabs. [ci skip] 2019-08-15 08:16:14 +09:00
Jeremy Evans
6954ff1dcb Make Range#=== operate like cover? instead of include? for string ranges
Previously, Range#=== treated string ranges that were not endless or
beginless the same as include?, instead of the same as cover?.
I think this was an oversight in 989e07c0f2,
as the commit message did not indicate this behavior was desired.

This also makes some previously dead code no longer dead. Previously,
the conditionals were doing this:

    if (RB_TYPE_P(beg, T_STRING)
        if (NIL_P(beg)) # can never be true

This restructures it so at the NIL_P(beg) check, beg could possibly
be nil (beginless ranges).

Fixes [Bug #15449]
2019-08-14 14:14:49 -07:00
Jeremy Evans
082424ef58 Fold to lowercase intead of uppercase for String#casecmp
strcasecmp(3) and String#casecmp? both fold to lowercase.
2019-08-14 14:11:39 -07:00
Jeremy Evans
d5c60214c4 Implement Range#minmax
Range#minmax was previous not implemented, so calling #minmax on
range was actually calling Enumerable#minmax.  This is a simple
implementation of #minmax by just calling range_min and range_max.

Fixes [Bug #15867]
Fixes [Bug #15807]
2019-08-14 11:22:07 -07:00
Jeremy Evans
661927a4c5 Switch to using a VM stack argument instead of 2nd operand for getconstant
Some tooling depends on the current bytecode, and adding an operand
changes the bytecode.  While tooling can be updated for new bytecode,
this support doesn't warrant such a change.
2019-08-14 11:22:07 -07:00
Jeremy Evans
6ac6de84ac Use Qtrue/Qfalse instead of 1/0 for 2nd operand to getconstant
Fixes error when using -Werror,-Wshorten-64-to-32.
2019-08-14 09:59:27 -07:00
git
d053a57014 * expand tabs. [ci skip] 2019-08-15 01:51:19 +09:00
Jeremy Evans
fbcd065294 Remove support for nil::Constant
This was an intentional bug added in 1.9.

The approach taken here is to add a second operand to the
getconstant instruction for whether nil should be allowed and
treated as current scope.

Fixes [Bug #11718]
2019-08-14 09:50:14 -07:00
git
7d32cb7631 * 2019-08-15 [ci skip] 2019-08-15 01:00:46 +09:00
Takashi Kokubun
938e075273
Add make update-github PR=1234 to refresh PR (#2368) 2019-08-15 01:00:26 +09:00
Takashi Kokubun
e173012f44
Drop obsoleted make merge-github task 2019-08-14 23:41:41 +09:00
Steven Harman
7da40d74e1 backtrace and backtrace_locations can be nil (#2358)
Exception#backtrace and Exception#backtrace_locations can both be nil if
not set. The former can be set via `Exception#set_backtrace`, but the
later is only ever set at runtime via `setup_backtrace`.
2019-08-14 10:35:47 -04:00
Nikolai B
48e9155e65 Remove strange formatting from English [ci skip]
\vref is not valid doc syntax
2019-08-14 23:13:06 +09:00
Takashi Kokubun
9874dca3e7 Mark bundler / bundled-gems as continue-on-failure
because these tests have failed too often and it's false-positive for
checking healthiness of the master branch.
2019-08-14 23:02:09 +09:00
Takashi Kokubun
bf77f43b39
Update the description of check_branch 2019-08-14 22:36:49 +09:00
Takashi Kokubun
8be521662d
Rename check_branch.master to pull_request.check_branch
because it's shown as just "master" on a pull request which does not
have the check_branch.master job yet.

"check_branch" would be easier to understand and now we can grep it from
master branch.
2019-08-14 22:22:12 +09:00
Alan Wu
c8f97596b7 Don't accidentally name anonymous module/class
b00f280d4b introduced
an accidental behavior change in that defining a module/class under
`m` gives `m` a name when `m` is anonymous.

`ruby -ve 'Module.new { class self::A; end; p name }'` outputs a name
similar to `Module#inspect` when it should output `nil` like in Ruby
2.6.x.

 * variable.c: Use `make_temporary_path` instead of `save_temporary_path`
   when getting the name of the parent module.

 * variable.c (rb_set_class_path): Delegate to `rb_set_class_path_string`
   instead of duplicating the logic.

[Bug #16097]
2019-08-14 17:13:28 +09:00