summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:58:36 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:58:36 +0000
commit0e38368894055f610f3ac01fbd0a5239fc11125e (patch)
tree1f93cbeaa5a107465c1a8c67bd3fecc034b12794
parent402bf6d516ac80e7ce1f58660086962231acf425 (diff)
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_5@67722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c12
-rw-r--r--version.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/io.c b/io.c
index 1d190331d6..30d2241865 100644
--- a/io.c
+++ b/io.c
@@ -12190,13 +12190,21 @@ argf_block_call_line(ID mid, int argc, VALUE *argv, VALUE argf)
* 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 ad21d0c870..4b9eb28802 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.5.6"
#define RUBY_RELEASE_DATE "2019-07-31"
-#define RUBY_PATCHLEVEL 168
+#define RUBY_PATCHLEVEL 169
#define RUBY_RELEASE_YEAR 2019
#define RUBY_RELEASE_MONTH 7