General

Profile

herwinw (Herwin Quarantainenet)

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 17 18

Activity

10/17/2017

05:44 AM Ruby Misc #14019: Layout fixes in rdoc of lib/tempfile.rb
The change has been merged, this report can be closed herwinw (Herwin Quarantainenet)

10/16/2017

11:25 AM Ruby Misc #14019 (Closed): Layout fixes in rdoc of lib/tempfile.rb
https://github.com/ruby/ruby/pull/1716 herwinw (Herwin Quarantainenet)

09/18/2017

02:02 PM Ruby Misc #13915 (Closed): Updated docs of ThreadGroup
Prefer 'Class.new' over 'Class::new' in documentation.
https://github.com/ruby/ruby/pull/1700
herwinw (Herwin Quarantainenet)

03/15/2017

02:42 PM Ruby Feature #13303: String#any? as !String#empty?
> and understand there's Array#any?.
This is a misconception, `Array#any?` does not check if the array is empty, but if there is a true-ish value in the array:
```ruby
irb(main):001:0> [false, nil].any?
=> false
```
This is d...
herwinw (Herwin Quarantainenet)

12/01/2016

12:15 PM Ruby Feature #12995: Conditional expression taking a receiver outside the condition
You can do that with #tap. A very stupid example:
```ruby
array = [true]
res = array.to_a.tap do |obj|
if obj[0]
obj.replace([['true', :val]])
else
obj.replace([['false', :val]])
end
end.to_a.to_h
p res
```
...
herwinw (Herwin Quarantainenet)

11/25/2016

07:59 AM Ruby Feature #12753: Useful operator to check bit-flag is true or false
I can't say the usage of `bittest?` is directly clear to me. Does it test if resulting integer is not equal to `0`? And would we have to use it this way?
```ruby
if (n & 0b10100000).bittest?
```
I think a name like `Integer#binar...
herwinw (Herwin Quarantainenet)

11/22/2016

11:39 AM Ruby Feature #12969: Allow optional parameter in String#strip and related
The concrete use case that I got was that I wanted to replace all trailing whitespace, but leave tabs/newlines etc untouched. The current code looks like this:
```ruby
newstr = str.sub(/ +$/, '')
```
I tried to see if there was a...
herwinw (Herwin Quarantainenet)
10:26 AM Ruby Feature #12969 (Open): Allow optional parameter in String#strip and related
`String#strip` and related methods have a hardcoded match on whitespace, defined as "null, horizontal tab, line feed, vertical tab, form feed, carriage return, space". It would be nice to allow a parameter to specify the characters you w... herwinw (Herwin Quarantainenet)
10:13 AM Ruby Feature #12964: Add sub? and gsub? method to string class.
I don't really see how this would be any different from `match?`
Beside that, the semantics are a bit ambiguous. `"foo".sub(/bar/, 'x')` does work, it just doesn't replace anything because there is no match for the regex. So would `su...
herwinw (Herwin Quarantainenet)

10/25/2016

07:01 AM Ruby Feature #9209: Struct instances creatable with named args
This looks like a duplicate of #11925 (or maybe the other way around, but the other ticket includes more information) herwinw (Herwin Quarantainenet)

Also available in: Atom