ruby-changes:56728
From: nagachika <ko1@a...>
Date: Wed, 31 Jul 2019 23:25:14 +0900 (JST)
Subject: [ruby-changes:56728] nagachika: 9e4ab409b5 (ruby_2_6): merge revision(s) 374c8f4ebab1a740990330c732b9de965c5e8d10: [Backport #15823]
https://git.ruby-lang.org/ruby.git/commit/?id=9e4ab409b5 From 9e4ab409b50dfef68a97b36f2ec50e344c9980ac Mon Sep 17 00:00:00 2001 From: nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Wed, 31 Jul 2019 14:14:59 +0000 Subject: merge revision(s) 374c8f4ebab1a740990330c732b9de965c5e8d10: [Backport #15823] Fixed about ARGF.lineno [Bug #15823] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e diff --git a/io.c b/io.c index 5a27e8b..e581145 100644 --- a/io.c +++ b/io.c @@ -12313,13 +12313,21 @@ argf_block_call_line(ID mid, int argc, VALUE *argv, VALUE argf) https://github.com/ruby/ruby/blob/trunk/io.c#L12313 * a single file consisting of the concatenation of each named file. After * the last line of the first file has been returned, the first line of the * second file is returned. The +ARGF.filename+ and +ARGF.lineno+ methods can - * be used to determine the filename and line number, respectively, of the - * current line. + * be used to determine the filename of the current line and line number of + * the whole input, respectively. * * For example, the following code prints out each line of each named file * prefixed with its line number, displaying the filename once per file: * * ARGF.each_line do |line| + * puts ARGF.filename if ARGF.file.lineno == 1 + * puts "#{ARGF.file.lineno}: #{line}" + * end + * + * While the following code prints only the first file's name at first, and + * the contents with line number counted through all named files. + * + * ARGF.each_line do |line| * puts ARGF.filename if ARGF.lineno == 1 * puts "#{ARGF.lineno}: #{line}" * end diff --git a/version.h b/version.h index 590f1b2..c78de62 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1 #define RUBY_VERSION "2.6.3" #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 70 +#define RUBY_PATCHLEVEL 71 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 7 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/