Skip to content

Epigene/ranger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ranger

Ranger adds a single #to_range method to ruby strings, so you can do "1..3".to_range like a bauss.

Installation

Add gem to Gemfile and bundle:

gem 'ranger'

Or install it yourself as:

$ gem install ranger

Usage

As of 1.1.0 works for string form integer and date ranges

"1..3".to_range
  #=> 1..3 # a range object
"1...3".to_range #
  #=> 1...3
"01-01-2015..02-02-2015".to_range
  #=> Thu, 01 Jan 2015 00:00:00 +0000..Mon, 02 Feb 2015 23:59:59 +0000

TODO

Implement string conversion as well, e.g. "a..c".to_range #=> ["a","b","c"] Steal Alph = ("a".."z").to_a

About

#to_range method for ruby strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published