[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84218] [Ruby trunk Feature#14022] String#surround
From:
matz@...
Date:
2017-12-12 14:12:41 UTC
List:
ruby-core #84218
Issue #14022 has been updated by matz (Yukihiro Matsumoto).
I see `ary.join.surround("<",">")` to be no better than `"<#{ary.join}>"` or `"<"+ary.join+">"`.
If the wrapped expression is long, you can `format("<%s>", long_expression)`. I am not sure why you are so eager to chain method calls here.
Note: I am not rejecting the proposal (yet).
Matz.
----------------------------------------
Feature #14022: String#surround
https://bugs.ruby-lang.org/issues/14022#change-68340
* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
After joining the elements of an array into a string using `Array#join`, I frequently need to put substrings before and after the string. In such case, I would have to use either of the following:
```ruby
[1, 2, 3].join(", ").prepend("<").concat(">") # => "<1, 2, 3>"
"<#{[1, 2, 3].join(", ")}>" # => "<1, 2, 3>"
"<" + [1, 2, 3].join(", ") + ">" # => "<1, 2, 3>"
```
but none of them is concise enough. I wish there were `String#surround` that works like this:
```ruby
[1, 2, 3].join(", ").surround("<", ">") # => "<1, 2, 3>"
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>