0.01
No commit activity in last 3 years
No release in over 3 years
Uses Chronic to parse incoming dates and does not raise errors on invalid multi parameter settings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 3.12
>= 0, < 3
>= 0.3.0, ~> 0.3

Runtime

 Project Readme

HasSafeDates

Installation

In your Gemfile:

gem "has_safe_dates"

Do a bundle install, then for each model add the has_safe_dates class method to your model:

class Post < ActiveRecord::Base
  has_safe_dates :published_date
end

You can now do things like this:

post.update_attributes(:published_date => '1st of November 2012')

And it will work.

Uses Chronic for parsing of the dates to help

Development

HasSafeDates is developed under Ruby-1.9.2-p290

To get the tests to run, make sure you have sqlite3 installed on your system, then run:

$ bundle install
$ rake

Publishing and Releasing a Gem

Do the following to publish and push a new gem:

  1. Make sure the local working copy is clean with no pending commits:

    $ git status

    On branch master

    nothing to commit (working directory clean)

  2. Edit the version number and increment per SEMVER versioning:

    $ vi lib/has_safe_dates/version.rb

  3. Run gem build to create the gem:

    $ gem build has_safe_dates.gemspec

  4. Test install the gem locally:

    $ gem install has_safe_dates-0.0.1.gem

  5. Commit any changes and tag the commit at the current version:

    $ git commit lib/has_safe_dates/version.rb -m "Releasing v0.0.1" $ git tag v0.0.1 $ git push

  6. Push the gem to rubygems:

    $ gem push has_safe_dates-0.0.1.gem