Kouhei Yanagita

Results 20 issues of Kouhei Yanagita

\R is not available in a character class. It would be better to note this.

ticket: https://bugs.ruby-lang.org/issues/18809 I have needed to implement "rounding up division" several times. ("rounding up division" means getting a quotient of division which is rounded up to the nearest integer.) Typically,...

https://bugs.ruby-lang.org/issues/18551 Currently, `Range#reverse_each` for an endless range never returns. ``` % ruby -e '(1..).reverse_each { }' # never return ... ``` (This is because `Enumerable#reverse_each` tries `#to_a` and `#to_a` for...

https://bugs.ruby-lang.org/issues/18515 Current `Range#reverse_each` uses `Enumerable#reverse_each` which is implemented with `#to_a`. So we are virtually not able to use `#reverse_each` for a very large or beginless range, even if few elements...

This PR replaces the call of `` in the `r_less` function with `OPTIMIZED_CMP`. The original `OPTIMIZED_CMP` throws an exception when the arguments are non-comparable, so only that part has been...

Ruby 3.3から`Range#reverse_each`の実装が追加されたため、記述を追加。 `Enumrable#reverse_each`のサンプルコードは`Range`から`Hash`に変更。

Ruby 3.3で追加された`Range#overlap?`の記述を追加します。 参考: https://github.com/ruby/ruby/blob/dc532b7c4edcb0884e4e0c8a28c7c55e456e369d/range.c#L2292

* `set.rd` を `_builtin/Set` にコピーし、 * `require 'set'` を削除 * 3.2未満に関する記述を削除 * `set.rd` は `#@until 3.2` 指定 * `_builtin/Set` は `#@since 3.2` 指定 * `Enumerable#to_set` は `#@since 3.2` 指定で `Enumerable`...

We need to pass a `URI` object to `Net::HTTP.get_response` (or `Net::HTTP.get`). ```ruby Net::HTTP.get_response(URI('http://www.example.com/index.html')) ``` With this patch, these methods can receive a URI-string. ```ruby Net::HTTP.get_response('http://www.example.com/index.html') ```

This pull request improves performace of `r_cover_range_p` (which is used by `Range#cover?`) by appropriately organizing the possible conditions of the two ranges. Checking for an empty range is deferred because...