1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

89 commits

Author SHA1 Message Date
Kazuhiro NISHIYAMA
0a86679a7b
Fix a typo [ci skip] 2020-05-09 14:22:33 +09:00
Benoit Daloze
5aaa75e7c1 Update to ruby/spec@032ee74 2020-05-03 12:28:29 +02:00
Benoit Daloze
c9213aa864 Update to ruby/spec@d394dfd 2020-05-02 16:03:14 +02:00
Nobuyoshi Nakada
62554ca978
Removed NIL/TRUE/FALSE
Deprerecated constants which had been warned since 2.4.
2020-04-17 17:35:17 +09:00
Nobuyoshi Nakada
e8f53692ca
Endless method definition [Feature ] 2020-04-10 18:02:15 +09:00
Jeremy Evans
900e83b501 Turn class variable warnings into exceptions
This changes the following warnings:

* warning: class variable access from toplevel
* warning: class variable @foo of D is overtaken by C

into RuntimeErrors.  Handle defined?(@@foo) at toplevel
by returning nil instead of raising an exception (the previous
behavior warned before returning nil when defined? was used).

Refactor the specs to avoid the warnings even in older versions.
The specs were checking for the warnings, but the purpose of
the related specs as evidenced from their description is to
test for behavior, not for warnings.

Fixes [Bug ]
2020-04-10 00:29:05 -07:00
Nobuyoshi Nakada
18f7d3c9a6
Refined "Drop support for ruby 2.4 from ruby/spec"
By using spec/mspec/tool/remove_old_guards.rb.
2020-04-03 09:44:40 +09:00
Nobuyoshi Nakada
826f44834f Drop support for ruby 2.4 from ruby/spec 2020-04-01 15:36:20 +09:00
Nobuyoshi Nakada
3a2073e61b Use FrozenError instead of frozen_error_class 2020-04-01 15:36:20 +09:00
Benoit Daloze
f234d51eab Update to ruby/spec@ec84479 2020-03-28 00:22:51 +01:00
Jeremy Evans
f4394bbca3 Do not autosplat when calling procs that accept rest and keywords
When providing a single array to a block that takes a splat, pass the
array as one argument of the splat instead of as the splat itself,
even if the block also accepts keyword arguments.  Previously, this
behavior was only used for blocks that did not accept keywords.

Implements [Feature#16166]
2020-03-08 20:49:09 -07:00
Kazuhiro NISHIYAMA
fcd605020b
Fix a typo 2020-03-07 13:49:28 +09:00
Benoit Daloze
a0f5ff4c3c Update to ruby/spec@41bf282 2020-02-28 19:07:17 +01:00
Nobuyoshi Nakada
8a7e0aaaef
Warn non-nil $/ [Feature ] 2020-02-23 13:37:40 +09:00
Jeremy Evans
7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Benoit Daloze
809f0b8a13 Update to ruby/spec@f8a2d54 2020-01-28 20:47:48 +01:00
Jeremy Evans
766f8a7a60 Fix some spec breakage on 2.7 related to keyword arguments
These specs were probably added in the commit to fully
separate keyword arguments after the release of 2.7.0, but
apparently not tested on 2.7 before hand. The enclosing
ruby_version guard for these specs limits them to 2.7.
2020-01-28 09:26:02 -08:00
Kazuhiro NISHIYAMA
ac93cf4ff8
Update version guard
fix up 98ef38ada4
2020-01-15 10:50:53 +09:00
Jean Boussier
98ef38ada4 Freeze Regexp literals
[Feature ] [Feature ]

Since Regexp literals always reference the same instance,
allowing to mutate them can lead to state leak.
2020-01-15 10:38:47 +09:00
Jeremy Evans
e014e6bf66 Update specs for keyword argument separation 2020-01-02 18:40:45 -08:00
Benoit Daloze
a2fac1d72c Update to ruby/spec@d419e74 2019-12-27 16:46:08 +01:00
Nobuyoshi Nakada
db16629008
Fixed misspellings
Fixed misspellings reported at [Bug ], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Benoit Daloze
1243255c3a Update to ruby/spec@4eec3dc 2019-11-30 21:26:52 +01:00
Jeremy Evans
ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans
c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Jeremy Evans
0162e7e647 Make circular argument reference a SyntaxError instead of a warning
Fixes [Bug ]
2019-10-17 09:32:06 -07:00
Jeremy Evans
ef697388be
Treat return in block in class/module as LocalJumpError ()
return directly in class/module is an error, so return in
proc in class/module should also be an error.  I believe the
previous behavior was an unintentional oversight during the
addition of top-level return in 2.4.
2019-10-02 07:56:28 -07:00
Benoit Daloze
a17bc04d15 Update to ruby/spec@e69a14c 2019-09-29 18:01:32 +02:00
Benoit Daloze
1c938a72aa Update to ruby/spec@519df35 2019-09-29 16:03:58 +02:00
Nobuyoshi Nakada
e6378cdcd8
Allow calling a private accessor with self.
[Feature ] [Feature ]
2019-09-20 02:21:37 +09:00
Nobuyoshi Nakada
d583df5259
Added version guard
[Feature ] [Feature ]
2019-09-20 02:21:25 +09:00
Dylan Thacker-Smith
7fbd2f7cc2
Allow calling a private method with self.
This makes it consistent with calling private attribute assignment
methods, which currently is allowed (e.g. `self.value =`).

Calling a private method in this way can be useful when trying to
assign the return value to a local variable with the same name.

[Feature ] [Feature ]
2019-09-20 02:20:59 +09:00
Jeremy Evans
3463e83192 Warn for keyword to last hash parameter when method has no optional/rest parameters
Previously, there was no warning in this case, even though we will
be changing the behavior in Ruby 3.

Fixes [Bug ]
2019-08-30 19:25:46 -07:00
Jeremy Evans
a810f6cbef Update specs to handle non-Symbols for keyword splats in 2.7
Also handle some warnings for behavior that will change in 3.0.
2019-08-30 12:39:31 -07:00
Nobuyoshi Nakada
d3e0bc07e2
Fixed a comment [ci skip]
A range literal in conditional expression is turned into a
flip-flop, as a Range object is never falsy and does not make a
sense.
2019-08-29 11:23:16 +09:00
Nobuyoshi Nakada
d92289cd8d
Revert "Remove warnings of flip-flop deprecation from tests and specs"
This reverts commit bf7a32d220.

flip-flop is no longer deprecated.

[Feature ]
2019-08-29 11:10:45 +09:00
Jeremy Evans
aa97410b0a Warn if using return at top-level with an argument
Fixes [Bug ]
2019-07-29 09:01:23 -07:00
Benoit Daloze
5c276e1cc9 Update to ruby/spec@875a09e 2019-07-27 12:40:09 +02:00
Nobuyoshi Nakada
4e038a7e64
Revert "parse.y: Deprecate flip-flops"
This reverts commit bae638ad5b.

[Feature ]
2019-07-11 14:52:02 +09:00
Benoit Daloze
d80e44deec Update to ruby/spec@8d74d49 2019-06-27 21:02:36 +02:00
Benoit Daloze
a66bc2c011 Update to ruby/spec@9a501a8 2019-05-28 22:41:48 +02:00
Benoit Daloze
79671ec57e Update to ruby/spec@7de852d 2019-04-28 23:20:11 +02:00
Benoit Daloze
a1b4816759 Update to ruby/spec@15c9619 2019-04-27 18:53:23 +02:00
eregon
a28aa80c73 Update to ruby/spec@e81b3cd
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-28 14:22:29 +00:00
mame
76fc1ce0a7 The combination of non-Symbol keys and Symbol keys is now allowed again
Revert r64358.  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 12:48:33 +00:00
eregon
da7976235f Update to ruby/spec@7a16e01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-21 15:38:59 +00:00
eregon
713279550a Fix specs for yield in singleton class being deprecated
* Use eval to trigger warning only when the method is called.
* Suppress warnings and clarify this will be removed in 3.0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-07 16:40:27 +00:00
eregon
75334db3c6 Update to ruby/spec@6cf8ebe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-07 16:35:33 +00:00
eregon
42921458ff Update to ruby/spec@e57f49c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-27 13:12:39 +00:00
eregon
6204e0804b Update to ruby/spec@35a9fba
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-20 20:38:57 +00:00