transilien_microservices 0.0.6 → 0.0.7

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: 643ed9e6c49e2145ade2663ff50268a162fc4dd4
4
- data.tar.gz: f87817a77538d6b7c399ece3bf7ce6771f8402e2
3
+ metadata.gz: 57960fb00242ddd3df6ccaa4771a6c288e6d4745
4
+ data.tar.gz: b8aad89e1f894874be95e82265e2c3a7d7d49c73
5
5
  SHA512:
6
- metadata.gz: 4d1133c95095d19d16360628b8028334bee6a3efdaa5e0a2a38b84a057e972d4b06a2c249eabc500c6af4c47c8384f8a708498ab62df9c22c2443c835bcd618e
7
- data.tar.gz: 5506eb6fceba6b9b39123acd3ccc5802f25e23a965a780db9430594d9d85ab98a98f0bc84eb623dd216018532fd07bfd2b51834944eb050e3a4ff4b42c80bf49
6
+ metadata.gz: 27a3fbb5e779c25fb9fb66d9fe838cf5fa839d9fd798e0d60d1fdb4adc785103b256c35ebdb4c32970e6c5aa13ca4cd480709feeb7519e8e7d9cdccb17f577ea
7
+ data.tar.gz: 100ebd60aa8ac7b8c733f7b7ad0ae079f5ca05f18c4e70a293840416a86a5d7bbac016304b3ae80d9594a0cc65ceb7d43b75645106bf73f721c6c5e6cc2b6a81
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.0.7
2
+ * Bug fix: No longer crash like a drunk sea otter when we're at the end of a month or a year…
3
+
1
4
  0.0.6
2
5
  * Change: It no longer reject any Line due to weird CodeLine. See EasyTransilien gem for fixes of SNCF shitty data
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transilien_microservices (0.0.5)
4
+ transilien_microservices (0.0.7)
5
5
  faraday (>= 0.8.4)
6
6
  nokogiri (>= 1.5.5)
7
7
 
@@ -12,8 +12,8 @@ GEM
12
12
  timers (~> 1.1.0)
13
13
  coderay (1.1.0)
14
14
  diff-lcs (1.2.5)
15
- faraday (0.8.8)
16
- multipart-post (~> 1.2.0)
15
+ faraday (0.9.0)
16
+ multipart-post (>= 1.2, < 3)
17
17
  ffi (1.9.3)
18
18
  formatador (0.2.4)
19
19
  guard (2.2.5)
@@ -32,7 +32,7 @@ GEM
32
32
  lumberjack (1.0.4)
33
33
  method_source (0.8.2)
34
34
  mini_portile (0.5.2)
35
- multipart-post (1.2.0)
35
+ multipart-post (2.0.0)
36
36
  nokogiri (1.6.1)
37
37
  mini_portile (~> 0.5.0)
38
38
  pry (0.9.12.4)
@@ -29,6 +29,9 @@ class Transilien::Time < Transilien::FakeMicroService
29
29
  # Since the current time is not known, set it to `Time.new` year, month and day
30
30
  def time
31
31
  now = Time.new
32
+ this_month_days_count = Date.new(now.year, now.month, -1).day
33
+ return Time.local(now.year + 1, 1, 1, hour, minute) if day == 1 && now.month == 12 && now.day == this_month_days_count
34
+ return Time.local(now.year, now.month + 1, 1, hour, minute) if day == 1 && this_month_days_count == now.day
32
35
  Time.local(now.year, now.month, now.day + day, hour, minute)
33
36
  end
34
37
  end
@@ -1,3 +1,3 @@
1
1
  module Transilien
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -10,6 +10,12 @@ describe Transilien::Time do
10
10
  now = Time.new
11
11
  tt.time.should eql(Time.local(now.year, now.month, now.day, 14, 42))
12
12
  tt.day = 1
13
- tt.time.should eql(Time.local(now.year, now.month, now.day + 1, 14, 42))
13
+ this_month_days_count = Date.new(now.year, now.month, -1).day
14
+ if now.day == this_month_days_count
15
+ tt.time.should eql(Time.local(now.year, now.month+1, 1, 14, 42))
16
+ else
17
+ tt.time.should eql(Time.local(now.year, now.month, now.day+1, 14, 42))
18
+ end
14
19
  end
20
+
15
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transilien_microservices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Lecavelier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday