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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1baf67d7940a98c90097ea8ffa31babc85a47c70
4
- data.tar.gz: c535fcfd68fd22177162d34fb272aca38a9fc64a
3
+ metadata.gz: 214b09070c9fb2cfdccf448b542b15e49b0900d8
4
+ data.tar.gz: 2f62f1e23500bc19ae3296039fe240c0a150a3c3
5
5
  SHA512:
6
- metadata.gz: 84c964a1a253f81e2c72f0f59349bfc3c2aacb2e105766f41f624d4f2dcb7e9cc7331b2f2a16da374672b11e451f887f93cfb4a49ecf9376528169faaccac895
7
- data.tar.gz: 92e810ab6f2ea183184214e3e9feda63a22a4739050181b17a3dd469d3f510476ba8295118dc4d960d81813c6fc9829b094b3caf3b1281577bad4b87d388487b
6
+ metadata.gz: 71af68aac14bb06410f5689342dce8024dfe886c2a5ad9e4d8155b299bfc40246eb8d6c41fed77e151d8d929c9a1cfb7cf9742f7a860f4aeba09596005488b31
7
+ data.tar.gz: acd6b2fdb3e175f1a5148aceb33b9c4292a414ea06b9cf0043c6cc71cbfe10adcbddc3cb9e839f77c8fb347b1522272bfee37956ea11529160a7ee7482722c63
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.0.8
2
+ * Apply Time boundaries management in Stop#time, like in transilien_microservices
3
+
1
4
  0.0.7
2
5
  * bump transilien_microservices v0.0.7
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_transilien (0.0.5)
4
+ easy_transilien (0.0.8)
5
5
  transilien_microservices (~> 0.0.7)
6
6
 
7
7
  GEM
@@ -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) + stop_time.day.to_i
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
 
@@ -1,3 +1,3 @@
1
1
  module EasyTransilien
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_transilien
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Lecavelier