REGEXP is defined as RFC2396_REGEXP in lib/uri/common.rb. If we include
REGEXP then a broken URL is generated in rdoc for URI and URI::MailTo.
https://github.com/ruby/uri/commit/ed6ded9c80
There was a file for WSS so I added one line of `require_relative`
to make it work.
Now `URI.parse('wss://example.com')` returns `URI::WS`.
https://github.com/ruby/uri/commit/ff8a103564
The ignore_eof setting on HTTPResponse makes it so an EOFError is
raised when reading bodies with a defined Content-Length, if the
body read was truncated due to the socket be closed.
The ignore_eof setting on HTTP sets the values used in responses
that are created by the object.
For backwards compatibility, the default is for both settings is
true. However, unless you are specifically tested for and handling
truncated responses, it's a good idea to set ignore_eof to false so
that errors are raised for truncated responses, instead of those
errors silently being ignored.
Fixes [Bug #14972]
https://github.com/ruby/net-http/commit/4d47e34995
Bundler vendors this file and we have some tools to automatically
prepend the `Bundler::` namespace so that the vendored version does not
collide with the stdlib version.
However, due to how methods are defined, it's hard for our vendoring
tool to do the right thing.
I think this makes the code simpler and things easier for us too.
https://github.com/ruby/tsort/commit/7088a7c814
Previously, the content-encoding header was removed and the body
was modified, but the content-length header was not modified,
resulting in the content-length header not matching the body
length.
Don't delete content-length before yielding inflate body, as that
causes a switch to read the entire body instead of reading in
chunks.
Fixes [Bug #16672]
https://github.com/ruby/net-http/commit/58284e9710
Co-authored-by: st0012 <stan001212@gmail.com>
This allows for the ability to opt-in to a method to set the
encoding of response bodies. By setting the accessor to a String
or Encoding instance, it will use the specified encoding.
Setting the value of true will try to detect the encoding of the
response body, either using the Content-Type header (assuming it
specifies charset) or by scanning for a <meta> tag in the document
that specifies the encoding. The default is false in which case
no forcing of encoding will be done (same as before the patch).
Implements [Feature #2567]
Implements [Feature #15517]
https://github.com/ruby/net-http/commit/6233e6b7c1
Co-authored-by: Yui Naruse <naruse@ruby-lang.org>
This method is at least 7 years old and is widely used in the wild.
Since we need to support it, let's document it to make it discoverable.
Add docs and move it out of the `# :stopdoc:` zone.
Previously, the content-encoding header was removed and the body
was modified, but the content-length header was not modified,
resulting in the content-length header not matching the body
length.
Fixes [Bug #16672]
https://github.com/ruby/net-http/commit/a7cb30124c
This is hiding a real bundler issue as a "network error". It's more
helpful to get a proper bug report, with stack trace and so on.
So stop re-raising errors when evaluating unmarshaled responses as
network errors, and only raise Marshal errors when the Marshal format is
invalid, not whenever marshalled gemspecs can't be loaded because that
may hide actual client errors, like missing `YAML` constants.
https://github.com/rubygems/rubygems/commit/05ea907e1c
Properly set the name of `File::Constants`, which is the only name
with a namespace in `RDoc::KNOWN_CLASSES`, and fixes longstanding bug
that `File::Constants` becomes `File::File::Constants`.
When it is generated by `rb_file_const` in dir.c, `name` is set to the
qualified name as same as `full_name`, and generated in the normal way
in file.c later, already set `full_name` is cleared and `name` will be
constructed from the enclosing namespace and the `name`. It will
results in duplicated namespace, `File::File::Constants`.
https://github.com/ruby/rdoc/commit/3a8d6df562
The note
> Raises an ArgumentError if the given +orig+ is immutable, such as Symbol,
> Integer, or Float.
has not been true since #2313 (GH-2313, Feature #16035) when
@casperisfine enabled storing non-finalizable objects in the underlying
`ObjectSpace::WeakMap`.
On Ruby 2.7+, `WeakRef.new(1) + 1` works fine and the result is the
expected 2.
For example, consider the following markup:
C1#m(a, b)
Before this patch, it generated this HTML:
<p><a href=\"C1.html#method-i-m\"><code>C1#m</code></a>(a, b)</p>
Which places the method arguments outside of the link.
Now it generates this HTML:
<a href=\"C1.html#method-i-m\"><code>C1#m(a, b)</code></a>
https://github.com/ruby/rdoc/commit/05a2b2222b
When I run bundle install with BUNDLE_DEPLOYMENT=true in the environment
on a different platform than I usually do development, I get the
following output to the console (wrapped exactly as shown):
Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with `bundle lock
--add-platform x86_64-linux` and try again.
Because the way the message wraps, its not as simple as copying the
suggested command to the clipboard because it contains a newline:
$ bundle lock
Writing lockfile to [...]/Gemfile.lock
$ --add-platform x86_64-linux
Adding a newline right before the command forces the command in the
error message to be on the same line, which facilitates copy-pasting the
command in the message.
https://github.com/rubygems/rubygems/commit/4cf6989b11
Previously they had slightly different behavior when combined with
conservative updating flags.
The correct behavior is the `--update-strict` option, so `--script` now
does that, The `--update-strict` option is left there for now but I will
deprecate it later.
https://github.com/rubygems/rubygems/commit/ab42046229
The existing implementation, given the below .inputrc, erroneously
creates a "C-v" key binding:
set keymap emacs-ctlx
"\C-v": "[C-x C-v was pressed]"
This fixes it to instead create a "C-x C-v" keybinding.
https://github.com/ruby/reline/commit/719f52d231
This patch makes sure we only load relative code. Hence when coding or
testing rdoc, we'll be sure to always be using the correct code.
Discussion started at https://github.com/ruby/rdoc/pull/817.
Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>
https://github.com/ruby/rdoc/commit/aa41bd48eb
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This improves the performance in some cases.
`rdoc .../gems/sinatra-2.1.0/README.md` takes 10.5 sec. before this
change, and 7.1 sec. after this change.
`make rdoc` of ruby/ruby takes 19.3 sec. before this change, 18.1 sec.
after this change.
https://github.com/ruby/rdoc/commit/7cf8281e3e
Before it would be left as an IPv6 mask causing `to_range` to fail.
```
>> IPAddr.new("::2").native.to_range
/opt/rubies/3.0.3/lib/ruby/3.0.0/ipaddr.rb:479:in `set': invalid address (IPAddr::InvalidAddressError)
```
https://github.com/ruby/ipaddr/commit/af485192f3
RFC 6066, section 3, explicitly disallows the use of an IP address
as an SNI server name. So check if the connection is being made
to an IP address using the resolv regexps, and do not set an SNI
hostname in that case.
Recent changes to LibreSSL make it more strictly follow RFC 6066,
resulting an s.hostname= raising an error if passed an IP address.
When such verions of LibreSSL are used, this change not only fixes
the net/http tests, it also fixes tests for webrick and open-uri,
which both make SSL connections to 127.0.0.1 using net/http in
their tests.
Avoid warning in the openssl extension by unsetting
@ssl_context.verify_hostname if connecting to an IP address.
Make changes so that the post_connection_check still happens
when connecting to an IP address, which is necessary to keep
checking that the certificate returned includes the IP address,
which one of the tests depends on.
Revert the previous change that modified the regexp used for
checking the error message.
https://github.com/ruby/net-http/commit/fa68e64bee
If a Shipment has been delivered, there is no point in notifying the
buyer that the seller shipped. Instead, we should simply notify the
buyer that the shipment was delivered. This is relevant in cases where
the seller is late to mark a Shipment as shipped, so the first EasyPost
Tracker update marks it as delivered, or in cases where the seller
fails to mark as shipped and the buyer marks it as delivered.
This fixes a Shipment event handler so the buyer notification for
shipment is no longer invoked if the Shipment is already delivered.
https://github.com/rubygems/rubygems/commit/09c2cadc86
The error here is confusing for users because JRuby does not use
libyaml and installing it will not help. Instead, JRuby directs
them to a wiki page that describes an issue when multiple
conflicting versions of SnakeYAML are installed.
This change allows us to use the yaml gem and delete our local
sources.
https://github.com/ruby/yaml/commit/8122087ffb
Issue only occurs in JRuby 9.3.0.0 and Windows and the full
console output is:
log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log writing failed. closed stream
...
https://github.com/ruby/logger/commit/19fc734638
If you call `binding.irb` on a class defined `#print`, it will crash, so call `Kernel.print`.
Fix [Bug #18389] `binding.irb` can fail in some classes that implement `context` and `print` methods.
https://github.com/ruby/irb/commit/d54b271984
If a top-level `VERSION` constant exists, or if a module containing a `VERSION` constant is included into the top-level scope, then `Fiddle.const_defined?(:VERSION)` will erroneously return true when `RUBY_VERSION < 3.0.0`.
https://github.com/ruby/reline/commit/8529c8e47a
...with dashed gem name
In "bundle gem" command with dashed name gem (e.g. foo-bar) generates
`test/test_foo/bar.rb`, but this file contains undefined class `TestFoo`
and moreover, does not include in "bundle exec rake test" target.
Therefore, intentially the first test after gem created is fail, but in
case of gem name contains dash character is not.
The change doings...
(when "bundle gem foo-bar" called)
* create `test/test_foo_bar.rb`
* define `TestFooBar` class in `test/test_foo_bar.rb`
https://github.com/rubygems/rubygems/commit/5d9a69fc0f
This reverts commit 5133efa06f.
While we already handled this deprecation in many libraries, we noticed
that some (e.g. sprockets) relied on the format of `ERB.version` and
2b4182eb10 broke such handling.
Given that the `ERB.version` change was released at 3.1 and it's
obviously new, I'll skip this removal in 3.2 and postpone this to a
future version.
1. `require` can mislead Ruby to load system irb's files and cause
constant redefined warnings as other code loads the same module/class
from lib folder.
2. Most files already use `require_relative`.
https://github.com/ruby/irb/commit/848d339f2e
Renames `D` to `debug` in `Net::HTTP` and introduces an alias for
backwards compatibility. This was done for readability reasons, in that
`D` did not clearly reflect what the method was doing and can cause some
confusion.
https://github.com/ruby/net-http/commit/582d6e87d6
For the remote object `ro`, method chain like `ro.foo.bar` the
result of `ro.foo` is stored in `@result`, but cleared just
before `setup_message` and it seems GCed on specific machine.
```
1) Error:
DRbTests::TestDRbCore#test_05_eq:
RangeError: "140" is recycled object
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:366:in `_id2ref'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:366:in `to_obj'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1528:in `to_obj'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1847:in `to_obj'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:620:in `recv_request'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:931:in `recv_request'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1656:in `init_with_client'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1668:in `setup_message'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1632:in `perform'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1725:in `block (2 levels) in main_loop'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1721:in `loop'
(druby://localhost:36141) /tmp/ruby/v3/src/trunk-repeat20-asserts/lib/drb/drb.rb:1721:in `block in main_loop'
/tmp/ruby/v3/src/trunk-repeat20-asserts/test/drb/drbtest.rb:206:in `test_05_eq'
```
To prevent collecting, clear `@result` just after `setup_message`
and `setup_message` can get the last result object.
With this patch, handwriting version comparisons become a little bit easier.
before:
SomeGem.version <=> Gem::Version.new('1.3')
after:
SomeGem.version <=> '1.3'
https://github.com/rubygems/rubygems/commit/7e0dbb79f2
Solaris requires that the pointer errret_int is alined to an integer,
however, with VWA, strings are no longer aligned to an integer, so use a
Fiddle::Pointer with a malloc'd region instead.
https://github.com/ruby/reline/commit/5fcd89ab0c
On JRuby, sometimes we get the following error in CI when running a
realworld test that checks that `gem install rails` succeeds:
```
ERROR: While executing gem ... (NoMethodError)
undefined method `ignored=' for nil:NilClass
/home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/stub_specification.rb:193:in `to_spec'
org/jruby/RubyArray.java:2642:in `map'
/home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/specification.rb:758:in `_all'
/home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/specification.rb:956:in `each'
org/jruby/RubyEnumerable.java:1710:in `any?'
/home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/resolver/activation_request.rb:111:in `installed?'
/home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/request_set.rb:173:in `block in install'
```
I'm not sure how this error is happening, but I think there's no need to
copy the `@ignored` instance variable when materializing stub
specifications. This instance variable is used to not print a warning
about missing extensions more than once for each gem upon gem
activation, but as far as I can see, it's only used by methods that work
on specification stubs. Once specifications are materialized, I think
it can be safely ignored.
https://github.com/rubygems/rubygems/commit/301cecd5a7
The kill-line was called when C-u was entered, so it is now called unix-line-discard.
In readline(3):
> unix-line-discard (C-u)
> Kill backward from point to the beginning of the line.
> The killed text is saved on the kill-ring.
https://github.com/ruby/reline/commit/27570d195e