Correction - the `IO#gets` data for a UTF-8 input stream including BOM *does* include the BOM as an invisible first character. I didn't notice at first because it's, well, invisible! Doesn't change the documentation issue at hand, but...adh1003 (Andrew Hodgkinson)
For avoidance of doubt, the behaviour of Ruby itself is (IMHO) sensible and working well. The only change needed is to alter the word "bytes" to "characters" for the `IO#gets` description of the `limit` parameter.adh1003 (Andrew Hodgkinson)
Please see https://ruby-doc.org/core-3.1.2/IO.html#method-i-gets: > With integer argument `limit` given, returns up to `limit+1` bytes: In relation to https://github.com/janko/down/pull/74, I discovered that while `IO#read` ignores...adh1003 (Andrew Hodgkinson)
shyouhei (Shyouhei Urabe) wrote: > I can think of other cursed usages of private taking a block. Then it is fortunate, is it not, that this is _not what I am proposing_. What I said was, I thought very clearly: > ... ...with som...adh1003 (Andrew Hodgkinson)
shyouhei (Shyouhei Urabe) wrote: > Yes, I agree we don't copy C++ / Java. What I wonder is _any_ other language who have such syntax. Swift? no. Python? no. TypeScript? no. AFAIK no one on this planet have such thing so far. It se...adh1003 (Andrew Hodgkinson)
shevegen (Robert A. Heiler) wrote: > > As noted in the pseudocode above, we can clean up some of the issues around > ... Agree with all you said and appreciate the detailed feedback - but on this, and in many ways on the use of `send...adh1003 (Andrew Hodgkinson)
Private or protected declarations in Ruby classes are problematic. The single, standalone `public`, `private` or `protected` statements cause all following methods - *except* "private" class methods, notably - to have that protection lev...adh1003 (Andrew Hodgkinson)
For the sake of archives & potential future search engine hits - this got fixed a few days ago and will be in whatever public release of Rails comes after 6.0.0. https://github.com/rails/rails/pull/36460adh1003 (Andrew Hodgkinson)
Doh, this needs closing; my apologies. I had not realised that I was testing in an execution environment that had pulled in ActiveSupport from Rails 6. This seems to break `#include?` in an endless Range. When I'm careful to use "vanilla...adh1003 (Andrew Hodgkinson)
In an endless Range, I'd expect to be able to use `#include?` just as I do with a Range that has an end value. It would amount to just a check on whether the argument was greater than or equal to the start value of that Range (and likewi...adh1003 (Andrew Hodgkinson)