Граф коммитов

16563 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 5ab8cf3f0d Skip a failing shape test 2023-03-05 22:11:20 -08:00
Takashi Kokubun 40ffc1e0f4 Drop existing MJIT tests 2023-03-05 22:11:20 -08:00
tomoya ishida 0463c5806a [ruby/irb] Improve method completion for string and regexp that
includes word break characters
(https://github.com/ruby/irb/pull/523)

* Improve method completion for string and regexp that includes word break characters

* Remove completion-test's assert_not_include because candidates no longer include every possible methods

* Add comment about string's method completion regexp

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Add comment about regexp's method completion regexp

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

https://github.com/ruby/irb/commit/aa8128c533

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-06 05:52:46 +00:00
Hiroshi SHIBATA bab809d98f [rubygems/rubygems] Introduce Gem::Specification.find_by_full_name for finding conbination of name and version for gemspec
https://github.com/rubygems/rubygems/commit/0430551215
2023-03-05 23:52:28 +00:00
Stan Lo 191e4ae33f [ruby/irb] Drop chained methods' completion support
(https://github.com/ruby/irb/pull/529)

Consider completion for this example: `foo.bar.b`

Without type information, it is hard to know the return value of the `bar`
method, so the current implementation interates through `ObjectSpace` to
get all possible candidates for the second method.

In small projects, the performance and accuracy are acceptable. But in
bigger projects, the performance is unacceptable and the accuracy is mostly
poor.

So this commit drops the support for chained methods' completion.
2023-03-04 15:34:49 +00:00
tomoya ishida 6f81e38d1d [ruby/reline] Fix completion with multiline
(https://github.com/ruby/reline/pull/513)

https://github.com/ruby/reline/commit/d76c482c5f
2023-03-04 05:56:00 +00:00
Kevin Menard 8e13e705f9 [ruby/irb] Remove no longer necessary TruffleRuby test exclusions.
(https://github.com/ruby/irb/pull/527)

https://github.com/ruby/irb/commit/8473d0bc0f

Co-authored-by: Stan Lo <stan.lo@shopify.com>
2023-03-03 15:25:29 +00:00
tomoya ishida b49053a6be [ruby/irb] Avoid slow symbol completion when completion target is an
empty symbol
(https://github.com/ruby/irb/pull/534)

https://github.com/ruby/irb/commit/35697f3ef3
2023-03-03 13:41:21 +00:00
tomoya ishida a2b776a9b7 [ruby/irb] Fix prompt test not to change STDIO.external_encoding
(https://github.com/ruby/irb/pull/535)

https://github.com/ruby/irb/commit/09f16259db
2023-03-03 10:18:51 +00:00
Nobuyoshi Nakada 680bd9027f [Bug #19471] `Regexp.compile` should handle keyword arguments
As well as `Regexp.new`, it should pass keyword arguments to the
`Regexp#initialize` method.
2023-03-03 15:27:37 +09:00
David Rodríguez 90b74d8c65 [rubygems/rubygems] Fix warning about ambiguous `/`
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:745: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
```

https://github.com/rubygems/rubygems/commit/e6a538b5c8
2023-03-03 13:43:59 +09:00
David Rodríguez 7fea848568 [rubygems/rubygems] Fix warnings about unused variable
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:180: warning: assigned but unused variable - platforms
```

https://github.com/rubygems/rubygems/commit/7e022cb5e3
2023-03-03 13:43:59 +09:00
David Rodríguez b6d914c722 [rubygems/rubygems] Fix warning about ambiguous `*`
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:42: warning: `*' interpreted as argument prefix
```

https://github.com/rubygems/rubygems/commit/0806ebf4e0
2023-03-03 13:43:58 +09:00
Nobuyoshi Nakada bd17bea6c5 [ruby/irb] Fix warnings because of `@context.main.delete`
If the main object of the context has `#delete` method, the following
warning is printed.

```
irb: warn: can't alias delete from irb_delete.
```

https://github.com/ruby/irb/commit/00b39be61f
2023-03-03 02:44:35 +00:00
David Rodríguez 4467084098 [rubygems/rubygems] Enable `Layout/DefEndAlignment`
https://github.com/rubygems/rubygems/commit/4403613fae
2023-03-02 21:13:12 +00:00
tomoya ishida 556439613a [ruby/irb] Handle long inspect and control character in prompt
string
(https://github.com/ruby/irb/pull/528)

* Handle long inspect and control characters in prompt string

* Add constants for prompt truncate length, omission and replace pattern

* Simply compare string instead of regexp in prompt truncation test
2023-03-02 13:53:44 +00:00
Jeremy Evans 04cfb26bd3 Remove support for the Regexp.new 3rd argument
This was deprecated in Ruby 3.2.

Fixes [Bug #18797]
2023-03-01 23:42:47 -08:00
Stan Lo 9ddd73060b [ruby/irb] Display and prioritise instance methods in `ls
<module/class>`
(https://github.com/ruby/irb/pull/496)

https://github.com/ruby/irb/commit/e3d21f9329
2023-02-28 14:36:12 +00:00
lukeg d2c38aa823 A file was missing in test/excludes for TestArraySubclass 2023-02-28 11:04:32 +09:00
lukeg ba55706fb6 fix test/rubygems/test_gem_package_task.rb when in -j mode
This test skipped sometimes due to failure to load 'rake/packagetask'.
This is due to manipulation of $LOAD_PATH by other rubygems tests. If
rake is loaded before any rubygems tests run, then it works fine.

To reproduce the skipping behavior:
  $ make test-all TESTOPTS="-j6 --test-order=sorted test/rubygems/test_*.rb"
2023-02-28 06:34:27 +09:00
Alan Wu 0eb634ae73 YJIT: Detect and reject `send(:alias_for_send, :foo)`
Previously, YJIT failed to put the stack into the correct shape when
`BasicObject#send` calls an alias method for the send method itself.
This can manifest as strange `NoMethodError`s in the final non-send
receiver, as [seen][1] with the kt-paperclip gem. I also found a case
where it makes YJIT fail the stack size assertion while compiling
`leave`.

YJIT's `BasicObject#__send__` implementation already rejects sends to
`send`, but didn't detect sends to aliases of `send`. Adjust the
detection and reject these cases.

Fixes [Bug #19464]

[1]: https://github.com/Shopify/yjit/issues/306
2023-02-27 11:12:22 -05:00
Stan Lo 0aa50a03b1 [ruby/irb] Provide more useful message when
`IRB::Inspector#inspect_value` errors
(https://github.com/ruby/irb/pull/511)

**Before**

```
irb(main):001:0> c = Cat.new "foo"
(Object doesn't support #inspect)
=>
```

**After**

```
irb(main):001:0> c = Cat.new "foo"
An error occurred when inspecting the object: #<NoMethodError: undefined method `is_a?' for foo:Cat

      if obj.is_a?(String)
            ^^^^^^>
Result of Kernel#inspect: #<Cat:0x0000000109090d80 @name="foo">
=>
```
2023-02-27 11:07:19 +00:00
tomoya ishida 4f611df3f7 [ruby/reline] Fix wrong indent number in prompt. whole_lines has
duplicated line.
(https://github.com/ruby/reline/pull/460)

* whole_lines should consider prev_line_index, and must not duplicate last_line

* Add test for lines passed to dynamic prompt proc

* Refactor whole_lines parameters used in test helper

* Remove whole_line's arguments
2023-02-27 10:21:30 +00:00
Hiroshi SHIBATA db0a4c8923 Prefer to use File.foreach instead of IO.foreach 2023-02-27 18:49:18 +09:00
Hiroshi SHIBATA d3d8cd304f Prefer to use File.readlines instead of IO.readlines 2023-02-27 18:49:18 +09:00
tomoya ishida 92ed8e6f3f [ruby/reline] Fix the cause of test_yamatanooroti randomly failing
(https://github.com/ruby/reline/pull/474)

* Add repeated input-delete test that fails on HEAD

* Use raw mode while readmultiline
2023-02-27 08:44:02 +00:00
Yusuke Endoh b6704201a3 Add all-ruby-quine as a sample code
This sample code works on all release versions of Ruby, from Ruby 0.49.
2023-02-27 11:20:42 +09:00
Samuel Williams 57bc3f2f46
Add `IO::Buffer.string` for efficient string creation. (#7364) 2023-02-25 18:40:26 +13:00
Alan Wu 132934b82b
YJIT: Generate Block::entry_exit with block entry PC
Previously, when Block::entry_exit is requested from any instruction
that is not the first one in the block, we generated the exit with an
incorrect PC. We should always be using the PC for the entry of the
block for Block::entry_exit.

It was a simple typo. The bug was [introduced][1] while we were
refactoring to use the current backend. Later, we had a chance to spot
this issue while [preparing][2] to enable unused variable warnings, but
didn't spot the issue.

Fixes [Bug #19463]

[1]: 27fcab995e
[2]: 31461c7e0e
2023-02-24 16:18:53 -05:00
Peter Zhu 3e09822407 Fix incorrect line numbers in GC hook
If the previous instruction is not a leaf instruction, then the PC was
incremented before the instruction was ran (meaning the currently
executing instruction is actually the previous instruction), so we
should not increment the PC otherwise we will calculate the source
line for the next instruction.

This bug can be reproduced in the following script:

```
require "objspace"

ObjectSpace.trace_object_allocations_start
a =

  1.0 / 0.0
p [ObjectSpace.allocation_sourceline(a), ObjectSpace.allocation_sourcefile(a)]
```

Which outputs: [4, "test.rb"]

This is incorrect because the object was allocated on line 10 and not
line 4. The behaviour is correct when we use a leaf instruction (e.g.
if we replaced `1.0 / 0.0` with `"hello"`), then the output is:
[10, "test.rb"].

[Bug #19456]
2023-02-24 14:10:09 -05:00
Stan Lo 07403de5a8 [ruby/irb] Cleanup completion tests
(https://github.com/ruby/irb/pull/520)

* Remove redundant completion test

The test case was introduced to guard an old implementation, which relied
on `Module#name`. Commit:

8827d18274

However, the current implementation has avoided calling `Module#name`
completely, so the test case is no longer necessary. Commit:

88311ce3c8

* Remove unnecessary pend
2023-02-24 13:34:40 +00:00
Akinori MUSHA 5d5ff6e5ed [ruby/set] Set#merge does not take keyword arguments as a Hash
https://github.com/ruby/set/commit/ca1c9532a9
2023-02-24 11:48:08 +00:00
Akinori MUSHA 454ac4cbb2 [ruby/set] Set#merge takes many enumerable objects like Hash#merge! does
https://github.com/ruby/set/commit/becaca994d
2023-02-24 11:48:07 +00:00
Jean Boussier 2a5354e593 Implement ObjectSpace::WeakKeyMap basic allocator
[Feature #18498]
2023-02-23 16:01:57 +01:00
Nobuyoshi Nakada b112ae9971
Skip failing test on MSWin 2023-02-22 22:14:26 +09:00
Samuel Giddins 6232e1b9c0 [rubygems/rubygems] Skip extension test on jruby
https://github.com/rubygems/rubygems/commit/38ee82c297
2023-02-22 08:42:21 +00:00
Samuel Giddins 151ae9790f [rubygems/rubygems] Better teardown
https://github.com/rubygems/rubygems/commit/5fa0ebf09b
2023-02-22 08:42:20 +00:00
Samuel Giddins a17b1b19b1 [rubygems/rubygems] Always join with a string
Gem.path_separator can also be a regexp...

https://github.com/rubygems/rubygems/commit/7e6e56a5f3
2023-02-22 08:42:20 +00:00
Samuel Giddins 616a7e1f6c [rubygems/rubygems] Nil out Gem.configuration after tests
https://github.com/rubygems/rubygems/commit/3135ad91d4
2023-02-22 08:42:19 +00:00
Samuel Giddins ae5deb1ebc [rubygems/rubygems] Use assert_raise instead of assert_raises
For ruby-core compat

https://github.com/rubygems/rubygems/commit/c8f85c91a8
2023-02-22 08:42:19 +00:00
Samuel Giddins 931db21208 [rubygems/rubygems] Add tests covering pre-releases for gem exec
https://github.com/rubygems/rubygems/commit/f6877c29b9
2023-02-22 08:42:18 +00:00
Samuel Giddins 80bfa1b30a [rubygems/rubygems] Fix resetting env in gem exec, and make sure it is set for gem exec gem
https://github.com/rubygems/rubygems/commit/13a6dd4992
2023-02-22 08:42:18 +00:00
Samuel Giddins 2dd9698350 [rubygems/rubygems] Allow gem exec gem
https://github.com/rubygems/rubygems/commit/a767f7b9be
2023-02-22 08:42:17 +00:00
Samuel Giddins 47d4f73ee7 [rubygems/rubygems] Remove platform option for gem exec
Also fix native extensions that load dependencies

https://github.com/rubygems/rubygems/commit/a06f9870c7
2023-02-22 08:42:17 +00:00
Samuel Giddins 612ebd10c0 [rubygems/rubygems] Ensure dependencies are updated by default when running gem exec
https://github.com/rubygems/rubygems/commit/664f3e1e5f
2023-02-22 08:42:16 +00:00
Samuel Giddins d81be0609b [rubygems/rubygems] Add specs for gem exec
https://github.com/rubygems/rubygems/commit/3078e5834e
2023-02-22 08:42:16 +00:00
Hiroshi SHIBATA 015bf5c461
Removed accidentally commits with ruby/readline-ext
Partly reverted 1ddda4c0d7
2023-02-22 10:20:20 +09:00
Hiroshi SHIBATA fc59b58715 [ruby/readline-ext] test_readline.rb only needs EnvUtil
https://github.com/ruby/readline-ext/commit/9245965ecd
2023-02-22 01:18:26 +00:00
Hiroshi SHIBATA 088919065e [ruby/readline-ext] Omit some tests with macOS platform
https://github.com/ruby/readline-ext/commit/efe2be6e4c
2023-02-22 01:18:25 +00:00
Hiroshi SHIBATA 1ddda4c0d7 [ruby/readline-ext] Import EnvUtils and related test libraries
https://github.com/ruby/readline-ext/commit/f034697a48
2023-02-22 01:18:25 +00:00