2426 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
16c5e34c74 Use rake-13.2.1 2024-04-05 17:36:16 +09:00
David Rodriguez
58d03c3458 [rubygems/rubygems] Fix crash with development bundler binstub
Fixes the following error:

````
$ ruby /home/deivid/code/rubygems/rubygems/bundler/spec/support/bundle.rb clean --force
--- ERROR REPORT TEMPLATE -------------------------------------------------------

```
TypeError: no implicit conversion of Pathname into String
  /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/runtime.rb:167:in `match'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/runtime.rb:167:in `block in clean'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/runtime.rb:164:in `each'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/runtime.rb:164:in `clean'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/cli/clean.rb:13:in `run'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/cli.rb:590:in `clean'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/cli.rb:34:in `dispatch'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/cli.rb:28:in `start'
          /home/deivid/code/rubygems/rubygems/bundler/exe/bundle:28:in `block in <top (required)>'
          /home/deivid/code/rubygems/rubygems/bundler/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
          /home/deivid/code/rubygems/rubygems/bundler/exe/bundle:20:in `<top (required)>'
          /home/deivid/code/rubygems/rubygems/bundler/spec/support/bundle.rb:5:in `load'
          /home/deivid/code/rubygems/rubygems/bundler/spec/support/bundle.rb:5:in `<main>'

```
(...)
````

https://github.com/rubygems/rubygems/commit/ff7ce7eb6d
2024-04-05 09:34:51 +09:00
Nobuyoshi Nakada
ce395d7e90
Reset $. before matching
This is a global variable and may happen to be set to 4 elsewhere.

http://ci.rvm.jp/logfiles/brlog.trunk.20240403-054356#L1707
```
The if expression with a boolean range ('flip-flop' operator) warns when Integer literals are used instead of predicates FAILED
Expected [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] == []
to be truthy but was false
```
2024-04-03 07:38:52 +00:00
Andrew Konchin
1e5949bd60 Update to ruby/spec@573cf97 2024-04-02 10:50:30 +02:00
Hiroshi SHIBATA
a65d49ce77 Use Rake 13.2.0 2024-04-02 11:22:14 +09:00
Kevin Newton
cc6668c656 [PRISM] Enable passing pattern matching tests 2024-04-01 15:08:50 -04:00
David Rodriguez
e2a1d0b53d [rubygems/rubygems] Improve error message when strict resolution filters out everything
https://github.com/rubygems/rubygems/commit/1ea44b3749
2024-04-01 15:03:28 +00:00
David Rodriguez
d69ef1cc52 [rubygems/rubygems] Let GemVersionPromoter sort in preferred order directly
So that we don't need to reverse the Array.

https://github.com/rubygems/rubygems/commit/aeea5e2e00
2024-04-01 15:03:25 +00:00
David Rodriguez
0a1e36964d [rubygems/rubygems] Remove unnecessary filtering
We do that when first caching versions, and then it's no longer
necessary.

https://github.com/rubygems/rubygems/commit/ede15847db
2024-04-01 15:03:25 +00:00
Alex Robbin
d7d59ea172 [rubygems/rubygems] add test case to ensure updating with multiple sources + caching maintains the right lockfile
https://github.com/rubygems/rubygems/commit/65839757e6
2024-03-29 19:27:28 +00:00
Kevin Newton
8191735b73 [PRISM] Fix BEGIN{} execution order 2024-03-29 08:51:04 -04:00
Kevin Newton
a8f902ea8e [PRISM] Add debug info for frozen strings 2024-03-28 15:17:29 -04:00
Kevin Newton
3e9c684236 [PRISM] Allow space before encoding comment 2024-03-28 13:02:06 -04:00
Kevin Newton
f7c5e11d89 [PRISM] Use new -x prism API 2024-03-28 12:04:35 -04:00
Nobuyoshi Nakada
4fa8fefd9c
Suppress warning at literal string 2024-03-28 23:19:39 +09:00
Hiroshi SHIBATA
7630a89a4b Use www.rfc-editor.org for RFC text.
We use the following site for that now:

* https://tools.ietf.org/ or http
* https://datatracker.ietf.org or http

Today, IETF said the official site of RFC is www.rfc-editor.org.

FYI: https://authors.ietf.org/en/references-in-rfcxml

I replaced them to www.rfc-editor.org.
2024-03-28 11:44:45 +09:00
Kevin Newton
eb995a6410 [PRISM] Include file and line in error message 2024-03-27 14:19:58 -04:00
Kevin Newton
42d1cd8f7f [PRISM] Pass --enable-frozen-string-literal through to evals 2024-03-27 08:34:42 -04:00
Kevin Newton
a1ae29e87d [PRISM] Enable other passing specs 2024-03-27 08:34:42 -04:00
Cody Cutrer
44b5c912da [rubygems/rubygems] Allow installing plugins from path via CLI
Also bring the man page up to date.

https://github.com/rubygems/rubygems/commit/a849bd6947
2024-03-27 11:34:46 +00:00
crazeteam
b2b665eba5 [DOC] remove repetitive words in comments
Signed-off-by: crazeteam <lilujing@outlook.com>
2024-03-27 07:52:18 +09:00
Cody Cutrer
552647175e [rubygems/rubygems] Improve validation of bundle plugin install options
Ensure only one source type is specified, and ensure options that
are only relevant to git sources are only specified with git.

https://github.com/rubygems/rubygems/commit/58b043215e
2024-03-25 14:25:46 +00:00
David Rodriguez
7b3ef370f8 [rubygems/rubygems] Fix incorrect bundle update --bundler message
https://github.com/rubygems/rubygems/commit/146de56353
2024-03-22 13:14:42 +00:00
Benoit Daloze
74995a1a77 [Feature #20275] Remove extra backtrace entries for rescue and ensure 2024-03-22 12:30:15 +01:00
Kevin Newton
0e8b6c62a4 [PRISM] Enable specs in CI 2024-03-20 14:28:13 -04:00
Étienne Barrié
12be40ae6b Implement chilled strings
[Feature #20205]

As a path toward enabling frozen string literals by default in the future,
this commit introduce "chilled strings". From a user perspective chilled
strings pretend to be frozen, but on the first attempt to mutate them,
they lose their frozen status and emit a warning rather than to raise a
`FrozenError`.

Implementation wise, `rb_compile_option_struct.frozen_string_literal` is
no longer a boolean but a tri-state of `enabled/disabled/unset`.

When code is compiled with frozen string literals neither explictly enabled
or disabled, string literals are compiled with a new `putchilledstring`
instruction. This instruction is identical to `putstring` except it marks
the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags.

Chilled strings have the `FL_FREEZE` flag as to minimize the need to check
for chilled strings across the codebase, and to improve compatibility with
C extensions.

Notes:
  - `String#freeze`: clears the chilled flag.
  - `String#-@`: acts as if the string was mutable.
  - `String#+@`: acts as if the string was mutable.
  - `String#clone`: copies the chilled flag.

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-19 09:26:49 +01:00
Cody Cutrer
cb029fa4e8 [rubygems/rubygems] Deprecate bundle plugin install --local-git=
It's the exact same implementation as --git

https://github.com/rubygems/rubygems/commit/18eb2418c6
2024-03-18 11:42:37 +00:00
Jean Boussier
8a8df49174 Update set_backtrace documentation
Followup: https://github.com/ruby/ruby/pull/10017

[Feature #13557]
2024-03-18 08:55:46 +01:00
David Rodriguez
dc06375c4f [rubygems/rubygems] Ignore commented out keys in config file
https://github.com/rubygems/rubygems/commit/c4a8d2a930
2024-03-17 22:55:16 +00:00
Nobuyoshi Nakada
d4a53b465a
Prefer the simple read/write File singleton methods 2024-03-16 23:29:06 +09:00
Benoit Daloze
ed2f685253 Update to ruby/spec@89175b2 2024-03-14 21:44:53 +01:00
Benoit Daloze
1d9f99144b Update to ruby/mspec@b8f8f4e 2024-03-14 21:44:52 +01:00
Peter Zhu
ff51dc5654 [Feature #20265] Remove rb_newobj_of and RB_NEWOBJ_OF 2024-03-14 12:53:04 -04:00
Jean Boussier
315bde5a0f Exception#set_backtrace accept arrays of Backtrace::Location
[Feature #13557]

Setting the backtrace with an array of strings is lossy. The resulting
exception will return nil on `#backtrace_locations`.

By accepting an array of `Backtrace::Location` instance, we can rebuild
a `Backtrace` instance and have a fully functioning Exception.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2024-03-14 11:38:40 +01:00
Jean Boussier
a5c5f83b24 Make const_source_location return the real constant as soon as defined
[Bug #20188]

Ref: https://github.com/fxn/zeitwerk/issues/281#issuecomment-1893228355

Previously, it would only return the real constant location once the
autoload was fully completed.
2024-03-13 09:39:09 +01:00
Hiroshi SHIBATA
2bc4575ac0 Removed unused fixtures at time examples 2024-03-07 10:05:53 +09:00
Nobuyoshi Nakada
29d3d13a1f
Run binding.irb in cleaner environment and clean the history file 2024-03-06 20:44:09 +09:00
Hiroshi SHIBATA
51965399df Use include instead of equal assertion.
irb will load multiple rc files now. If developer have their rcfile on
home directory or etc, equal assertion will fail with custom prompt.
2024-03-06 10:38:25 +09:00
cui fliter
226a889dc7
[DOC] fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 18:50:47 +09:00
Nobuyoshi Nakada
b582e5a6e9 [rubygems/rubygems] Clear generated files recursively
On macOS, `dsymutil` utility splits debug info into .dSYM directory.
Glob list of `.bundle/cache/extensions/**/*binary_c*` includes that
directory but `FileUtils.rm` fails to unlink a directory.

https://github.com/ruby/ruby/actions/runs/8149918901/job/22275331688#step:11:3000
```
       Operation not permitted @ apply2files - /Users/runner/work/ruby/ruby/src/tmp/2/home/.bundle/cache/extensions/arm64-darwin-22/ruby/3.4.0+0/3b02a1011c53518f911ab3a9e8c6c608/very_simple_binary-1.0/very_simple_binary_c.bundle.dSYM
     # ./lib/fileutils.rb:2332:in 'File.unlink'
     # ./lib/fileutils.rb:2332:in 'block in FileUtils::Entry_#remove_file'
     # ./lib/fileutils.rb:2337:in 'FileUtils::Entry_#platform_support'
     # ./lib/fileutils.rb:2331:in 'FileUtils::Entry_#remove_file'
     # ./lib/fileutils.rb:1475:in 'FileUtils.remove_file'
     # ./lib/fileutils.rb:1223:in 'block in FileUtils.rm'
     # ./lib/fileutils.rb:1222:in 'FileUtils.rm'
     # ./spec/bundler/install/global_cache_spec.rb:235:in 'block (3 levels) in <top (required)>'
```

https://github.com/rubygems/rubygems/commit/375c127684
2024-03-05 07:13:39 +00:00
Yuta Saito
ef5af32799 [rubygems/rubygems] Clear RUBY_CODESIGN env var while running tests
The `RUBY_CODESIGN` environment variable is used by mkmf-generated
Makefile to sign extension bundles on macOS. The variable specifies a
key identifier to use for signing given by the user. However, the key
is usually stored in `$HOME/Library/Keychains` directory, and the test
suite creates a fake `$HOME` directory. This causes the test suite to
try to find the specified key from the fake home directory, which
results in a failure.

https://github.com/rubygems/rubygems/commit/ddcfc65bf7
2024-03-04 06:36:29 +00:00
Thomas Marshall
7e4b1f8e19
[Bug #20322] Fix rb_enc_interned_str_cstr null encoding
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be
a null pointer, but this currently causes a segmentation fault when
trying to autoload the encoding. This commit fixes the issue by checking
for NULL before calling `rb_enc_autoload`.
2024-03-03 10:43:35 +00:00
Nobuyoshi Nakada
9b75e5f085
Add an example for fallback to sh 2024-03-01 13:56:52 +09:00
Kevin Newton
49aa8d655e [PRISM] Fix version spec to account for prism 2024-02-28 11:42:49 -05:00
Kenta Murata
54a5b82944
Handle zero-like imaginary part as zero in to_r (#9581)
Fixes [Bug #5179]
2024-02-27 09:37:03 +09:00
Benoit Daloze
815db5c028 Update to ruby/spec@3a510bb 2024-02-26 14:45:30 +01:00
Benoit Daloze
40c9a3dad5 Update to ruby/mspec@36e8ed8 2024-02-26 14:45:28 +01:00
Peter Zhu
510404f2de Stop using rb_fstring publicly
rb_fstring is a private API, so we should use rb_str_to_interned_str
instead, which is a public API.
2024-02-23 13:33:46 -05:00
Nobuyoshi Nakada
8c5b7eb05f
[Bug #20280] Fix wrong tests 2024-02-19 16:33:27 +09:00
Hiroshi SHIBATA
a52fc5df7a [rubygems/rubygems] Use FileUtils.mkdir_p
https://github.com/rubygems/rubygems/commit/af806b8dff
2024-02-19 05:45:51 +00:00