eventual 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/eventual/es/event_parser.treetop +1 -1
- data/lib/eventual.rb +2 -1
- data/spec/es_eventual_spec.rb +10 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.5
|
@@ -82,7 +82,7 @@ grammar EsDates
|
|
82
82
|
end
|
83
83
|
|
84
84
|
rule weekday
|
85
|
-
(('lun' 'es'? ) / ('mar' 'tes'? ) / ('mi' '
|
85
|
+
(('lun' 'es'? ) / ('mar' 'tes'? ) / ('mi' 'ércoles'? ) / ('jue' 'ves'? ) / ('vie' 'rnes'? ) / ('sáb' 'ado'? 's'? ) / ('dom' 'ingo'? 's'? ))
|
86
86
|
end
|
87
87
|
|
88
88
|
rule space
|
data/lib/eventual.rb
CHANGED
@@ -28,7 +28,8 @@ module Eventual
|
|
28
28
|
raise ArgumentError, "Expected option `:default_event_span` to be an integer" if span && !(Integer === span)
|
29
29
|
|
30
30
|
parser = const_get("#{ lang.to_s[0..1].capitalize }DatesParser") rescue raise( NotImplementedError.new("Parsing has not yet been implemented for the language '#{lang}'"))
|
31
|
-
|
31
|
+
|
32
|
+
node = parser.new.parse text.gsub('sab', 'sáb').gsub('mie', 'mié').downcase
|
32
33
|
|
33
34
|
node.year = year if year
|
34
35
|
node.time_span = span if span
|
data/spec/es_eventual_spec.rb
CHANGED
@@ -31,6 +31,14 @@ describe Eventual, 'Es' do
|
|
31
31
|
it_should_behave_like 'correctly parses'
|
32
32
|
end
|
33
33
|
|
34
|
+
describe "month without year parsing 'marzo', case insensitive" do
|
35
|
+
before do
|
36
|
+
@result = Eventual.parse 'MarZo', :lang => 'Es'
|
37
|
+
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-31')).map
|
38
|
+
end
|
39
|
+
it_should_behave_like 'correctly parses'
|
40
|
+
end
|
41
|
+
|
34
42
|
describe 'month with year' do
|
35
43
|
describe "parsing 'marzo de 2009'" do
|
36
44
|
before do
|
@@ -165,8 +173,8 @@ describe Eventual, 'Es' do
|
|
165
173
|
it_should_behave_like 'correctly parses'
|
166
174
|
end
|
167
175
|
|
168
|
-
describe "day list with weekday 'lunes 1, martes 2 y
|
169
|
-
before { @result = Eventual.parse("lunes 1, martes 2 y
|
176
|
+
describe "day list with weekday 'lunes 1, martes 2 y miércoles 3 de marzo'" do
|
177
|
+
before { @result = Eventual.parse("lunes 1, martes 2 y miércoles 3 de marzo") }
|
170
178
|
it_should_behave_like 'correctly parses'
|
171
179
|
end
|
172
180
|
|