Thanks for the patch gareth (Gareth Adams). [Bug #15933]
-------
Combines two small, but very related changes
1: Treat HTTPS the same as HTTP
Previously, OpenURI followed guidance in RFC2616/3.7.1:
> When no explicit charset parameter is provided by the sender, media
> subtypes of the "text" type are defined to have a default charset
> value of "ISO-8859-1" when received via HTTP.
However this RFC was written before TLS was established and OpenURI was
never updated to treat HTTPS traffic the same way. So, HTTPS documents
received a different default to HTTP documents.
This commit removes the scheme check so that all text/* documents
processed by OpenURI are treated the same way.
In theory this processing gets applied to FTP URIs too, but there's no
mechanism in OpenURI for FTP documents to have Content-Type metadata
appended to them, so this ends up being a no-op.
2: Change default charset for text/* to UTF-8
Replaces the default ISO-8859-1 charset previously defined in RFC2616 (now
obsoleted) with a UTF-8 charset as defined in RFC6838.
Fixes: https://bugs.ruby-lang.org/issues/15933
Implement Complex#<=> so that it is usable as an argument when
calling <=> on objects of other classes (since #coerce will coerce
such numbers to Complex). If the complex number has a zero imaginary
part, and the other argument is a real number (or complex number with
zero imaginary part), return -1, 0, or 1. Otherwise, return nil,
indicating the objects are not comparable.
Fixes [Bug #15857]
Methods that return classes often module_eval the given block
(e.g. Class.new and Struct.new). This allows DelegateClass to
work similarly. This makes it easier to use DelegateClass
directly without subclassing, so as not to create an unnecessary
subclass.
Implements [Feature #15842]
Similar to NameError#receiver, this returns the object on which
the modification was attempted. This is useful as it can pinpoint
exactly what is frozen. In many cases when a FrozenError is
raised, you cannot determine from the context which object is
frozen that you attempted to modify.
Users of the current rb_error_frozen C function will have to switch
to using rb_error_frozen_object or the new rb_frozen_error_raise
in order to set the receiver of the FrozenError.
To allow the receiver to be set from Ruby, support an optional
second argument to FrozenError#initialize.
Implements [Feature #15751]
* parse.y (heredoc_identifier): quoted here-document identifier
must end within the same line.
the only corner case that here-document identifier can contain a
newline is that the closing qoute is placed at the beginning of
the next line, and has been warned since 2.4.
```ruby
<<"EOS
" # warning: here document identifier ends with a newline
EOS
```
Details: https://github.com/ruby/ruby/pull/2150
Note that this introduction is discussed with @aycabta who is allowed to
make some changes to IRB by the IRB maintainer, keiju.
from Subversion.
This behavior is tentative and not discussed well. The point of
discussion will be just the length of commit hash, and I thought we
should include this kind of change in 2.7.0-preview1 release even before
the length is fixed yet.
Let's discuss that afterwards and fix it later as needed. Naruse
suggested that length=10 is very unlikely to cause conflict, and thus
it's used by email notification and rubyci now. This behavior is in
favor of that for now.
* string.c (rb_str_split_m): warn use of non-nil $;.
* string.c (rb_fs_setter): warn when set to non-nil value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
For some reason symbols (or classes) are being overridden in trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This diff is backported from the upcoming preview release note.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e