forked from rubinius/rubinius
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rubinius#1329 from jtdowney/range-fixes
Specs for Range#min and Range#max behavior on 1.8 and patch for 1.9
- Loading branch information
Showing
7 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,15 @@ | |||
class Range | class Range | ||
alias_method :cover?, :=== | alias_method :cover?, :=== | ||
|
|||
def max(&block) | |||
return super(&block) if block_given? | |||
return nil if @end < @begin | |||
@end | |||
end | |||
|
|||
def min(&block) | |||
return super(&block) if block_given? | |||
return nil if @end < @begin | |||
@begin | |||
end | |||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.