* 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>
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.
* 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
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
[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
(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
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
* 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
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
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
(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