eventual 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +52 -46
- data/VERSION +1 -1
- data/lib/eventual.rb +0 -3
- data/lib/eventual/es/event_parser.treetop +17 -5
- data/lib/eventual/syntax_nodes.rb +7 -2
- data/spec/es_eventual_spec.rb +192 -112
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -56,57 +56,63 @@ Ejemplos:
|
|
56
56
|
Eventual.parse( 'del 5 al 7 de junio del 2007 a las 16:00' ).include? Date.civil(2007, 6, 6)
|
57
57
|
=> true
|
58
58
|
|
59
|
-
#
|
60
|
-
Eventual.parse(
|
61
|
-
=>
|
59
|
+
# Se puede pasar un rango de horas y se obtendrá un rango
|
60
|
+
Eventual.parse('1 de enero del 2010 de las 15:00 a las 16:00')
|
61
|
+
=> [(DateTime.civil 2010, 1, 1, 15)..(DateTime.civil 2010, 1, 1, 16)]
|
62
62
|
|
63
|
-
Eventual.parse(
|
64
|
-
=> false
|
63
|
+
Eventual.parse('1 de enero del 2010 de las 15:00 a las 16:00 y de las 17:00 a las 19:00')
|
65
64
|
|
66
|
-
# Pero se puede cambiar
|
67
|
-
dates = Eventual.parse( 'del 5 al 7 de junio del 2007 a las 16:00', :default_event_span => 120)
|
68
|
-
dates.include? DateTime.civil(2007, 6, 6, 17, 00)
|
69
|
-
=> true
|
70
65
|
|
71
66
|
Ejemplos de formatos reconocidos:
|
72
67
|
|
73
|
-
|
74
|
-
* marzo
|
75
|
-
* marzo
|
76
|
-
*
|
77
|
-
* marzo
|
78
|
-
* marzo
|
79
|
-
*
|
80
|
-
|
81
|
-
* lunes y martes
|
82
|
-
* lunes y martes
|
83
|
-
* lunes y martes
|
84
|
-
*
|
85
|
-
*
|
86
|
-
*
|
87
|
-
*
|
88
|
-
*
|
89
|
-
*
|
90
|
-
*
|
91
|
-
* 1
|
92
|
-
* 1
|
93
|
-
*
|
94
|
-
*
|
95
|
-
*
|
96
|
-
*
|
97
|
-
|
98
|
-
*
|
99
|
-
*
|
100
|
-
* lunes y martes del 1 al 22 de marzo del '10
|
101
|
-
*
|
102
|
-
*
|
103
|
-
*
|
104
|
-
* lunes y martes de
|
105
|
-
* lunes y martes
|
106
|
-
* lunes y martes
|
107
|
-
|
108
|
-
* lunes y martes de diciembre a las
|
109
|
-
* lunes y martes de diciembre a las
|
68
|
+
- Por mes
|
69
|
+
* marzo
|
70
|
+
* marzo de 2009
|
71
|
+
* marzo del 2009
|
72
|
+
* todo marzo 2009
|
73
|
+
* marzo, 2009
|
74
|
+
* marzo '09
|
75
|
+
- Lista de dias
|
76
|
+
* lunes y martes marzo del 2010
|
77
|
+
* todos los lunes y martes de marzo del 2010
|
78
|
+
* lunes y martes durante marzo del 2010
|
79
|
+
* lunes y martes durante todo marzo del 2010
|
80
|
+
* lunes y martes, marzo del 2010
|
81
|
+
* 21 de marzo
|
82
|
+
* 21 marzo
|
83
|
+
* domingo 21 de marzo
|
84
|
+
* domingo, 21 de marzo
|
85
|
+
* 1, 2 y 3 de marzo
|
86
|
+
* 1, 2 y 3 marzo
|
87
|
+
* lunes 1, martes 2 y miercoles 3 de marzo
|
88
|
+
* 1 al 3 de marzo
|
89
|
+
* 1 al 3, marzo
|
90
|
+
* del 1 al 3 de marzo
|
91
|
+
* del 1 al 3, marzo
|
92
|
+
- Rango de fechas
|
93
|
+
* 24 de febrero al 3 de marzo del 2010
|
94
|
+
* 24 de diciembre del 2009 al 3 de enero del 2010
|
95
|
+
* lunes y martes del 1 al 22 de marzo del '10
|
96
|
+
* fines de semana del 1 al 22 de marzo del '10
|
97
|
+
* entre semana del 1 al 22 de marzo del '10
|
98
|
+
* lunes y martes del 1 al 22 de marzo del '10
|
99
|
+
* todos los lunes y martes del 1 al 22 de marzo del '10
|
100
|
+
* los lunes y martes del 1 al 22 de marzo del '10
|
101
|
+
* los lunes y los martes del 1 al 22 de marzo del '10
|
102
|
+
- Con horario (se puede aplicar a todos los casos)
|
103
|
+
* lunes y martes de diciembre a las 15
|
104
|
+
* lunes y martes, de diciembre a las 15
|
105
|
+
* lunes y martes de diciembre a las 15:30 hrs.
|
106
|
+
* lunes y martes de diciembre a las 15:00 y 16:00 horas
|
107
|
+
* lunes y martes de diciembre a las 15:00 y 16:00 horas
|
108
|
+
* lunes y martes de diciembre a las 3 am
|
109
|
+
* lunes y martes de diciembre a las 3:15 p.m.
|
110
|
+
- Con rango de horario (se puede aplicar a todos los casos)
|
111
|
+
* 1 de enero del 2010 de las 15:00 a las 16:00
|
112
|
+
* 1 de enero del 2010 de las 15:00 a las 16:00 y de las 17:00 a las 19:00
|
113
|
+
* 1 de enero del 2010 de las 15:00 a las 16:00, de las 17:00 a las 19:00 y de las 21:00 a las 22:00
|
114
|
+
- Fechas compuestas
|
115
|
+
* 1 de enero y lunes y martes del 1 de octubre al 2 de diciembre del 2008
|
110
116
|
|
111
117
|
== TODO:
|
112
118
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.6
|
data/lib/eventual.rb
CHANGED
@@ -22,17 +22,14 @@ module Eventual
|
|
22
22
|
def self.parse text, opts = {}
|
23
23
|
lang = opts.delete(:lang) || 'Es'
|
24
24
|
year = opts.delete(:default_year)
|
25
|
-
span = opts.delete(:default_event_span)
|
26
25
|
|
27
26
|
raise ArgumentError, "Expected option `:default_year` to be an integer" if year && !(Integer === year)
|
28
|
-
raise ArgumentError, "Expected option `:default_event_span` to be an integer" if span && !(Integer === span)
|
29
27
|
|
30
28
|
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
29
|
|
32
30
|
node = parser.new.parse text.gsub('sab', 'sáb').gsub('mie', 'mié').downcase
|
33
31
|
|
34
32
|
node.year = year if year
|
35
|
-
node.time_span = span if span
|
36
33
|
node
|
37
34
|
end
|
38
35
|
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
grammar EsDates
|
2
2
|
rule root
|
3
|
-
(
|
3
|
+
compound_date (((space 'y' / ',') space / newline) compound_date)* <Eventual::Node> # ((space 'y' / ',') compound_date)*
|
4
|
+
end
|
5
|
+
|
6
|
+
rule compound_date
|
7
|
+
(same_year_date_list / dates) year? times?
|
4
8
|
end
|
5
9
|
|
6
10
|
rule dates
|
7
|
-
|
11
|
+
period / date
|
8
12
|
end
|
9
13
|
|
10
14
|
rule period
|
@@ -15,8 +19,8 @@ grammar EsDates
|
|
15
19
|
weekday_constrain? day_number month_name?
|
16
20
|
end
|
17
21
|
|
18
|
-
rule
|
19
|
-
dates (',' space dates)* (space 'y' space dates)
|
22
|
+
rule same_year_date_list
|
23
|
+
dates (',' space dates)* (space 'y' space dates)
|
20
24
|
end
|
21
25
|
|
22
26
|
rule range
|
@@ -33,7 +37,7 @@ grammar EsDates
|
|
33
37
|
|
34
38
|
##########
|
35
39
|
rule times
|
36
|
-
|
40
|
+
time_range_list / time_list
|
37
41
|
end
|
38
42
|
|
39
43
|
rule time_list
|
@@ -51,6 +55,10 @@ grammar EsDates
|
|
51
55
|
rule time_range
|
52
56
|
space 'de' space ('las' / 'la') first:(time_12 / time_24) space 'a' space ('las' / 'la') last:(time_12 / time_24) <Eventual::TimeRange>
|
53
57
|
end
|
58
|
+
|
59
|
+
rule time_range_list
|
60
|
+
time_range ((space 'y' / ',') time_range)* <Eventual::TimeRangeList>
|
61
|
+
end
|
54
62
|
|
55
63
|
##########
|
56
64
|
rule month_name
|
@@ -88,4 +96,8 @@ grammar EsDates
|
|
88
96
|
rule space
|
89
97
|
' '+
|
90
98
|
end
|
99
|
+
|
100
|
+
rule newline
|
101
|
+
space* "\n" space*
|
102
|
+
end
|
91
103
|
end
|
@@ -42,7 +42,6 @@ module Eventual
|
|
42
42
|
|
43
43
|
class Node < Treetop::Runtime::SyntaxNode
|
44
44
|
attr_accessor :year
|
45
|
-
attr_accessor :time_span
|
46
45
|
attr_accessor :month
|
47
46
|
attr_accessor :weekdays
|
48
47
|
attr_accessor :times
|
@@ -219,8 +218,14 @@ module Eventual
|
|
219
218
|
pm? ? super + 12 : super
|
220
219
|
end
|
221
220
|
end
|
221
|
+
|
222
|
+
class TimeRangeList < TimeList
|
223
|
+
def make year, month, day
|
224
|
+
map { |e| e.make year, month, day }
|
225
|
+
end
|
226
|
+
end
|
222
227
|
|
223
|
-
class TimeRange <
|
228
|
+
class TimeRange < Time #:nodoc:
|
224
229
|
def make year, month, day
|
225
230
|
first_time = DateTime.civil year, month, day, first.hour, first.minute
|
226
231
|
last_time = DateTime.civil year, month, day, last.hour, last.minute
|
data/spec/es_eventual_spec.rb
CHANGED
@@ -5,17 +5,26 @@ describe Eventual, 'Es' do
|
|
5
5
|
before do
|
6
6
|
Date.stub!(:today).and_return Date.civil(2010)
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
describe 'proxy' do
|
10
10
|
it "should raise NotImplementedError if using not implemented language" do
|
11
11
|
lambda { Eventual.parse 'marzo', :lang => 'WP' }.should raise_error(NotImplementedError)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
shared_examples_for 'correctly parses' do
|
15
|
+
shared_examples_for 'correctly parses dates' do
|
16
16
|
it { @result.should_not be_nil }
|
17
17
|
it { @result.to_a.size.should == @dates.map.size }
|
18
18
|
it { @result.should map_dates *@dates }
|
19
|
+
end
|
20
|
+
|
21
|
+
shared_examples_for 'correctly parses time ranges' do
|
22
|
+
it { @result.should_not be_nil }
|
23
|
+
it { @result.to_a.size.should == @ranges.map.size }
|
24
|
+
it { @result.should map_dates *@ranges }
|
25
|
+
end
|
26
|
+
|
27
|
+
shared_examples_for 'includes corresponding dates' do
|
19
28
|
it { @dates.map{ |date| @result.should include(date) } }
|
20
29
|
it { @result.should_not include(@dates.first - 1) }
|
21
30
|
it { @result.should_not include(@dates.last + 1) }
|
@@ -28,7 +37,8 @@ describe Eventual, 'Es' do
|
|
28
37
|
@result = Eventual.parse 'marzo', :lang => 'Es'
|
29
38
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-31')).map
|
30
39
|
end
|
31
|
-
it_should_behave_like 'correctly parses'
|
40
|
+
it_should_behave_like 'correctly parses dates'
|
41
|
+
it_should_behave_like 'includes corresponding dates'
|
32
42
|
end
|
33
43
|
|
34
44
|
describe "month without year parsing 'marzo', case insensitive" do
|
@@ -36,16 +46,18 @@ describe Eventual, 'Es' do
|
|
36
46
|
@result = Eventual.parse 'MarZo', :lang => 'Es'
|
37
47
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-31')).map
|
38
48
|
end
|
39
|
-
it_should_behave_like 'correctly parses'
|
49
|
+
it_should_behave_like 'correctly parses dates'
|
50
|
+
it_should_behave_like 'includes corresponding dates'
|
40
51
|
end
|
41
|
-
|
52
|
+
|
42
53
|
describe 'month with year' do
|
43
54
|
describe "parsing 'marzo de 2009'" do
|
44
55
|
before do
|
45
56
|
@result = Eventual.parse "marzo de 2009"
|
46
57
|
@dates = (Date.parse('2009-3-1')..Date.parse('2009-3-31')).map
|
47
58
|
end
|
48
|
-
it_should_behave_like 'correctly parses'
|
59
|
+
it_should_behave_like 'correctly parses dates'
|
60
|
+
it_should_behave_like 'includes corresponding dates'
|
49
61
|
end
|
50
62
|
|
51
63
|
describe "parsing 'marzo del 2009'" do
|
@@ -53,7 +65,8 @@ describe Eventual, 'Es' do
|
|
53
65
|
@result = Eventual.parse "marzo del 2009"
|
54
66
|
@dates = (Date.parse('2009-3-1')..Date.parse('2009-3-31')).map
|
55
67
|
end
|
56
|
-
it_should_behave_like 'correctly parses'
|
68
|
+
it_should_behave_like 'correctly parses dates'
|
69
|
+
it_should_behave_like 'includes corresponding dates'
|
57
70
|
end
|
58
71
|
|
59
72
|
describe "parsing 'marzo 2009'" do
|
@@ -61,7 +74,8 @@ describe Eventual, 'Es' do
|
|
61
74
|
@result = Eventual.parse "marzo 2009"
|
62
75
|
@dates = (Date.parse('2009-3-1')..Date.parse('2009-3-31')).map
|
63
76
|
end
|
64
|
-
it_should_behave_like 'correctly parses'
|
77
|
+
it_should_behave_like 'correctly parses dates'
|
78
|
+
it_should_behave_like 'includes corresponding dates'
|
65
79
|
end
|
66
80
|
|
67
81
|
describe "parsing 'marzo, 2009'" do
|
@@ -69,7 +83,8 @@ describe Eventual, 'Es' do
|
|
69
83
|
@result = Eventual.parse "marzo, 2009"
|
70
84
|
@dates = (Date.parse('2009-3-1')..Date.parse('2009-3-31')).map
|
71
85
|
end
|
72
|
-
it_should_behave_like 'correctly parses'
|
86
|
+
it_should_behave_like 'correctly parses dates'
|
87
|
+
it_should_behave_like 'includes corresponding dates'
|
73
88
|
end
|
74
89
|
|
75
90
|
describe "parsing 'marzo '09'" do
|
@@ -77,7 +92,8 @@ describe Eventual, 'Es' do
|
|
77
92
|
@result = Eventual.parse "marzo '09"
|
78
93
|
@dates = (Date.parse('2009-3-1')..Date.parse('2009-3-31')).map
|
79
94
|
end
|
80
|
-
it_should_behave_like 'correctly parses'
|
95
|
+
it_should_behave_like 'correctly parses dates'
|
96
|
+
it_should_behave_like 'includes corresponding dates'
|
81
97
|
end
|
82
98
|
end
|
83
99
|
|
@@ -88,27 +104,32 @@ describe Eventual, 'Es' do
|
|
88
104
|
|
89
105
|
describe "parsing 'lunes y martes marzo del 2010'" do
|
90
106
|
before { @result = Eventual.parse "lunes y martes marzo del 2010" }
|
91
|
-
it_should_behave_like 'correctly parses'
|
107
|
+
it_should_behave_like 'correctly parses dates'
|
108
|
+
it_should_behave_like 'includes corresponding dates'
|
92
109
|
end
|
93
110
|
|
94
111
|
describe "parsing 'lunes y martes de marzo del 2010'" do
|
95
112
|
before { @result = Eventual.parse "lunes y martes de marzo del 2010" }
|
96
|
-
it_should_behave_like 'correctly parses'
|
113
|
+
it_should_behave_like 'correctly parses dates'
|
114
|
+
it_should_behave_like 'includes corresponding dates'
|
97
115
|
end
|
98
116
|
|
99
117
|
describe "parsing 'lunes y martes durante marzo del 2010'" do
|
100
118
|
before { @result = Eventual.parse "lunes y martes durante marzo del 2010" }
|
101
|
-
it_should_behave_like 'correctly parses'
|
119
|
+
it_should_behave_like 'correctly parses dates'
|
120
|
+
it_should_behave_like 'includes corresponding dates'
|
102
121
|
end
|
103
122
|
|
104
123
|
describe "parsing 'lunes y martes durante todo marzo del 2010'" do
|
105
124
|
before { @result = Eventual.parse "lunes y martes durante todo marzo del 2010" }
|
106
|
-
it_should_behave_like 'correctly parses'
|
125
|
+
it_should_behave_like 'correctly parses dates'
|
126
|
+
it_should_behave_like 'includes corresponding dates'
|
107
127
|
end
|
108
128
|
|
109
|
-
describe "parsing 'lunes y martes, marzo
|
129
|
+
describe "parsing 'lunes y martes, marzo de 2010'" do
|
110
130
|
before { @result = Eventual.parse "lunes y martes, marzo del 2010" }
|
111
|
-
it_should_behave_like 'correctly parses'
|
131
|
+
it_should_behave_like 'correctly parses dates'
|
132
|
+
it_should_behave_like 'includes corresponding dates'
|
112
133
|
end
|
113
134
|
end
|
114
135
|
|
@@ -122,34 +143,39 @@ describe Eventual, 'Es' do
|
|
122
143
|
|
123
144
|
describe "should single day number for '21 de marzo'" do
|
124
145
|
before { @result = Eventual.parse("21 de marzo") }
|
125
|
-
it_should_behave_like 'correctly parses'
|
146
|
+
it_should_behave_like 'correctly parses dates'
|
147
|
+
it_should_behave_like 'includes corresponding dates'
|
126
148
|
end
|
127
149
|
|
128
150
|
describe "parsing '21 marzo'" do
|
129
151
|
before { @result = Eventual.parse("21 marzo") }
|
130
|
-
it_should_behave_like 'correctly parses'
|
152
|
+
it_should_behave_like 'correctly parses dates'
|
153
|
+
it_should_behave_like 'includes corresponding dates'
|
131
154
|
end
|
132
155
|
|
133
156
|
# describe "parsing 'marzo 21'" do
|
134
157
|
# before { @result = Eventual.parse("21 marzo") }
|
135
|
-
# it_should_behave_like 'correctly parses'
|
158
|
+
# it_should_behave_like 'correctly parses dates'
|
159
|
+
# it_should_behave_like 'includes corresponding dates'
|
136
160
|
# end
|
137
161
|
|
138
162
|
describe 'date with wday' do
|
139
163
|
describe "parsing 'domingo 21 de marzo'" do
|
140
164
|
before { @result = Eventual.parse("domingo 21 de marzo") }
|
141
|
-
it_should_behave_like 'correctly parses'
|
165
|
+
it_should_behave_like 'correctly parses dates'
|
166
|
+
it_should_behave_like 'includes corresponding dates'
|
142
167
|
end
|
143
168
|
|
144
169
|
it "should raise WdayMatchError if weekday doesn't correspond to date" do
|
145
170
|
lambda { Eventual.parse("lunes 21 de marzo").map }.should raise_error(Eventual::WdayMatchError)
|
146
171
|
end
|
147
172
|
end
|
148
|
-
|
173
|
+
|
149
174
|
describe 'date with wday and comma' do
|
150
175
|
describe "parsing 'domingo, 21 de marzo'" do
|
151
176
|
before { @result = Eventual.parse("domingo, 21 de marzo") }
|
152
|
-
it_should_behave_like 'correctly parses'
|
177
|
+
it_should_behave_like 'correctly parses dates'
|
178
|
+
it_should_behave_like 'includes corresponding dates'
|
153
179
|
end
|
154
180
|
|
155
181
|
it "should raise WdayMatchError if weekday doesn't correspond to date" do
|
@@ -165,17 +191,20 @@ describe Eventual, 'Es' do
|
|
165
191
|
|
166
192
|
describe "day list for '1, 2 y 3 de marzo'" do
|
167
193
|
before { @result = Eventual.parse("1, 2 y 3 marzo") }
|
168
|
-
it_should_behave_like 'correctly parses'
|
194
|
+
it_should_behave_like 'correctly parses dates'
|
195
|
+
it_should_behave_like 'includes corresponding dates'
|
169
196
|
end
|
170
197
|
|
171
198
|
describe "day list for '1, 2 y 3 marzo'" do
|
172
199
|
before { @result = Eventual.parse("1, 2 y 3 de marzo") }
|
173
|
-
it_should_behave_like 'correctly parses'
|
200
|
+
it_should_behave_like 'correctly parses dates'
|
201
|
+
it_should_behave_like 'includes corresponding dates'
|
174
202
|
end
|
175
203
|
|
176
204
|
describe "day list with weekday 'lunes 1, martes 2 y miércoles 3 de marzo'" do
|
177
205
|
before { @result = Eventual.parse("lunes 1, martes 2 y miércoles 3 de marzo") }
|
178
|
-
it_should_behave_like 'correctly parses'
|
206
|
+
it_should_behave_like 'correctly parses dates'
|
207
|
+
it_should_behave_like 'includes corresponding dates'
|
179
208
|
end
|
180
209
|
|
181
210
|
it "should raise WdayMatchError if weekday doesn't correspond to date" do
|
@@ -192,22 +221,26 @@ describe Eventual, 'Es' do
|
|
192
221
|
|
193
222
|
describe "day list for '1 al 3 de marzo" do
|
194
223
|
before { @result = Eventual.parse("1 al 3 de marzo del '10") }
|
195
|
-
it_should_behave_like 'correctly parses'
|
224
|
+
it_should_behave_like 'correctly parses dates'
|
225
|
+
it_should_behave_like 'includes corresponding dates'
|
196
226
|
end
|
197
227
|
|
198
228
|
describe "day list for '1 al 3, marzo" do
|
199
229
|
before { @result = Eventual.parse("1 al 3, marzo del '10") }
|
200
|
-
it_should_behave_like 'correctly parses'
|
230
|
+
it_should_behave_like 'correctly parses dates'
|
231
|
+
it_should_behave_like 'includes corresponding dates'
|
201
232
|
end
|
202
233
|
|
203
234
|
describe "day list for 'del 1 al 3 de marzo" do
|
204
235
|
before { @result = Eventual.parse("del 1 al 3 de marzo del '10") }
|
205
|
-
it_should_behave_like 'correctly parses'
|
236
|
+
it_should_behave_like 'correctly parses dates'
|
237
|
+
it_should_behave_like 'includes corresponding dates'
|
206
238
|
end
|
207
239
|
|
208
240
|
describe "day list for 'del 1 al 3, marzo" do
|
209
241
|
before { @result = Eventual.parse("del 1 al 3, marzo del '10") }
|
210
|
-
it_should_behave_like 'correctly parses'
|
242
|
+
it_should_behave_like 'correctly parses dates'
|
243
|
+
it_should_behave_like 'includes corresponding dates'
|
211
244
|
end
|
212
245
|
end
|
213
246
|
|
@@ -216,7 +249,8 @@ describe Eventual, 'Es' do
|
|
216
249
|
@result = Eventual.parse "24 de febrero al 3 de marzo del 2010"
|
217
250
|
@dates = (Date.parse('2010-2-24')..Date.parse('2010-3-3'))
|
218
251
|
end
|
219
|
-
it_should_behave_like 'correctly parses'
|
252
|
+
it_should_behave_like 'correctly parses dates'
|
253
|
+
it_should_behave_like 'includes corresponding dates'
|
220
254
|
end
|
221
255
|
|
222
256
|
describe "spanning diferent years '24 de diciembre del 2009 al 3 de enero del 2010" do
|
@@ -224,27 +258,31 @@ describe Eventual, 'Es' do
|
|
224
258
|
@result = Eventual.parse("24 de diciembre del 2009 al 3 de enero del 2010")
|
225
259
|
@dates = (Date.parse('2009-12-24')..Date.parse('2010-1-3'))
|
226
260
|
end
|
227
|
-
it_should_behave_like 'correctly parses'
|
261
|
+
it_should_behave_like 'correctly parses dates'
|
262
|
+
it_should_behave_like 'includes corresponding dates'
|
228
263
|
end
|
229
|
-
|
264
|
+
|
230
265
|
describe 'period spanning two dates' do
|
231
266
|
before do
|
232
267
|
@dates = (Date.parse('2008-10-1')..DateTime.parse('2008-12-2'))
|
233
268
|
end
|
234
|
-
|
269
|
+
|
235
270
|
describe "1 de octubre a 2 de diciembre del 2008" do
|
236
271
|
before { @result = Eventual.parse "1 de octubre a 2 de diciembre del 2008" }
|
237
|
-
it_should_behave_like 'correctly parses'
|
272
|
+
it_should_behave_like 'correctly parses dates'
|
273
|
+
it_should_behave_like 'includes corresponding dates'
|
238
274
|
end
|
239
|
-
|
275
|
+
|
240
276
|
describe "1 de octubre al 2 de diciembre del 2008" do
|
241
277
|
before { @result = Eventual.parse "1 de octubre al 2 de diciembre del 2008" }
|
242
|
-
it_should_behave_like 'correctly parses'
|
278
|
+
it_should_behave_like 'correctly parses dates'
|
279
|
+
it_should_behave_like 'includes corresponding dates'
|
243
280
|
end
|
244
281
|
|
245
282
|
describe "del miercoles 1 de octubre al martes 2 de diciembre del 2008" do
|
246
283
|
before { @result = Eventual.parse "del miercoles 1 de octubre al martes 2 de diciembre del 2008" }
|
247
|
-
it_should_behave_like 'correctly parses'
|
284
|
+
it_should_behave_like 'correctly parses dates'
|
285
|
+
it_should_behave_like 'includes corresponding dates'
|
248
286
|
end
|
249
287
|
end
|
250
288
|
|
@@ -253,24 +291,27 @@ describe Eventual, 'Es' do
|
|
253
291
|
@result = Eventual.parse "lunes y martes del 1 de octubre al 2 de diciembre del 2008"
|
254
292
|
@dates = (Date.parse('2008-10-1')..DateTime.parse('2008-12-2')).reject{ |day| not [1,2].include?(day.wday) }
|
255
293
|
end
|
256
|
-
it_should_behave_like 'correctly parses'
|
294
|
+
it_should_behave_like 'correctly parses dates'
|
295
|
+
it_should_behave_like 'includes corresponding dates'
|
257
296
|
end
|
258
|
-
|
297
|
+
|
259
298
|
describe "lunes y martes, del 1 de octubre al 2 de diciembre del 2008" do
|
260
299
|
before do
|
261
300
|
@result = Eventual.parse "lunes y martes, del 1 de octubre al 2 de diciembre del 2008"
|
262
301
|
@dates = (Date.parse('2008-10-1')..DateTime.parse('2008-12-2')).reject{ |day| not [1,2].include?(day.wday) }
|
263
302
|
end
|
264
|
-
it_should_behave_like 'correctly parses'
|
303
|
+
it_should_behave_like 'correctly parses dates'
|
304
|
+
it_should_behave_like 'includes corresponding dates'
|
265
305
|
end
|
266
|
-
|
306
|
+
|
267
307
|
describe 'with weekday constrain' do
|
268
308
|
describe "wdays for 'lunes y martes del 1 al 22 de marzo del '10" do
|
269
309
|
before do
|
270
310
|
@result = Eventual.parse "lunes y martes del 1 al 22 de marzo del '10"
|
271
311
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-22')).reject{ |day| not [1,2].include?(day.wday) }
|
272
312
|
end
|
273
|
-
it_should_behave_like 'correctly parses'
|
313
|
+
it_should_behave_like 'correctly parses dates'
|
314
|
+
it_should_behave_like 'includes corresponding dates'
|
274
315
|
end
|
275
316
|
|
276
317
|
describe "wdays for 'fines de semana del 1 al 22 de marzo del '10" do
|
@@ -278,7 +319,8 @@ describe Eventual, 'Es' do
|
|
278
319
|
@result = Eventual.parse "fines de semana del 1 al 22 de marzo del '10"
|
279
320
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-22')).map.reject{ |day| not [6,0].include?(day.wday) }
|
280
321
|
end
|
281
|
-
it_should_behave_like 'correctly parses'
|
322
|
+
it_should_behave_like 'correctly parses dates'
|
323
|
+
it_should_behave_like 'includes corresponding dates'
|
282
324
|
end
|
283
325
|
|
284
326
|
describe "wdays for 'entre semana del 1 al 22 de marzo del '10" do
|
@@ -286,9 +328,10 @@ describe Eventual, 'Es' do
|
|
286
328
|
@result = Eventual.parse("entre semana del 1 al 22 de marzo del '10")
|
287
329
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-22')).map.reject{ |day| not (1..5).map.include?(day.wday) }
|
288
330
|
end
|
289
|
-
it_should_behave_like 'correctly parses'
|
331
|
+
it_should_behave_like 'correctly parses dates'
|
332
|
+
it_should_behave_like 'includes corresponding dates'
|
290
333
|
end
|
291
|
-
|
334
|
+
|
292
335
|
describe 'sugar for wday constrain' do
|
293
336
|
before do
|
294
337
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-22')).reject{ |day| not [1,2].include?(day.wday) }
|
@@ -296,22 +339,26 @@ describe Eventual, 'Es' do
|
|
296
339
|
|
297
340
|
describe "wdays for 'lunes y martes del 1 al 22 de marzo del '10" do
|
298
341
|
before { @result = Eventual.parse("lunes y martes del 1 al 22 de marzo del '10") }
|
299
|
-
it_should_behave_like 'correctly parses'
|
342
|
+
it_should_behave_like 'correctly parses dates'
|
343
|
+
it_should_behave_like 'includes corresponding dates'
|
300
344
|
end
|
301
345
|
|
302
346
|
describe "wdays for 'todos los lunes y martes del 1 al 22 de marzo del '10" do
|
303
347
|
before { @result = Eventual.parse("todos los lunes y martes del 1 al 22 de marzo del '10") }
|
304
|
-
it_should_behave_like 'correctly parses'
|
348
|
+
it_should_behave_like 'correctly parses dates'
|
349
|
+
it_should_behave_like 'includes corresponding dates'
|
305
350
|
end
|
306
351
|
|
307
352
|
describe "wdays for 'los lunes y martes del 1 al 22 de marzo del '10" do
|
308
353
|
before { @result = Eventual.parse("los lunes y martes del 1 al 22 de marzo del '10") }
|
309
|
-
it_should_behave_like 'correctly parses'
|
354
|
+
it_should_behave_like 'correctly parses dates'
|
355
|
+
it_should_behave_like 'includes corresponding dates'
|
310
356
|
end
|
311
|
-
|
357
|
+
|
312
358
|
describe "wdays for 'los lunes y los martes del 1 al 22 de marzo del '10" do
|
313
359
|
before { @result = Eventual.parse("los lunes y los martes del 1 al 22 de marzo del '10") }
|
314
|
-
it_should_behave_like 'correctly parses'
|
360
|
+
it_should_behave_like 'correctly parses dates'
|
361
|
+
it_should_behave_like 'includes corresponding dates'
|
315
362
|
end
|
316
363
|
end
|
317
364
|
end
|
@@ -323,16 +370,18 @@ describe Eventual, 'Es' do
|
|
323
370
|
@result = Eventual.parse('octubre a diciembre del 2008')
|
324
371
|
@dates = (Date.parse('2008-10-1')..DateTime.parse('2008-12-31')).map
|
325
372
|
end
|
326
|
-
it_should_behave_like 'correctly parses'
|
373
|
+
it_should_behave_like 'correctly parses dates'
|
374
|
+
it_should_behave_like 'includes corresponding dates'
|
327
375
|
end
|
328
|
-
|
329
|
-
|
376
|
+
|
377
|
+
|
330
378
|
describe 'lunes y martes de octubre del 2007 a diciembre del 2008' do
|
331
379
|
before do
|
332
380
|
@result = Eventual.parse('lunes y martes de octubre del 2007 a diciembre del 2008')
|
333
381
|
@dates = (Date.parse('2007-10-1')..DateTime.parse('2008-12-31')).reject{ |day| not [1,2].include?(day.wday) }
|
334
382
|
end
|
335
|
-
it_should_behave_like 'correctly parses'
|
383
|
+
it_should_behave_like 'correctly parses dates'
|
384
|
+
it_should_behave_like 'includes corresponding dates'
|
336
385
|
end
|
337
386
|
end
|
338
387
|
|
@@ -341,182 +390,213 @@ describe Eventual, 'Es' do
|
|
341
390
|
@result = Eventual.parse "1 de enero y lunes y martes del 1 de octubre al 2 de diciembre del 2008"
|
342
391
|
@dates = [Date.parse('2008-1-1')] + (Date.parse('2008-10-1')..Date.parse('2008-12-2')).reject{ |day| not [1,2].include?(day.wday) }
|
343
392
|
end
|
344
|
-
it_should_behave_like 'correctly parses'
|
393
|
+
it_should_behave_like 'correctly parses dates'
|
394
|
+
it_should_behave_like 'includes corresponding dates'
|
345
395
|
end
|
346
396
|
|
347
|
-
describe 'compound dates
|
397
|
+
describe 'compound dates list' do
|
348
398
|
before do
|
349
|
-
@result = Eventual.parse "
|
350
|
-
@dates = [Date.parse('
|
399
|
+
@result = Eventual.parse "31 de diciembre de 1998 y 1 de enero de 1999"
|
400
|
+
@dates = [Date.parse('1998-12-31'), Date.parse('1999-1-1')]
|
351
401
|
end
|
352
|
-
it_should_behave_like 'correctly parses'
|
402
|
+
it_should_behave_like 'correctly parses dates'
|
403
|
+
it_should_behave_like 'includes corresponding dates'
|
353
404
|
end
|
354
405
|
|
406
|
+
describe 'compound dates list separated by new line' do
|
407
|
+
before do
|
408
|
+
@result = Eventual.parse "31 de diciembre de 1998 \n 1 de enero de 1999"
|
409
|
+
@dates = [Date.parse('1998-12-31'), Date.parse('1999-1-1')]
|
410
|
+
end
|
411
|
+
it_should_behave_like 'correctly parses dates'
|
412
|
+
it_should_behave_like 'includes corresponding dates'
|
413
|
+
end
|
414
|
+
|
355
415
|
describe 'with time constrain' do
|
356
416
|
shared_examples_for 'outputs DateTime' do
|
357
417
|
it "should all be DateTime" do
|
358
418
|
@result.map{ |d| d.should be_a(DateTime) }
|
359
419
|
end
|
360
420
|
end
|
361
|
-
|
421
|
+
|
362
422
|
describe 'single day with time' do
|
363
423
|
before do
|
364
424
|
@result = Eventual.parse('1 de enero del 2010 a las 15:00')
|
365
425
|
@dates = [DateTime.civil 2010, 1, 1, 15]
|
366
426
|
end
|
367
|
-
|
368
|
-
it_should_behave_like 'correctly parses'
|
427
|
+
|
428
|
+
it_should_behave_like 'correctly parses dates'
|
429
|
+
it_should_behave_like 'includes corresponding dates'
|
369
430
|
it_should_behave_like 'outputs DateTime'
|
370
431
|
end
|
371
|
-
|
432
|
+
|
372
433
|
describe 'single time with no sugar for month range' do
|
373
434
|
before do
|
374
435
|
@result = Eventual.parse('lunes y martes de diciembre del 2010 a las 15:00')
|
375
436
|
@dates = (DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).reject{ |day| not [1,2].include?(day.wday) }
|
376
437
|
end
|
377
|
-
it_should_behave_like 'correctly parses'
|
438
|
+
it_should_behave_like 'correctly parses dates'
|
439
|
+
it_should_behave_like 'includes corresponding dates'
|
378
440
|
it_should_behave_like 'outputs DateTime'
|
379
441
|
end
|
380
|
-
|
442
|
+
|
381
443
|
describe 'single time with sugar 1 for month range' do
|
382
444
|
before do
|
383
445
|
@result = Eventual.parse('lunes y martes de diciembre a las 15:00 hrs.')
|
384
446
|
@dates = (DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).reject{ |day| not [1,2].include?(day.wday) }
|
385
447
|
end
|
386
|
-
it_should_behave_like 'correctly parses'
|
448
|
+
it_should_behave_like 'correctly parses dates'
|
449
|
+
it_should_behave_like 'includes corresponding dates'
|
387
450
|
it_should_behave_like 'outputs DateTime'
|
388
451
|
end
|
389
|
-
|
452
|
+
|
390
453
|
describe 'single time with sugar 2 for month range' do
|
391
454
|
before do
|
392
455
|
@result = Eventual.parse('lunes y martes de diciembre a las 15:00hrs')
|
393
456
|
@dates = (DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).reject{ |day| not [1,2].include?(day.wday) }
|
394
457
|
end
|
395
|
-
it_should_behave_like 'correctly parses'
|
458
|
+
it_should_behave_like 'correctly parses dates'
|
459
|
+
it_should_behave_like 'includes corresponding dates'
|
396
460
|
it_should_behave_like 'outputs DateTime'
|
397
461
|
end
|
398
|
-
|
462
|
+
|
399
463
|
describe 'single time with sugar 3 for month range' do
|
400
464
|
before do
|
401
465
|
@result = Eventual.parse('lunes y martes de diciembre a las 15 horas')
|
402
466
|
@dates = (DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).reject{ |day| not [1,2].include?(day.wday) }
|
403
467
|
end
|
404
|
-
it_should_behave_like 'correctly parses'
|
468
|
+
it_should_behave_like 'correctly parses dates'
|
469
|
+
it_should_behave_like 'includes corresponding dates'
|
405
470
|
it_should_behave_like 'outputs DateTime'
|
406
471
|
end
|
407
|
-
|
472
|
+
|
408
473
|
describe 'two times for month range' do
|
409
474
|
before do
|
410
475
|
@result = Eventual.parse('lunes y martes de diciembre a las 16:00 y 15:00 horas')
|
411
476
|
@dates = ((DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).map + (DateTime.parse('2010-12-1T16:00')..DateTime.parse('2010-12-31T16:00')).map).reject{ |day| not [1,2].include?(day.wday) }
|
412
477
|
end
|
413
|
-
it_should_behave_like 'correctly parses'
|
478
|
+
it_should_behave_like 'correctly parses dates'
|
479
|
+
it_should_behave_like 'includes corresponding dates'
|
414
480
|
it_should_behave_like 'outputs DateTime'
|
415
|
-
|
481
|
+
|
416
482
|
it "should not include other time" do
|
417
483
|
@result.should_not include(DateTime.parse('2010-12-06T14:00'))
|
418
484
|
end
|
419
485
|
end
|
420
|
-
|
486
|
+
|
421
487
|
describe 'three times for month range' do
|
422
488
|
before do
|
423
489
|
@result = Eventual.parse('lunes y martes de diciembre a las 16:00, 17:00 y 15:00 horas')
|
424
490
|
@dates = (
|
425
|
-
|
426
|
-
|
427
|
-
|
491
|
+
(DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).map +
|
492
|
+
(DateTime.parse('2010-12-1T16:00')..DateTime.parse('2010-12-31T16:00')).map +
|
493
|
+
(DateTime.parse('2010-12-1T17:00')..DateTime.parse('2010-12-31T17:00')).map
|
428
494
|
).reject{ |day| not [1,2].include?(day.wday) }
|
429
495
|
end
|
430
|
-
|
431
|
-
it_should_behave_like 'correctly parses'
|
496
|
+
|
497
|
+
it_should_behave_like 'correctly parses dates'
|
498
|
+
it_should_behave_like 'includes corresponding dates'
|
432
499
|
it_should_behave_like 'outputs DateTime'
|
433
|
-
|
500
|
+
|
434
501
|
it "should not include other time" do
|
435
502
|
@result.should_not include(DateTime.parse('2010-12-06T14:00'))
|
436
503
|
end
|
437
504
|
end
|
438
|
-
|
505
|
+
|
439
506
|
describe 'range with time as 12 hours am' do
|
440
507
|
before do
|
441
508
|
@result = Eventual.parse('lunes y martes de diciembre a las 3 am')
|
442
509
|
@dates = ((DateTime.parse('2010-12-1T03:00')..DateTime.parse('2010-12-31T03:00')).map).reject{ |day| not [1,2].include?(day.wday) }
|
443
510
|
end
|
444
|
-
it_should_behave_like 'correctly parses'
|
511
|
+
it_should_behave_like 'correctly parses dates'
|
512
|
+
it_should_behave_like 'includes corresponding dates'
|
445
513
|
it_should_behave_like 'outputs DateTime'
|
446
|
-
|
514
|
+
|
447
515
|
it "should not include other time" do
|
448
516
|
@result.should_not include(DateTime.parse('2010-12-06T14:00'))
|
449
517
|
end
|
450
518
|
end
|
451
|
-
|
519
|
+
|
452
520
|
describe 'range with time as 12 hours pm' do
|
453
521
|
before do
|
454
522
|
@result = Eventual.parse('lunes y martes de diciembre a las 3:00 pm')
|
455
523
|
@dates = ((DateTime.parse('2010-12-1T15:00')..DateTime.parse('2010-12-31T15:00')).map).reject{ |day| not [1,2].include?(day.wday) }
|
456
524
|
end
|
457
|
-
it_should_behave_like 'correctly parses'
|
525
|
+
it_should_behave_like 'correctly parses dates'
|
526
|
+
it_should_behave_like 'includes corresponding dates'
|
458
527
|
it_should_behave_like 'outputs DateTime'
|
459
|
-
|
528
|
+
|
460
529
|
it "should not include other time" do
|
461
530
|
@result.should_not include(DateTime.parse('2010-12-06T14:00'))
|
462
531
|
end
|
463
532
|
end
|
464
|
-
|
533
|
+
|
465
534
|
describe 'event default timespan' do
|
466
535
|
before do
|
467
536
|
@result = Eventual.parse('1 de diciembre del 2010 a las 15:00')
|
468
537
|
@dates = [DateTime.parse('2010-12-1T15:00')]
|
469
538
|
end
|
470
|
-
it_should_behave_like 'correctly parses'
|
471
|
-
it_should_behave_like '
|
472
|
-
end
|
473
|
-
|
474
|
-
describe 'event defined timespan' do
|
475
|
-
before do
|
476
|
-
@result = Eventual.parse('1 de diciembre del 2010 a las 15:00', :default_event_span => 120)
|
477
|
-
@dates = [DateTime.parse('2010-12-1T15:00')]
|
478
|
-
end
|
479
|
-
it_should_behave_like 'correctly parses'
|
539
|
+
it_should_behave_like 'correctly parses dates'
|
540
|
+
it_should_behave_like 'includes corresponding dates'
|
480
541
|
it_should_behave_like 'outputs DateTime'
|
481
542
|
end
|
482
543
|
end
|
483
|
-
|
544
|
+
|
484
545
|
describe "with time range" do
|
485
546
|
describe 'single day with time range' do
|
486
547
|
before do
|
487
548
|
@result = Eventual.parse('1 de enero del 2010 de las 15:00 a las 16:00')
|
488
549
|
@ranges = [(DateTime.civil 2010, 1, 1, 15)..(DateTime.civil 2010, 1, 1, 16)]
|
550
|
+
@dates = @ranges.map{ |range| range.map }.flatten
|
551
|
+
end
|
552
|
+
|
553
|
+
it_should_behave_like 'correctly parses time ranges'
|
554
|
+
it_should_behave_like 'includes corresponding dates'
|
555
|
+
end
|
556
|
+
|
557
|
+
describe 'single day with two element time range list' do
|
558
|
+
before do
|
559
|
+
@result = Eventual.parse('1 de enero del 2010 de las 15:00 a las 16:00 y de las 17:00 a las 19:00')
|
560
|
+
@ranges = [(DateTime.civil 2010, 1, 1, 15)..(DateTime.civil 2010, 1, 1, 16), (DateTime.civil 2010, 1, 1, 17)..(DateTime.civil 2010, 1, 1, 19)]
|
561
|
+
@dates = @ranges.map{ |range| range.map }.flatten
|
489
562
|
end
|
490
563
|
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
564
|
+
it_should_behave_like 'correctly parses time ranges'
|
565
|
+
it_should_behave_like 'includes corresponding dates'
|
566
|
+
end
|
567
|
+
|
568
|
+
describe 'single day with two element time range list' do
|
569
|
+
before do
|
570
|
+
@result = Eventual.parse('1 de enero del 2010 de las 15:00 a las 16:00, de las 17:00 a las 19:00 y de las 21:00 a las 22:00')
|
571
|
+
@ranges = [(DateTime.civil 2010, 1, 1, 15)..(DateTime.civil 2010, 1, 1, 16), (DateTime.civil 2010, 1, 1, 17)..(DateTime.civil 2010, 1, 1, 19), (DateTime.civil 2010, 1, 1, 21)..(DateTime.civil 2010, 1, 1, 22)]
|
572
|
+
@dates = @ranges.map{ |range| range.map }.flatten
|
573
|
+
end
|
498
574
|
|
575
|
+
it_should_behave_like 'correctly parses time ranges'
|
576
|
+
it_should_behave_like 'includes corresponding dates'
|
499
577
|
end
|
500
578
|
end
|
501
|
-
|
502
|
-
|
579
|
+
|
580
|
+
|
503
581
|
describe 'Marshal dump' do
|
504
582
|
describe "month without year parsing 'marzo'" do
|
505
583
|
before do
|
506
584
|
@result = Marshal.load Marshal.dump(Eventual.parse('marzo')).gsub('NaturalDates::', 'NaturalDates::Eventual::Es::')
|
507
585
|
@dates = (Date.parse('2010-3-1')..Date.parse('2010-3-31')).map
|
508
586
|
end
|
509
|
-
it_should_behave_like 'correctly parses'
|
587
|
+
it_should_behave_like 'correctly parses dates'
|
588
|
+
it_should_behave_like 'includes corresponding dates'
|
510
589
|
end
|
511
590
|
end
|
512
|
-
|
591
|
+
|
513
592
|
describe 'Default year' do
|
514
593
|
describe "month without year parsing 'marzo'" do
|
515
594
|
before do
|
516
|
-
@result
|
517
|
-
@dates
|
595
|
+
@result = Eventual.parse('marzo', :default_year => 2007)
|
596
|
+
@dates = (Date.parse('2007-3-1')..Date.parse('2007-3-31')).map
|
518
597
|
end
|
519
|
-
it_should_behave_like 'correctly parses'
|
598
|
+
it_should_behave_like 'correctly parses dates'
|
599
|
+
it_should_behave_like 'includes corresponding dates'
|
520
600
|
end
|
521
601
|
end
|
522
602
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 6
|
9
|
+
version: 0.5.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Macario Ortega
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-22 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|