dogweather / naturally

Natural sort algorithm
MIT License
87 stars 20 forks source link

Added sort_by_block. Spec included. #16

Closed penntaylor closed 8 years ago

penntaylor commented 9 years ago

This could be trivially reimplemented as an addition directly to #sort by using Kernel#block_given?. Since I didn't know whether that would be desirable, I implemented it as a completely separate method. Spec contains example use.

dogweather commented 9 years ago

Thanks, this is cool. What do you think making this method private, and having #sort_by handle both symbols and blocks, branching to this when needed?

penntaylor commented 9 years ago

5def93a sets up #sort_by to branch as suggested.

penntaylor commented 9 years ago

Any word on whether this can be merged?

chaimleib commented 9 years ago

+1

dogweather commented 8 years ago

Thank you everyone.