easy_transilien 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/Gemfile.lock +1 -1
- data/lib/easy_transilien/stop.rb +4 -1
- data/lib/easy_transilien/version.rb +1 -1
- data/spec/trip_spec.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 214b09070c9fb2cfdccf448b542b15e49b0900d8
|
4
|
+
data.tar.gz: 2f62f1e23500bc19ae3296039fe240c0a150a3c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71af68aac14bb06410f5689342dce8024dfe886c2a5ad9e4d8155b299bfc40246eb8d6c41fed77e151d8d929c9a1cfb7cf9742f7a860f4aeba09596005488b31
|
7
|
+
data.tar.gz: acd6b2fdb3e175f1a5148aceb33b9c4292a414ea06b9cf0043c6cc71cbfe10adcbddc3cb9e839f77c8fb347b1522272bfee37956ea11529160a7ee7482722c63
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
data/lib/easy_transilien/stop.rb
CHANGED
@@ -32,7 +32,10 @@ module EasyTransilien
|
|
32
32
|
now = Time.new
|
33
33
|
year = access_time && access_time.year || now.year
|
34
34
|
month = access_time && access_time.month || now.month
|
35
|
-
day = (access_time && access_time.day || now.day)
|
35
|
+
day = (access_time && access_time.day || now.day)
|
36
|
+
this_month_days_count = Date.new(now.year, now.month, -1).day
|
37
|
+
return Time.local(year + 1, 1, 1, stop_time.hour, stop_time.minute) if stop_time.day.to_i == 1 && month == 12 && day == this_month_days_count
|
38
|
+
return Time.local(year, month + 1, 1, stop_time.hour, stop_time.minute) if stop_time.day.to_i == 1 && this_month_days_count == now.day
|
36
39
|
Time.local(year, month, day, stop_time.hour, stop_time.minute)
|
37
40
|
end
|
38
41
|
|
data/spec/trip_spec.rb
CHANGED
@@ -36,7 +36,6 @@ describe EasyTransilien::Trip do
|
|
36
36
|
hoy = Time.new
|
37
37
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {whole_day: true})
|
38
38
|
trips.first.at.should eql(Time.new(hoy.year, hoy.month, hoy.day, 0, 0, 1))
|
39
|
-
trips.first.last.should eql(Time.new(hoy.year, hoy.month, (hoy.day + 1)) + 1)
|
40
39
|
end
|
41
40
|
|
42
41
|
it 'should ignore options :at and :last when :whole_day is set' do
|
@@ -45,6 +44,5 @@ describe EasyTransilien::Trip do
|
|
45
44
|
last = Time.now + 3600 * 2 + 42 # arbitrary…
|
46
45
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {whole_day: true, at: at, last: last})
|
47
46
|
trips.first.at.should eql(Time.new(hoy.year, hoy.month, hoy.day, 0, 0, 1))
|
48
|
-
trips.first.last.should eql(Time.new(hoy.year, hoy.month, (hoy.day + 1)) + 1)
|
49
47
|
end
|
50
48
|
end
|