1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib
Jeremy Evans 3b302ea8c9 Add Module#ruby2_keywords for passing keywords through regular argument splats
This approach uses a flag bit on the final hash object in the regular splat,
as opposed to a previous approach that used a VM frame flag.  The hash flag
approach is less invasive, and handles some cases that the VM frame flag
approach does not, such as saving the argument splat array and splatting it
later:

  ruby2_keywords def foo(*args)
    @args = args
    bar
  end
  def bar
    baz(*@args)
  end
  def baz(*args, **kw)
    [args, kw]
  end
  foo(a:1)    #=> [[], {a: 1}]
  foo({a: 1}, **{}) #=> [[{a: 1}], {}]

  foo({a: 1}) #=> 2.7: [[], {a: 1}] # and warning
  foo({a: 1}) #=> 3.0: [[{a: 1}], {}]

It doesn't handle some cases that the VM frame flag handles, such as when
the final hash object is replaced using Hash#merge, but those cases are
probably less common and are unlikely to properly support keyword
argument separation.

Use ruby2_keywords to handle argument delegation in the delegate library.
2019-09-25 12:33:52 -07:00
..
bundler [bundler/bundler] Merge #7340 2019-09-18 18:26:33 +09:00
cgi Prefer Regexp#=~ to Regexp#match when the RHS may be nil 2019-08-19 16:39:42 +09:00
csv Fix keyword argument separation issues in lib 2019-08-30 12:39:31 -07:00
drb change default value of load_limit (ignore load_limit) 2019-07-13 07:22:55 +09:00
e2mmap Also fixed up with 036039c8a2 2019-07-15 14:47:47 +09:00
fileutils Bump version to 1.2.0. 2019-06-25 15:56:20 +09:00
forwardable
irb Folded files in gemspec 2019-09-16 21:51:48 +09:00
logger Fixed LoadError of version file. 2019-07-15 14:45:30 +09:00
matrix [ruby/matrix] Add Matrix::VERSION constant 2019-07-15 00:32:00 +09:00
net Add Net::FTP#features and Net::FTP#option 2019-09-02 14:43:51 +09:00
optparse Allow --enable/--disable options to take an argument 2019-05-15 17:31:11 +09:00
racc Folded files in gemspec 2019-09-16 21:51:48 +09:00
rdoc Folded files in gemspec 2019-09-16 21:51:48 +09:00
reline Get rid of IO.select to fix multiline paste 2019-09-26 00:26:33 +09:00
rexml [ruby/rexml] gemspec: update 2019-08-04 11:56:02 +09:00
rinda lib/*: Prefer require_relative over require. 2018-11-02 17:52:33 +00:00
rss
rubygems Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
tracer
unicode_normalize update to Unicode Version 12.1.0 (beta) 2019-04-05 00:58:51 +00:00
uri
webrick Folded files in gemspec 2019-09-16 21:51:48 +09:00
yaml
.document
abbrev.rb
base64.rb
benchmark.rb
bundler.rb [bundler/bundler] Fix comments and messages to refer to https url 2019-09-18 18:26:32 +09:00
cgi.rb change call CGI methods from :: to . 2019-08-04 09:19:30 +09:00
csv.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
debug.rb
delegate.rb Add Module#ruby2_keywords for passing keywords through regular argument splats 2019-09-25 12:33:52 -07:00
drb.rb
e2mmap.rb
English.rb Fixed class, module and method references [ci skip] 2019-08-16 00:00:50 +09:00
erb.rb erb.rb: prohibit marshaling [EXPERIMENTAL] 2019-03-28 03:46:48 +00:00
fileutils.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
find.rb Use start_with?(quoted) instead of [0] == char literal 2019-05-08 11:16:23 +09:00
forwardable.rb Document and add spec for delegating to constants in Forwardable 2019-07-26 07:35:58 -07:00
getoptlong.rb
ipaddr.gemspec
ipaddr.rb
irb.rb Don't echo results of assignment expressions 2019-08-16 06:02:45 +09:00
logger.rb [ruby/logger] Add option to set the binary mode of the log device 2019-07-15 14:43:08 +09:00
matrix.rb Add abs to Matrix (#2199) 2019-08-21 16:36:39 -04:00
mkmf.rb Added link_command for C++ 2019-09-19 19:06:18 +09:00
monitor.rb Avoid creating Hash objects per each mon_synchronize call (#2393) 2019-08-20 22:08:41 +09:00
mutex_m.gemspec
mutex_m.rb
observer.rb
open-uri.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
open3.rb
optionparser.rb
optparse.rb Fix default argument values for OptParse::Switch#summarize 2019-07-07 13:49:47 -07:00
ostruct.gemspec
ostruct.rb Removed old names of internal methods 2019-05-10 14:13:17 +09:00
pp.rb lib/pp.rb: Use UnboundMethod#bind_call instead of .bind(obj).call(...) 2019-08-30 11:13:00 +09:00
prettyprint.rb
prime.gemspec
prime.rb
pstore.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
racc.rb Backport racc-1.4.15 from upstream. 2019-06-19 18:17:25 +09:00
rdoc.rb
readline.rb Add Reline as a fallback library for Readline 2019-04-30 11:44:20 +09:00
reline.rb Reline: Fix wrong variable name 2019-09-09 19:16:01 +09:00
resolv-replace.rb
resolv.rb Use lowercase letters for IPv6 addresses. 2019-07-30 11:59:54 +09:00
rss.rb
rubygems.rb Fix keyword argument separation issues in lib 2019-08-30 12:39:31 -07:00
securerandom.rb fix visibility of SecureRandom.gen_random 2019-05-14 11:44:20 +09:00
set.rb Fix SortedSet subclasses that override initialize 2019-09-06 14:20:22 -07:00
shellwords.rb
singleton.rb [DOC] Singleton.instance [ci skip] 2019-06-28 14:38:43 +09:00
tempfile.rb Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
time.rb
timeout.rb Add some documentation to Timeout#timeout about possible issues 2019-06-04 19:19:37 -07:00
tmpdir.rb Fix keyword argument separation issues in lib 2019-08-30 12:39:31 -07:00
tracer.rb
tsort.rb
un.rb Use double splat for keyword args by a hash object in lib/un.rb 2019-08-31 20:55:35 +09:00
uri.rb
weakref.rb
webrick.rb lib/webrick.rb: use require_relative for webrick/utils.rb 2019-08-25 19:29:52 +09:00
yaml.rb Update the canonical repository url 2019-08-19 17:52:20 +09:00