Project

ranger

0.0
No commit activity in last 3 years
No release in over 3 years
Gives Ruby strings a #to_range method
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0
>= 0

Runtime

 Project Readme

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