summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-09 14:53:44 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-09 14:53:44 +0000
commit5634c62d194fc080ae83b98d593416011a18fe46 (patch)
treec50eb6db2065dcdc39fec599a843bfd91f8f605f
parentb2575bc8a228745a4668e2165b54a4627fb7055f (diff)
merge revision(s) 58037: [Backport #10944]
docs for creating arrays * array.c: [DOC] add example for Array.new with block and index. Reported by Don Cruickshank. [ruby-core:68442] [Bug #10944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--array.c3
-rw-r--r--version.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/array.c b/array.c
index bd7cf0beff..15a4d47a84 100644
--- a/array.c
+++ b/array.c
@@ -5883,7 +5883,8 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
* This method is safe to use with mutable objects such as hashes, strings or
* other arrays:
*
- * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ * Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"]
*
* This is also a quick way to build up multi-dimensional arrays:
*
diff --git a/version.h b/version.h
index 0cf6633b5e..dd9b42580d 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.2"
#define RUBY_RELEASE_DATE "2017-05-09"
-#define RUBY_PATCHLEVEL 123
+#define RUBY_PATCHLEVEL 124
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 5