chronic

https://github.com/mojombo/chronic

Ruby

Chronic is a pure Ruby natural language date parser.

Chronic::Tag.scan_for

Internal: Scan for specified items and create respective Tag class.

token   - Token to match against.
klass   - Tag class to create.
items   - Item(s) to match. It can be Hash, String, Symbol or Regexp.
          Hash keys can be String, Symbol or Regexp, but values much be Symbol.
options - Options as hash to pass to Tag class.

Returns an instance of specified Tag klass or nil if item(s) didn't match.

Source | Google | Stack overflow

Edit

git clone [email protected]:mojombo/chronic.git

cd chronic

open lib/chronic/tag.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chronic--Tag-scan_for-for-pr


# Commit to git

git add lib/chronic/tag.rbgit commit -m "better docs for Chronic::Tag.scan_for"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chronic--Tag-scan_for-for-pr

hub pull-request


# Celebrate!