Commit graph

16692 commits

Author SHA1 Message Date
Nobuyoshi Nakada
deaa656608 [ruby/rdoc] Escape TIDYLINKs
https://hackerone.com/reports/1187156

1ad2dd3ca2
2022-10-07 12:09:20 +09:00
Peter Zhu
3df904d1a8 Add debug output to test_thrashing_for_young_objects
The test is failing only on trunk-repeat50@phosphorus-docker. This
commit adds some debugging output to debug the failure.
2022-10-06 13:46:31 -04:00
Nobuyoshi Nakada
cf3056be69 [ruby/rdoc] Add center align
512cc55a0e
2022-10-06 23:22:02 +09:00
Nobuyoshi Nakada
28e24ce355 [ruby/rdoc] Allow spaces around pipes
3b3a583580
2022-10-06 23:21:16 +09:00
Nobuyoshi Nakada
7c03c82444 [ruby/rdoc] Allow escaped pipes in cells
333952a62d
2022-10-06 23:17:49 +09:00
Nobuyoshi Nakada
f6c916c7ef [ruby/rdoc] Allow leading pipes to be ommitted
d263a2c9c4
2022-10-06 23:16:54 +09:00
Nobuyoshi Nakada
a19bf47d03 [ruby/rdoc] Allow trailing pipes to be ommitted
1318048877
2022-10-06 23:14:29 +09:00
Samuel Williams
e696ec67ac
Introduce Fiber.blocking{} for bypassing the fiber scheduler. (#6498) 2022-10-06 23:00:49 +13:00
Nobuyoshi Nakada
75a53f6be0 [ruby/rdoc] Allow RDoc markups in table cells
b16d3f1727
2022-10-06 18:24:44 +09:00
Nobuyoshi Nakada
e929b0aac5 [ruby/rdoc] Add RDoc::Markup::ToHtml#accept_table test
0cb3df713b
2022-10-06 18:24:43 +09:00
Nishant Patel
43e925090b [ruby/open-uri] fix: added test case that validates that bad TLS version is silently ignored
4b91b11730
2022-10-06 18:00:58 +09:00
Nishant Patel
cdbaac3f4b [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
8729858517
2022-10-06 18:00:57 +09:00
Hiroshi SHIBATA
7f80ec47c3 [ruby/open-uri] Use omit instead of skip for test-unit
63f466d6ed
2022-10-06 17:15:27 +09:00
Hiroshi SHIBATA
cc5313ceab [ruby/open-uri] Run global constant count test only under Ruby 3.2
a8f1605ae9
2022-10-06 17:15:26 +09:00
Jean Boussier
d15b38d944 [ruby/open-uri] Avoid busting the global constant cache
`Object#extend(mod)` bump the global constant cache if the module
has constants of its own.

So by moving these constants outside of `Meta` we avoid bumping
the cache.

363c399bac
2022-10-06 16:55:44 +09:00
Imir Kiyamov
83a6213f31 [ruby/irb] Fixed sort of variables in completion
5842888255
2022-10-05 19:22:13 +09:00
Nobuyoshi Nakada
cbd82f5250
Cannot define from defined Data class again 2022-10-03 23:28:01 +09:00
David Rodríguez
b7a61cb485 [rubygems/rubygems] Revert "Cleaup unnecessary code"
Unclear why, but 2e05dadbc5 created some
warnings in ruby-core CI, so let's revert it.

729ce3a6e1
2022-10-03 19:54:24 +09:00
osyo-manga
7b88ffb34f [ruby/irb] Change to explicit method call in completion (https://github.com/ruby/irb/pull/369)
Ensure that methods are called even when local variables are defined.
see: https://github.com/ruby/irb/issues/368

c34d54b8bb
2022-10-03 06:55:53 +09:00
Nobuyoshi Nakada
de9c612d63
Also the tests should use the configured pkg-config 2022-10-02 15:19:14 +09:00
Aaron Patterson
9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
eileencodes
0ab0229c11 Fix frozen object inspect
In the rails/rails CI build for Ruby master we found that some tests
were failing due to inspect on a frozen object being incorrect.

An object's instance variable count was incorrect when frozen causing
the object's inspect to not splat out the object.

This fixes the issue and adds a test for inspecting frozen objects.

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-09-30 13:57:59 -07:00
David Rodríguez
f04d249e83 [rubygems/rubygems] Fix matching of eabihf platforms
a03d30cd58
2022-10-01 05:46:40 +09:00
David Rodríguez
8252ea2140 [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
89362c18ef

Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2022-10-01 05:46:40 +09:00
tompng
641310ce37 [ruby/irb] Fix ripper_lex_without_warning duplicated heredoc token
45b539af39
2022-10-01 04:17:15 +09:00
Victor Shepelev
ad651925e3
Add Data class implementation: Simple immutable value object 2022-09-30 18:23:19 +09:00
Yusuke Endoh
962f9932af [rubygems/rubygems] Prevent a "warning: assigned but unused variable - data"
ec3fd55d40
2022-09-30 15:50:46 +09:00
Benoit Daloze
aa490f9442 Reduce diff to proc.c @ b0b9f7201a
* So it's easy to review https://github.com/ruby/ruby/pull/6242 +
  https://github.com/ruby/ruby/pull/6467 and there are less changes
  overall.
2022-09-29 15:48:35 +02:00
Benoit Daloze
c6319026ca Extend tests for a zsuper method of which the method it resolved to has been removed 2022-09-29 15:48:35 +02:00
Benoit Daloze
6b7d32a5e5 Resolve zsuper method during lookup but preserve owner separately
* See https://bugs.ruby-lang.org/issues/18729#note-34
* See [Bug #18729]
2022-09-29 15:48:35 +02:00
Jenny Shen
28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen
0522e31d57 [rubygems/rubygems] Refactor tests to use Net::HTTPResponse instances for fetcher.data[:path]
4d91cacb1f

Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2022-09-29 17:56:36 +09:00
Jenny Shen
17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen
1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Nobuyoshi Nakada
cb16dcb184 [ruby/date] The shrunk words to be copied is limited
Th buffer size is small enough and no need to allocate dynamically.

f62bf0a01d
2022-09-29 14:56:39 +09:00
Nobuyoshi Nakada
5a8aaedaff [ruby/date] Narrow ALLOCV region for shrunk words
f51b038074
2022-09-29 14:06:36 +09:00
Samuel Williams
bd2fbd3588
Add Coverage.supported? to detect what modes are supported. 2022-09-29 09:44:14 +13:00
Samuel Williams
9dd902b831
Add eval: true/false flag to Coverage.setup. 2022-09-29 09:44:14 +13:00
David Rodríguez
ac56e5c1ab [rubygems/rubygems] Put bundler gemspec stub at the right place
So that it's found when needed, rather than dynamically modifying
loaded stubs and thus messing with RubyGems internals.

cd3e7cb9e5
2022-09-29 03:41:53 +09:00
David Rodríguez
668e78f01b [rubygems/rubygems] Only activate bundler when needed
Loading Bundler beforehand was actually replacing ENV with a backup of
the pre-Bundler environment through `Bundler::EnvironmentPreserver`. I
think that was making a bug in `ENV.replace` not bite our tests, because
Bundler includes proper patches to workaround that issue. So this commit
also includes these patches in RubyGems tests.

8e079149b9
2022-09-29 03:41:52 +09:00
David Rodríguez
20eff52087 [rubygems/rubygems] Test a pure RubyGems method
`Gem::Specification#load_paths` is actually a Bundler thing.

d20b4d1950
2022-09-29 03:41:52 +09:00
David Rodríguez
00a040dda3 [rubygems/rubygems] Little refactor to keep things consistent
3934deb4e4
2022-09-29 03:41:51 +09:00
David Rodríguez
874a2bf17c [rubygems/rubygems] Remove unnecessary ensure
6c0c02c533
2022-09-29 03:41:51 +09:00
David Rodríguez
c7232a2a0a [rubygems/rubygems] Require bundler consistently
The `$LOAD_PATH` should be properly setup so that the local version is
used.

03c0ab4082
2022-09-29 03:41:50 +09:00
David Rodríguez
b9c426eaea [rubygems/rubygems] Remove unnecessary constant
4bd77488ad
2022-09-29 03:41:50 +09:00
David Rodríguez
1e5597532a [rubygems/rubygems] Cleaup unnecessary code
2e05dadbc5
2022-09-29 03:41:49 +09:00
David Rodríguez
5222a89ab6 [rubygems/rubygems] Unskip stuff that now works on JRuby
d86a5ae2eb
2022-09-29 03:41:49 +09:00
Jemma Issroff
d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
David Rodríguez
3c3bd03a7c [rubygems/rubygems] Force "master" to be used regardless of init.defaultBranch config
Otherwise, if you have `init.defaultBranch main` configured, like I do,
a bunch of tests fail with things like:

```
============================================================================================================================================================================================================
Error: test_checkout_submodules(TestGemSourceGit): Gem::Exception: unable to find reference master in /Users/deivid/Code/rubygems/rubygems/tmp/test_rubygems_20220928-13878-xog1je/git/a
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:188:in `rev_parse'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:143:in `dir_shortref'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:158:in `install_dir'
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/source/git.rb:94:in `checkout'
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_gem_source_git.rb:78:in `test_checkout_submodules'
     75:       system @git, "commit", "--quiet", "-m", "add submodule b"
     76:     end
     77:
  => 78:     source.checkout
     79:
     80:     assert_path_exist File.join source.install_dir, "a.gemspec"
     81:     assert_path_exist File.join source.install_dir, "b/b.gemspec"
============================================================================================================================================================================================================
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
E
```

In the future, I'd like to change things to use `main`, but the
straighforward fix now is to keep "master" and make the running
environment's git configuration not get in the middle.

b09b1416f1
2022-09-28 23:01:20 +09:00
Nobuyoshi Nakada
d12fce7af3 [ruby/date] Check time zone offset elements
Too big parts of fractional hour time zone offset can cause assertion
failures.

06bcfb2729
2022-09-28 21:07:00 +09:00