ruby/ruby — pull request #109 by ferrous26 (2012-03-26 04:55:29+00:00)
Title: Change Array#values_at to handle range index past end of array properly

This refers to [Redmine #6203](https://bugs.ruby-lang.org/issues/6203):

This changes `Array#vaules_at` to behave more consistently with array slicing.

Without this patch:
```ruby
a = [0,1,2,3,4,5]
a[4..6] # => [4, 5]
a.values_at(4..6) # => [4,5,nil]
a.values_at(4..600) # => [4,5,nil]
```

With this patch:

```ruby
a.values_at 4..6 # => [4, 5]
a.values_at 4..600 # => [4, 5]
```