[前][次][番号順一覧][スレッド一覧]

ruby-changes:63048

From: Kazuhiro <ko1@a...>
Date: Wed, 23 Sep 2020 11:46:30 +0900 (JST)
Subject: [ruby-changes:63048] 9a8f5f0a9a (master): Fix call-seq [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=9a8f5f0a9a

From 9a8f5f0a9a1ed24a3dbb2f92cd267b77faf2da88 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Wed, 23 Sep 2020 11:44:06 +0900
Subject: Fix call-seq [ci skip]

`encoding` can be not only an encoding name, but also an Encoding object.

```
s = String.new('foo', encoding: Encoding::US_ASCII)
s.encoding # => #<Encoding:US-ASCII>
```

diff --git a/string.c b/string.c
index 83fbf28..254e0bd 100644
--- a/string.c
+++ b/string.c
@@ -1567,7 +1567,7 @@ rb_str_resurrect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L1567
 /*
  *  call-seq:
  *    String.new(string = '') -> new_string
- *    String.new(string = '', encoding: encoding _name) -> new_string
+ *    String.new(string = '', encoding: encoding) -> new_string
  *    String.new(string = '', capacity: size) -> new_string
  *
  *  Returns a new \String that is a copy of +string+.
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]