Граф коммитов

1319 Коммитов

Автор SHA1 Сообщение Дата
Yusuke Endoh 982443e6e3 Revert "Better cooperation between public/protected/private with attr* and alias_method"
This reverts commit 81739ad4fd.
2020-12-18 16:08:55 +09:00
Hiroshi SHIBATA 0e40cc9b19 Merge RubyGems 3.2.2 and Bundler 2.2.2 2020-12-18 13:33:18 +09:00
Radosław Bułat 81739ad4fd Better cooperation between public/protected/private with attr* and alias_method 2020-12-17 12:46:02 -05:00
Marc-Andre Lafortune d5f0d338c7 Optimize `Enumerable#grep{_v}`
[Bug #17030]
2020-12-15 12:54:45 -05:00
Hiroshi SHIBATA 2fa9f3c032 Prepare to release rubygems-3.2.1 and bundler-2.2.1 2020-12-15 10:54:09 +09:00
Benoit Daloze f5c89c1660 Deprecate Random::DEFAULT
* Closes [Feature #17351].
2020-12-14 20:29:50 +01:00
Kazuki Tsujimoto a8cf526ae9
Don't emit warning when the pattern of one-line pattern matching is just a variable pattern
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md#feature-17371-reintroduce-expr-in-pat-ktsj
2020-12-13 11:51:49 +09:00
Yusuke Endoh 7ef5226520 spec: suppress deprecations of "lambda(&proc_block)" pattern 2020-12-12 23:25:15 +09:00
nicholas a. evans 31e8de2920 Let Fiber#raise work with transferring fibers
This automatically choosess whether to use transfer on a transferring
fiber or resume on a yielding fiber.  If the fiber is resuming, it
raises a FiberError.
2020-12-12 10:18:19 +13:00
Nobuyoshi Nakada dea600046a
Ad-hoc fix of test-bundler 2020-12-09 13:10:28 +09:00
Hiroshi SHIBATA 473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Lars Kanis ca76337a00
Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)
* Windows: Read ENV names and values as UTF-8 encoded Strings

Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650

This also removes the special encoding for ENV['PATH'] and some
complexity in the code that is unnecessary now.

* Windows: Improve readablity of getenv() encoding

getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.

* Windows: Change external C-API macros getenv() and execv() to use UTF-8

They used to process and return strings with locale encoding,
but since all ruby-internal spawn and environment functions use UTF-8,
it makes sense to change the C-API equally.
2020-12-08 02:00:39 +09:00
Lars Kanis 94b6933d1c
Set default for Encoding.default_external to UTF-8 on Windows (#2877)
* Use UTF-8 as default for Encoding.default_external on Windows
* Document UTF-8 change on Windows to Encoding.default_external

fix https://bugs.ruby-lang.org/issues/16604
2020-12-08 01:48:37 +09:00
Nobuyoshi Nakada 7817a438eb Removed deprecated Time#succ 2020-12-07 18:38:59 +09:00
Nobuyoshi Nakada 20d53dad47
Update the version guard to 3.0 2020-12-07 18:35:59 +09:00
卜部昌平 547c71dec4
Hash#index: delete
Has been deprecated since 0c97c8e335.
2020-12-07 18:35:58 +09:00
Benoit Daloze 9dbb2bfd73 Wrap SortedSet with `ruby_version_is ""..."3.0"`
* Using $ spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.0"' spec/ruby/library/set/sortedset/**/*_spec.rb
2020-12-05 11:40:00 +01:00
Benoit Daloze bb3d705819 Add MSpec tool to automatically wrap spec files with a guard 2020-12-05 11:39:33 +01:00
Benoit Daloze d0bd43c332 Revert "SortedSet was removed at a3db08d7b6ff119223f77e3df00b4f6deac971e2"
* This reverts commit b06ffce4ae.
* Do not revert specs, wrap them with `ruby_version_is` (tool for that in next commit).
2020-12-05 11:17:22 +01:00
Benoit Daloze 9ea1055eab 2.8 -> 3.0 in specs 2020-12-04 16:32:14 +01:00
Hiroshi SHIBATA e666bd1c5a
Skip subclass spec with SortedSet 2020-12-04 19:36:30 +09:00
Hiroshi SHIBATA b06ffce4ae
SortedSet was removed at a3db08d7b6 2020-12-04 19:36:12 +09:00
卜部昌平 43b95bafd5
delete deprecated IO-like methods
This commit deletes
{IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which
have been deprecated since c47c095b97.

Note that String also has those methods.  They are neither depreacted
nor deleted because they are not aliases of counterpart each_something.
2020-12-03 12:47:51 +09:00
卜部昌平 12a121cc0f
ENV.index: delete
Has been deprecated since 373282f665.
2020-12-02 20:17:11 +09:00
Benoit Daloze ddb1736bfc Update to ruby/spec@c4170a3 2020-11-27 15:47:17 +01:00
Benoit Daloze f02d2f82bf Update to ruby/spec@ac878ad 2020-11-27 14:55:31 +01:00
Benoit Daloze f0bfa266d7 Update to ruby/mspec@b58e665 2020-11-27 14:55:29 +01:00
Benoit Daloze f0e2ea2859 Clarify spec and change of behavior for Random::DEFAULT 2020-11-27 10:29:39 +01:00
Koichi Sasada 2db2fb9f6c per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a per-ractor
random generator.

[Feature #17322]
2020-11-27 17:03:30 +09:00
Nobuyoshi Nakada 82e836dc7d
Use hex-encoded binaries instead of UTF-8
Which UTF-8 char corresponds to the binary representation is
nonsense for other encodings, and just confusing.
2020-11-22 22:51:28 +09:00
Lars Kanis d403591b34
Add string encoding IBM720 alias CP720 (#3803)
The mapping table is generated from the ICU project:
  https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/ibm-720_P100-1997.ucm

Fixes bug 16233 : https://bugs.ruby-lang.org/issues/16233
2020-11-22 22:23:40 +09:00
Nobuyoshi Nakada 7c879cbb3f
Suppress a unused-variable warning 2020-11-22 19:10:58 +09:00
Jeremy Evans 58325daae3 Make String methods return String instances when called on a subclass instance
This modifies the following String methods to return String instances
instead of subclass instances:

* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each/#each_line
* String#gsub
* String#ljust
* String#lstrip
* String#partition
* String#reverse
* String#rjust
* String#rpartition
* String#rstrip
* String#scrub
* String#slice!
* String#slice/#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ/#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase

This also fixes a bug in String#swapcase where it would return the
receiver instead of a copy of the receiver if the receiver was the
empty string.

Some string methods were left to return subclass instances:

* String#+@
* String#-@

Both of these methods will return the receiver (subclass instance)
in some cases, so it is best to keep the returned class consistent.

Fixes [#10845]
2020-11-20 16:30:23 -08:00
Jeremy Evans ce9beb9d20 Improve error message when subclassing non-Class
Fixes [Bug #14726]
2020-11-13 07:06:13 -08:00
Benoit Daloze 6d05967468 Update to ruby/spec@b0b7f53 2020-11-13 13:17:24 +01:00
Benoit Daloze acbe7aa197 Update to ruby/mspec@f8b0618 2020-11-13 13:17:22 +01:00
Hiroshi SHIBATA 69c5474e10
Fixup 957efa95cc 2020-11-13 13:19:38 +09:00
Yusuke Endoh 6325866421 spec/ruby/core/file/utime_spec.rb: XFS seems to have Year 2038 problem
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201112T123004Z.fail.html.gz
```
1)
File.utime allows Time instances in the far future to set mtime and
atime (but some filesystems limit it up to 2446-05-10) FAILED
Expected [559444, 2446].include? 2038
to be truthy but was false
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:80:in
`block (4 levels) in <top (required)>'
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:3:in
`<top (required)>'
```

```
$ touch foo
$ ./miniruby -e 'time = Time.at(1<<44); File.utime(time, time, "foo")'
$ ls -l foo
-rw-r--r--. 1 mame wheel 0 Jan 19  2038 foo
```
2020-11-12 23:39:27 +09:00
Kazuki Tsujimoto 5823f6c25b
Fix indentation 2020-11-07 22:12:22 +09:00
Kazuki Tsujimoto 640fd94eff
Fix and remove spec testing undefined behavior 2020-11-07 22:05:20 +09:00
Marc-Andre Lafortune 6f24be8565 Revert "Make `marshal_load` public"
This reverts commit ee7cc6ac35.

I'm not sure I agree with the spec, but I just tweaked it.
2020-11-04 17:52:03 -05:00
Jeremy Evans 2a294d499b
Make Array methods return Array instances instead of subclass instances
This changes the following methods to return Array instances instead
of subclass instances:

* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*

Fixes [Bug #6087]
2020-11-03 14:01:38 -08:00
Kazuki Tsujimoto 963359a762
Use the suppress_warning helper instead of doing it manually 2020-11-01 19:00:22 +09:00
Kazuki Tsujimoto 7282f3113d
Suppress "One-line pattern matching is experimental" warning 2020-11-01 18:19:58 +09:00
Kazuki Tsujimoto e0e2492cd3
Fix Rubyspec (ruby-2.7) failures
https://github.com/ruby/ruby/runs/1337845174
2020-11-01 17:37:03 +09:00
Koichi Sasada 0e33028d69 use one-line pattern matching for warning tests 2020-11-01 13:55:54 +09:00
Nobuyoshi Nakada 52c630da00
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
2020-10-26 18:00:24 +09:00
Benoit Daloze cffdacb15a Ignore <internal: entries from core library methods for Kernel#warn(message, uplevel: n)
* Fixes [Bug #17259]
2020-10-26 08:47:33 +01:00
Benoit Daloze fbb2d30ee6 Add specs that #caller and #caller_locations include core library methods defined in Ruby 2020-10-26 08:47:33 +01:00
Benoit Daloze 3673c3eafc Update to ruby/spec@b164536 2020-10-26 08:20:48 +01:00