fuzzy-date 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/demo.rb +1 -1
  3. data/lib/fuzzy-date.rb +4 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f236e79c517af16a57861d4cf0edc48ab3b85da3
4
- data.tar.gz: 576515d413d2f9e0f124b4eb9cfdc4c8abe960a0
3
+ metadata.gz: a4b775858eb61b4d03ab7006f13a279d3be9732f
4
+ data.tar.gz: a4bfd9ea64ccbd930729e1bce1fac563a485bc85
5
5
  SHA512:
6
- metadata.gz: 4857a6d091299bb2f864512f832dc17c8f4db4f201a13264ed37dda12eb635511466ac73c7427f671293317acaa7de60e9b4bc431e786eb227bb4d5991786a08
7
- data.tar.gz: 768ee9846b0e61f700eae5371f42dd0cc6469ba148bcc2d1fe57c182a7f29719e4597c3459030102b4a3a96d3f971bfe2139f34959542298267e4f48f31ca996
6
+ metadata.gz: d4802c6c67c784947388194aca1575a873a0d27693c27a63b325da20b0e975be7e0bb110508e73a51a5f1efaedb8f31d1f0ae8815290322a6df04b66ddd770a2
7
+ data.tar.gz: b809b0de412a01fd2d191e68083c004b1838d972a379e8e4dac6cdca785f367a8dac7ec3066ba175954626f4cf938d6777480935f374a1eb0bf41c714e5fa75f
data/demo.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require( 'rubygems' )
2
2
  require( 'fuzzy-date' )
3
3
 
4
- fuzzy_date = FuzzyDate::parse_date( '15 March 1971' )
4
+ fuzzy_date = FuzzyDate::parse( '15 March 1971' )
5
5
  puts fuzzy_date.inspect
6
6
 
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module FuzzyDate
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
 
6
6
  DATE_SEPARATOR = '[^A-Za-z0-9]'
7
7
 
@@ -85,7 +85,7 @@ module FuzzyDate
85
85
  # * YYYY-MM - 3 or 4 digit year, then 1 or 2 digit month
86
86
  # * YYYY - 3 or 4 digit year
87
87
  # * MM-DD-YYYY - 1 or 2 digit month, then 1 or 2 digit day, then 1 to 4 digit year
88
- # * DD-MM-YYYY - 1 or 2 digit day, then 1 or 2 digit month, then 1 to 4 digit year if is_euro is true
88
+ # * DD-MM-YYYY - 1 or 2 digit day, then 1 or 2 digit month, then 1 to 4 digit year if euro is true
89
89
  # * MM-YYYY - 1 or 2 digit month, then 1 to 4 digit year
90
90
  # * DD-MMM - 1 or 2 digit day, then month name or abbreviation
91
91
  # * DD-MMM-YYYY - 1 or 2 digit day, then month name or abbreviation, then 1 to 4 digit year
@@ -98,7 +98,7 @@ module FuzzyDate
98
98
  # - All dates may be suffixed with the era (AD, BC, CE, BCE). AD is assumed.
99
99
  # - Dates may be prefixed by circa words (Circa, About, Abt).
100
100
 
101
- def self.parse( date, is_euro = false )
101
+ def self.parse( date, euro = false )
102
102
 
103
103
  date = clean_parameter date
104
104
 
@@ -138,7 +138,7 @@ module FuzzyDate
138
138
  day = $3 ? $3.to_i.to_s : nil
139
139
 
140
140
  #- Takes care of DD-MM-YYYY
141
- elsif date =~ /^(\d{1,2})-(\d{1,2})-(\d{1,4})$/ and is_euro
141
+ elsif date =~ /^(\d{1,2})-(\d{1,2})-(\d{1,4})$/ and euro
142
142
  day = $1.to_i.to_s
143
143
  month = $2.to_i.to_s
144
144
  year = $3.to_i.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuzzy-date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cole
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The fuzzy-date gem provides a way to parse and use incomplete dates,
14
14
  like those found in history or genealogy.