General

Profile

sambostock (Sam Bostock)

  • Login: sambostock
  • Registered on: 07/04/2020
  • Last sign in: 06/11/2024

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 2 2

Activity

03/20/2025

05:28 PM Ruby Revision f07af59a (git): [ruby/prism] Dynamically register events to dispatch
Instead of requiring the consumer to provide a list of all events which
they wish to handle, we can give them to option of dynamically detecting
them, by scanning the listener's public methods.
This approach is similar to that used by M...
sambostock (Sam Bostock)

02/05/2023

01:37 AM Ruby Revision 45a2f1c5 (git): [rubygems/rubygems] Replace "prior to" with "immediately after"
Currently, the instructions and placeholder contradict each other.
The commit that introduced this placeholder (42bc4715d920e836c8499883d)
makes it clear that the placeholder should be replaced AFTER publishing
(i.e. once the author suc...
sambostock (Sam Bostock)

04/29/2022

07:07 PM Ruby Feature #18611: Promote best practice for combining multiple values into a hash code
I found some _interesting_ implementations while working on the Rubocop Cop, including some in Ruby itself. For example:
- [`rgeo/rgeo`](https://github.com/rubocop/rubocop/pull/10441/files#r835693586)
- [Ruby's `IPAddr#hash`](https:/...
sambostock (Sam Bostock)

08/30/2021

07:50 PM Ruby Feature #16817: attr_predicate or attr_query or attr_something for ? methods
> `attr_predicate :cat` would define a method named `:cat?` that returned the value for ivar `@cat`.
I think it would make sense for the predicate method to convert the value to `true` or `false` before returning it, to make a clear d...
sambostock (Sam Bostock)

07/07/2020

08:56 PM Ruby Bug #17017: Range#max & Range#minmax incorrectly use Float end as max
Add documentation change as an option sambostock (Sam Bostock)
08:43 PM Ruby Bug #17017: Range#max & Range#minmax incorrectly use Float end as max
Add full array example sambostock (Sam Bostock)
08:41 PM Ruby Bug #17017: Range#max & Range#minmax incorrectly use Float end as max
Add .to_a examples to clarify unexpected behaviour. sambostock (Sam Bostock)
08:16 PM Ruby Bug #17017 (Closed): Range#max & Range#minmax incorrectly use Float end as max
While continuing to add edge cases to [`Range#minmax` specs](https://github.com/ruby/spec/pull/777), I discovered the following bug:
```ruby
(1..3.1).to_a == [1, 2, 3] # As expected
(1..3.1).to_a.max == 3 # As ex...
sambostock (Sam Bostock)

07/05/2020

04:42 PM Ruby Bug #17014 (Closed): Range#minmax returns incorrect results on non-numeric exclusive ranges
The implementation of `Range#minmax` added in [d5c60214c45](https://github.com/ruby/ruby/commit/d5c60214c45bafc1cf2a516f852394986f9c84bb) causes the following incorrect behaviour:
```ruby
('a'...'c').minmax # => ["a", ["a", "b"]]
``...
sambostock (Sam Bostock)

07/04/2020

05:02 PM Ruby Revision bf1a6771 (git): Fix non-numeric exclusive Range#minmax bug
The implementation of Range#minmax added in d5c60214c45 causes the
following incorrect behaviour:
('a'...'c').minmax => ["a", ["a", "b"]]
instead of
('a'...'c').minmax => ["a", "b"]
This is because the C implementation of Range#m...
sambostock (Sam Bostock)

Also available in: Atom