medjool 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,5 +6,5 @@ module Medjool
6
6
  ORDINAL_MATCHER = /(\s*([0-9]{1,2}(st|rd|nd|th)?),?\s*)/
7
7
  YEAR_MATCHER = /(\s*([0-9]{4}\s*|\s*'?[0-9]{2}),?\s*)/
8
8
  TEXT_DATE_MATCHER = /(#{DAYNAME_MATCHER}|#{ORDINAL_MATCHER}|#{YEAR_MATCHER}|#{MONTH_MATCHER})/
9
- DATE_MATCHER = /^(#{TEXT_DATE_MATCHER}+|#{DM_DM_YYYY_MATCHER}|#{YYYY_MM_DD_MATCHER})/
9
+ DATE_MATCHER = /^[^a-zA-Z0-9]*(#{TEXT_DATE_MATCHER}+|#{DM_DM_YYYY_MATCHER}|#{YYYY_MM_DD_MATCHER})/
10
10
  end
data/lib/medjool.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Medjool
2
- VERSION = 0.2
2
+ VERSION = 0.3
3
3
 
4
4
  require 'medjool/parser'
5
5
  require 'medjool/regexs'
data/test/test_medjool.rb CHANGED
@@ -12,9 +12,9 @@ class TestMedjool < TestCase
12
12
  end
13
13
 
14
14
  def test_parse_without_context
15
- @variations = ["Thu", "Monday", "1st July", "2nd July 2010", "1 July 2009", "Monday 2nd July 2009", "Monday 2nd", "Monday 2", "Monday 2 July"]
15
+ @variations = ["Thu", "*Monday", "1st July", "2nd July 2010", "1 July 2009", "Monday 2nd July 2009", "Monday 2nd", "Monday 2", "Monday 2 July"]
16
16
  @variations.each do |t|
17
- assert_equal Date.parse(t), Medjool.parse(t)
17
+ assert_equal Date.parse(t), Medjool.parse(t), "Error parsing '#{t}'"
18
18
  end
19
19
  end
20
20
 
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medjool
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- version: "0.2"
8
+ - 3
9
+ version: "0.3"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Geers
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-09-16 00:00:00 Z
17
+ date: 2013-09-17 00:00:00 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activesupport