... as per ko1's preference. He is preparing to extend this feature to
ISeq for his new debugger. He prefers "keep" to "save" for this wording.
This API is internal and not included in any released version, so I
change it in advance.
The existing implementation of `Net::HTTP#write_timeout` relies on
`Net::BefferedIO` to trigger the `Net::WriteTimeout` error. This commit
changes `send_request_with_body_stream` to remove the optimization that
was making `Net::HTTP#write_timeout` not work when `body_stream` is
used.
Open issue:
https://bugs.ruby-lang.org/issues/17933https://github.com/ruby/net-http/commit/a0fab1ab52
- Removed a largish block of repeated text.
- Added sections "Top List and Base List" and "Methods for Defining Options" (on, define, etc.).
- Linked from class OptionParser doc to the tutorial.
https://github.com/ruby/optparse/commit/7f3195b9db
* Using a module to map scheme name to scheme class, which also works with Ractor.
* No constant redefinition, no ObjectSpace, still fast lookup for initial schemes.
https://github.com/ruby/uri/commit/883567fd81
Bundler has deprecated gemfiles without a global source and this feature
is now obsolete. `Bundler::Definition#has_rubygems_remotes?` is removed
because it's not used anymore.
https://github.com/rubygems/rubygems/commit/d29dd2cb7b
`check_rubygems_source_safety` is responsible for:
1. if there are multiple global sources
- for bundle 3.x raise an error
- for bundle 2.x print a warning
2. print a warning if there is no explicit global source
The second responsibility was added recently and now the logic could be
extracted to improve readability. Conditions are still live in the `check_rubygems_source_safety` method
since we don't want to call both functions always and that would help us achieve that.
https://github.com/rubygems/rubygems/commit/f3d7e946ee
Raise a warning when parsing a Gemfile and it doesn't have a global source. Gemfiles like this, specially now that rubygems sources are are no longer merged into a single source for security, are very confusing because they generate a different lockfile depending on the gems you have locally installed. This is because bundler always use an implicit global source that defaults to locally installed gems.
https://github.com/rubygems/rubygems/commit/b7523ad21c
This method is created to tell whether any global source exist in the object or not and it will be used by `Bundler:Dsl` to print a warning if no global source has been defined in the Gemfile.
https://github.com/rubygems/rubygems/commit/422fec4438
This method is created to tell whether any remote exist in the object or not and it will be used by `Bundler:SourceList` to tell if a global source has been defined implicitly or not.
https://github.com/rubygems/rubygems/commit/47e3ff0e47
The is the previous intentional behaviour until
ca0676cb1c.
In my opinion, that previous behaviour was better and should be
restored, because we want our users to always see warnings and fix them.
And the original issue that motivated the change is fixable by other
means, namely through `BUNDLE_SILENCE_ROOT_WARNING`, or through
`BUNDLE_SILENCE_DEPRECATIONS` in general. Finally, the --quiet option is
still documented as "only print errors and warnings".
So this PR essentially reverts
ca0676cb1c
for the above reasons.
https://github.com/rubygems/rubygems/commit/35f2254dfc
After reading [this blog
post](https://blog.rubygems.org/2011/08/31/shaving-the-yaml-yak.html),
published almost 10 years ago already, my understanding is that this
problem could come up in two ways:
* Rubygems.org serving corrupted gemspecs". As far as I understand this
was fixed in rubygems.org a lot time ago, since
https://github.com/rubygems/rubygems.org/pull/331.
* Clients having a ten years old gemspec cache with some of these bad
gemspecs. In this case, there's no easy solution but I think ten years
is enough and rebuilding the cache should do the trick.
So, I think it's time we remove this.
https://github.com/rubygems/rubygems/commit/afcb15d556
A fresh `gem install` might not reproduce the exact `bundle install`
environment that originally caused the error. It also makes it harder
for the user to troubleshoot the error since she needs to run a separate
command.
Instead, show the original error and backtrace directly.
https://github.com/rubygems/rubygems/commit/49c2abfec6
To mimic built-in rubygems behaviour, only thing that should be
approximated is the lockfile version. Other alternatives like
`BUNDLER_VERSION` should be respected exactly.
https://github.com/rubygems/rubygems/commit/dbd667d4bc
Ruby 1.9.2 removed "." from LOAD_PATH for robustness and security reasons.
This code was introduced by 56fc830e19 commit
to helping users understand the issue and had a guard condition to include the message for `RUBY_VERSION >= "1.9"`.
However, the guard condition was removed as part of the "Ruby version leftover" cleanup by
8c9cf76e41
Ruby 1.9 development was ended a long time ago and this message is not useful anymore.
https://github.com/rubygems/rubygems/commit/a23609b15a
The existing interrupt handling using `SharedHelpers.trap` fails when the previous
handler for a signal is not callable (for example, when it is the string "DEFAULT").
Instead, we now handle interrupts by aborting the process when worker threads are
running, and restore the previous handler after worker threads are finished.
Fixes#4764.
https://github.com/rubygems/rubygems/commit/b9f455d487
it turns out that running `bundle plugin uninstall some-plugin` would remove that plugin from the list of hooks, but if the list of hooks for an event was now empty, we would serialize the empty array into yaml as an empty single bullet item. which would then get unserialized as a plugin with the name empty string. which we would then try to load and explode. 😬https://github.com/rubygems/rubygems/commit/545ebba9a5
When a development dependency was duplicated inside the gemspec and
Gemfile with the same requirements, we went from printing a warning to
removing the gem altogether.
This change makes it not print a warning, but don't remove the gem
either.
https://github.com/rubygems/rubygems/commit/8bb2488131
Now, the highlight line is created by replacing non-tab characters with
spaces, and keeping all hard tabs as-is. This means the highlight line
has the completely same indentation as the code snippet line.
Fixes#7https://github.com/ruby/error_highlight/commit/38f20fa542
This fixes at least an issue where irb will incorrectly assume
code opens a heredoc when it does not, such as this code:
```ruby
s1 = 'testing'
s2 = 'this'
s2 <<s1
p s1
s1
```
Ruby parses the `s2 <<s1` as `s2.<<(s1)`, not as a heredoc, because
`s2` is a local variable in scope. irb was using ripper without
letting ripper know that `s2` was a local variable, so ripper would
lex it as a heredoc instead of a method call.
Fix the situation by prepending a line at line 0 with all local
variable definitions in scope whenever lexing. This fixes the
heredoc issue, and potentially other issues that depend on whether
an identifier is a local variable or not.
Fixes [Bug #17530]
https://github.com/ruby/irb/commit/4ed2187f76
ri supports 'ruby:' as a kind of "pseudo gem name" to display files of the core Ruby documentation such as syntax and NEWS. Add the appropriate documentation to the description of options shown by "ri --help".
https://github.com/ruby/rdoc/commit/a0e5df6702
Previously, did_you_mean used `msg.end_with?(suggestion)` to check if
its suggestion is already added.
I'm now creating a gem that also modifies Exception's message. This
breaks did_you_mean's duplication check.
This change makes the check use String#include? instead of end_with?.
https://github.com/ruby/did_you_mean/commit/b35e030549
Previously, DidYouMean::Correctable#original_message did
`method(:to_s).super_method.call` to call the original to_s method by
skipping Correctable#to_s.
I'm now creating a gem that prepends another to_s method to NameError,
which confuses the hack. An immediate solution is to replace it with
`method(:to_s).super_method.super_method.call` to skip the two methods.
But it is too ad-hoc.
This changeset uses more extensible approach and allow a prepended
module to declare that they should be skipped by defining a constant
named `SKIP_TO_S_FOR_SUPER_LOOKUP`.
https://github.com/ruby/did_you_mean/commit/8352c154e3
https://github.com/ruby/irb/pull/249 actually slowed down how `code` is
concatenated. The original way of creating `code` is faster.
[before]
user system total real
2.420137 0.005364 2.425501 ( 2.426264)
[after]
user system total real
1.000221 0.007454 1.007675 ( 1.008295)
Theoretically, this implementation might skip lines that don't appear in
Ripper tokens, but this assumes such lines don't impact whether the code
passes compilation or not. At least normal blank lines seem to have an
`on_ignored_nl` token anyway though.
https://github.com/ruby/irb/commit/27dd2867cd
It is unclear why this was implemented, I assume
it was for performance back in 2006.
However today, this compression defeats bytecode caching
entirely and end up being counter productive.
https://github.com/ruby/racc/commit/ae3703c1d0
This fixes an error when output is redirected:
```
$ run_ruby -rreline -e '$stderr.puts Reline::Unicode.calculate_width("\u221a").inspect' </dev/null >/dev/null
/home/jeremy/tmp/ruby/lib/reline/ansi.rb:189:in `raw': Operation not supported by device (Errno::ENODEV)
```
The @@encoding -> defined?(@@encoding) changes is necessary because
without that part of the commit, the following error would be raised
by the above command:
```
/home/jeremy/tmp/reline/lib/reline/general_io.rb:10:in `encoding': uninitialized class variable @@encoding in Reline::GeneralIO (NameError)
```
Problem reported and initial patch for Windows provided by
Richard Sharman.
I tested this only on OpenBSD, but hopefully it works for other
operating systems.
Fixes [Bug #17493]
https://github.com/ruby/reline/commit/c001971bb3
This change ensures we use `Reline::IOGate`'s `encoding` when converting
characters from their integer values.
This fixes an issue that may occur if you have UTF characters in your
`.inputrc`, but your default encoding isn't set.
For example:
```
> 127864.ord.chr
RangeError: 127864 out of char range
from (pry):1:in `chr'
> Reline::IOGate.encoding
=> #<Encoding:UTF-8>
> 127864.ord.chr(Reline::IOGate.encoding)
=> "🍸"
```
https://github.com/ruby/reline/commit/cf372fc0fc