Commit graph

14675 commits

Author SHA1 Message Date
Jean byroot Boussier
6deeec5d45
Mark strings returned by Symbol#to_s as chilled (#12065)
* Use FL_USER0 for ELTS_SHARED

This makes space in RString for two bits for chilled strings.

* Mark strings returned by `Symbol#to_s` as chilled

[Feature #20350]

`STR_CHILLED` now spans on two user flags. If one bit is set it
marks a chilled string literal, if it's the other it marks a
`Symbol#to_s` chilled string.

Since it's not possible, and doesn't make much sense to include
debug info when `--debug-frozen-string-literal` is set, we can't
include allocation source, but we can safely include the symbol
name in the warning message, making it much easier to find the source
of the issue.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>

---------

Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com>
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-11-13 09:20:00 -05:00
David Rodríguez
ae733a693b [rubygems/rubygems] Include original error when openssl fails to load
440343b791
2024-11-13 08:35:40 +00:00
Orien Madgwick
942ec7ab33 [ruby/uri] Remove rakelib/ dir from gem also
a0dd612e90
2024-11-13 05:07:53 +00:00
Orien Madgwick
7d5fdd97cc [ruby/uri] Remove unused files from the gem package
f0847c266c
2024-11-13 05:07:53 +00:00
Hiroshi SHIBATA
441069c093 We can't handle optional dependency without new API of Rubygems.
I don't want to make bundled_gems.rb more complex and complicate.

Revert "Fixed warning condition with LoadError"

This reverts commit 3a9e48b9a4.

Revert "Only warn fiddle as optional dependency"

This reverts commit ff3f61556f.

Revert "Only `warn` about bundled gems when require succeeds"

This reverts commit a70adce1ce.
2024-11-13 13:47:36 +09:00
Benoit Daloze
6c123649cd [ruby/prism] Use RbConfig to locate libprism and headers when it is a default gem
* This is notably necessary on TruffleRuby, which is updating to Ruby 3.3 which introduces Prism as a default gem.
* Using the existing path is not an option as it would end up in truffleruby/lib/build/libprism.so and
  "truffleruby/lib/include/#{header}" which are not good places for such files.

5d16473e69
2024-11-12 14:20:39 +00:00
License Update
dc08d6e917 [rubygems/rubygems] Update SPDX license list as of 2024-08-19
5a094cbfab
2024-11-12 08:06:36 +00:00
Nobuyoshi Nakada
c7c73b22bb
Fix commit miss [ci skip] 2024-11-12 11:53:01 +09:00
Nobuyoshi Nakada
8d4ba9d443
CI: check_dependencies.yml is now required [ci skip]
`paths-ignore` cannot be used for required status checks.
2024-11-12 11:37:04 +09:00
Hiroshi SHIBATA
bf741c6fac [ruby/pp] Fixed file list for pp gem
b192896a1d
2024-11-12 02:34:23 +00:00
Hiroshi SHIBATA
9a55375df7
Removed unused variable 2024-11-12 11:31:40 +09:00
Hiroshi SHIBATA
400f78939c [ruby/pp] Bump up v0.6.0
af2229e8e6
2024-11-12 02:18:17 +00:00
Jean Boussier
83702f7157 [ruby/pp] Handle BasicObject
Right now attempting to pretty print a BasicObject or any other
object lacking a few core Object methods will result in an error

```
Error: test_basic_object(PPTestModule::PPInspectTest): NoMethodError: undefined method `is_a?' for an instance of BasicObject
lib/pp.rb:192:in `pp'
lib/pp.rb:97:in `block in pp'
lib/pp.rb:158:in `guard_inspect_key'
lib/pp.rb:97:in `pp'
test/test_pp.rb:131:in `test_basic_object'
     128:
     129:   def test_basic_object
     130:     a = BasicObject.new
  => 131:     assert_match(/\A#<BasicObject:0x[\da-f]+>\n\z/, PP.pp(a, ''.dup))
     132:   end
     133: end
     134:
```

With some fairly small changes we can fallback to `Object#inspect`
which is better than an error.

4e9f6c2de0
2024-11-12 02:13:15 +00:00
Jean Boussier
107a4da122 [ruby/pp] Data#pretty_print handle privated or removed members
[Bug #20808]

The previous implementation assumed all members are accessible,
but it's possible for users to change the visibility of members or
to entirely remove the accessor.

fb19501434
2024-11-12 02:11:43 +00:00
David Rodríguez
db0c7be642 [rubygems/rubygems] Add a lockfile_checksums configuration to include checksums in fresh lockfiles
50b9ef8589
2024-11-11 19:24:42 +00:00
tomoya ishida
25d17868de [ruby/reline] Refactor perform_completon
(https://github.com/ruby/reline/pull/778)

Flatten recursive method
Remove CompletionState::COMPLETE

aa5b278f3d
2024-11-11 15:31:04 +00:00
David Rodríguez
a1148d4aad [rubygems/rubygems] Cancel bundle console deprecation
506a863b36
2024-11-11 12:49:26 +00:00
Hiroshi SHIBATA
461fa56e10 [ruby/securerandom] Bump up v0.3.2
9703d96a76
2024-11-11 09:00:08 +00:00
Hiroshi SHIBATA
a6ad6f350d [ruby/resolv] Bump up v0.5.0
c4837aae9b
2024-11-11 03:07:12 +00:00
Joe Rafaniello
25252677f9 [ruby/uri] Fix minor typo from
9997c1acee

c191b627cb
2024-11-11 02:42:53 +00:00
David Rodríguez
bb6a3edadf
Bump vendored uri to 1.0.1 2024-11-11 09:53:28 +09:00
tomoya ishida
5eaa4c76c6 [ruby/reline] Remove unused things from reline/unicode.rb
(https://github.com/ruby/reline/pull/759)

* Remove garbage(nil) from Reline::Unicode.split_by_width result

* Remove unused width from Reline::Unicode vi_ ed_ em_ method return value

* Remove unused height from Unicode.split_by_width return value

* Rename split_by_width to split_line_by_width and add legacy split_by_width for IRB

f32446ebc4
2024-11-10 19:11:58 +00:00
samisalamiws
fbe35bcc82 [rubygems/rubygems] Fix private registry credentials being written to logs
d070fa10c1

Co-authored-by: Artem Ignatyev <zazubrik@gmail.com>
2024-11-08 12:15:31 +00:00
David Rodríguez
10d694a1ff [rubygems/rubygems] Warn on insecure materialization
bc2537de71
2024-11-08 12:06:32 +00:00
David Rodríguez
7f2db15732 [rubygems/rubygems] Small tweak
98641d21a2
2024-11-08 12:06:30 +00:00
David Rodríguez
4d83f37ff7 [rubygems/rubygems] Reduce global state
43c0c41c6b
2024-11-08 12:06:30 +00:00
David Rodríguez
ebf07f7a9c [rubygems/rubygems] Remove unnecessary attribute
It's defined in the superclass already.

e269f5477b
2024-11-08 12:06:29 +00:00
David Rodríguez
bf35b2c0fe [rubygems/rubygems] Cleaner extension of Gem::Specification to be able to set source
3749273ec6
2024-11-08 12:06:29 +00:00
David Rodríguez
50e6363ea4 [rubygems/rubygems] Remove accessor that's been unused for years
ffd2fbaf6c
2024-11-08 12:06:28 +00:00
David Rodríguez
f7b334e002 [rubygems/rubygems] Add bundle lock --add-checksums to add checksums to an existing lockfile
0a9c1ce60d
2024-11-08 10:27:03 +00:00
David Rodríguez
1f62a98f73 [rubygems/rubygems] Remove no longer necessary hacks to define the gem command
We did this because RubyGems `require` would call `gem` on self, so
defining a `gem` method in the CLI would cause conflicts. However, this
is not the case since
439c446489,
so this should no longer be necessary.

3e5c861046
2024-11-08 10:26:45 +00:00
Hiroshi SHIBATA
35d8427b8b [ruby/uri] Bump up v1.0.1
3011eb6f6e
2024-11-08 06:07:54 +00:00
Hiroshi SHIBATA
d7c65398e0 [ruby/uri] Added more fallback constants like URI::PARTTERN and URI::REGEXP
Fixed https://github.com/ruby/uri/issues/125

1f3d3df02a
2024-11-08 06:06:30 +00:00
Hiroshi SHIBATA
7c9cda9b52 [ruby/time] Bump up v0.4.1
539b151049
2024-11-08 05:00:24 +00:00
Hiroshi SHIBATA
a698b5ebb8 [ruby/optparse] Bump up v0.6.0
080360ffd4
2024-11-08 04:22:33 +00:00
Hiroshi SHIBATA
475e8f8c46 [ruby/pstore] Bump up v0.1.4
a63a70a830
2024-11-08 04:05:28 +00:00
Hiroshi SHIBATA
82dfdb8646 [ruby/singleton] Bump up v0.3.0
256c91171b
2024-11-08 03:54:21 +00:00
Mari Imaizumi
306ce9a9e0 [ruby/reline] Bump version to 0.5.11
(https://github.com/ruby/reline/pull/777)

4d90743409
2024-11-08 03:38:15 +00:00
YO4
b99c17a95b [ruby/reline] Windows fix (https://github.com/ruby/reline/pull/775)
* test_yamatanooroti: close tempfile before unlink

* test_yamatanooroti: omit because of windows does not support job control

* test_yamatanooroti: change startup message detection for windows

* windows.rb: can call win32api using nil as NULL for pointer argument

Exception occurred when interrupted with Ctrl+C on legacy conhost

* windows.rb: fix get_screen_size

return [window height, buffer width] insted of [buffer height, buffer width]

* windows.rb: import scroll_down() from ansi.rb

* windows.rb: add auto linewrap control if VT output not supported (legacy console)

* unfreeze WIN32API pointer arguments

They internally duplicate arguments so api functions write to another place.
This breaks the console mode detection with ruby-head.

* remove useless code from Win32API#call

argument repacking and return value tweaking is not needed for Reline::Windows requirements.

* Correctly handle top of console viewport

* Revert "remove useless code from Win32API#call"

This reverts commit 060ba140ed.

* Revert "windows.rb: can call win32api using nil as NULL for pointer argument"

This reverts commit 93a23bc5d0.

47c1ffbabe
2024-11-08 03:28:57 +00:00
Hiroshi SHIBATA
3406e8aad9 [ruby/benchmark] Bump up v0.4.0
a5d77ceae0
2024-11-08 02:45:51 +00:00
Kaíque Kandy Koga
9523f53465
[ruby/benchmark] Adjust ljust Benchmark#bm with labels was not using the highest length among the labels to adjust the correct ljust. Instead of printing the result during the report generation, now it is waiting to print the result once it is generated.
Benchmark.bm { |x|
  x.item("aaaa") { 1 }
  x.item("aaaaaaaa") { 0 }
}

After

              user     system      total        real
aaaa      0.000005   0.000002   0.000007 (  0.000003)
aaaaaaaa  0.000001   0.000001   0.000002 (  0.000002)

Before

       user     system      total        real
aaaa  0.000005   0.000001   0.000006 (  0.000003)
aaaaaaaa  0.000002   0.000001   0.000003 (  0.000003)

3e74533ead
2024-11-08 11:32:30 +09:00
Hiroshi SHIBATA
74077a99bf [ruby/ostruct] Bump up v0.6.1
b38680089f
2024-11-08 01:35:02 +00:00
Hiroshi SHIBATA
c05f849cf2 [ruby/ostruct] Update license files same as ruby/ruby
85a773bb41
2024-11-08 01:27:59 +00:00
Kouhei Yanagita
3f7c72cd33 [ruby/irb] Correct ja/help-message for --context-mode and --prompt
(https://github.com/ruby/irb/pull/1029)

b21432daf7
2024-11-07 12:52:01 +00:00
David Rodríguez
ffcfaf4ce4 [rubygems/rubygems] Undeprecate Gemfiles without a global source
After having a second look at this deprecation, the explanation that
we're giving does not make a lot of sense. When working only with local
gems, Bundler will indeed generate a different lockfile depending on
the latest installed version of each gem is at `bundle install` time.

That's the same situation that happens with remote sources: Bundler will
generate a different lockfile depending on the latest version of each
gem available remotely.

So, I don't think "a consistent lockfile not getting generated" is a
good motivation for deprecating this.

Also, this deprecation brings additional challenges, since for example,
it should arguably not get printed when using `bundle install --local`?

The original problem when this deprecation was introduced was an
incorrect message about a missing gem having been yanked.

So, I think a better solution is to, as long as we give proper error
messages when things go wrong, let users do what's best for them and
undo the deprecation.

17499cb83f
2024-11-07 10:03:54 +00:00
Hiroshi SHIBATA
fb6645a510 [ruby/uri] Bump up v1.0.0
af8d9d6bb1
2024-11-07 06:52:30 +00:00
Hiroshi SHIBATA
72bc698419 [ruby/net-http] Bump up v0.5.0
28a4bf9295
2024-11-07 02:39:23 +00:00
Hiroshi SHIBATA
849e651d51 [ruby/delegate] Bump up v0.4.0
713059a5e9
2024-11-07 02:26:50 +00:00
Hiroshi SHIBATA
cf70564c97 [ruby/delegate] Bump up required ruby version to 3.0
6daeb4248f
2024-11-07 02:26:50 +00:00
Hartley McGuire
342455e56f [ruby/logger] Enable subclasses to configure level isolation
(https://github.com/ruby/logger/pull/103)

`Logger#with_level` was recently added to enable configuring a
`Logger`'s level for the duration of a block. However, the configured
level is always tied to the currently running `Fiber`, which is not
always ideal in applications that mix `Thread`s and `Fiber`s.

For example, Active Support has provided a similar feature
(`ActiveSupport::Logger#log_at`) which, depending on configuration, can
be isolated to either `Thread`s or `Fiber`s.

This commit enables subclasses of `Logger` to customize the level
isolation. Ideally, it will enable replacing most of Active Support's
`#log_at`, since both methods end up serving the same purpose.

dae2b832cd
2024-11-07 00:17:16 +00:00