infostrada 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjE2ZTdiOTQyNGE2ZjM3M2M5MWI3ZTc0MmIzM2NjNGExMDg5OTM4OA==
4
+ Y2YyNTBlOGMwM2Y4NDQ0M2MyYzdjYzRiNzVhOGM3NmEzN2YwNzRhNA==
5
5
  data.tar.gz: !binary |-
6
- MTQ3YjU3ZmNiODQ3NzY3ZmU5ZmIxZGViMjAzYTdhMWY1OTk2YzM2MQ==
6
+ NjdjOTBmZGVmMzc1NTk1ZWNkMzY2NWVjODkxMDFlMWVlOTJkN2ZhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yjc3MDhhOTA2OGViZTQwYTMxMTExNDgxZjU0YTVmM2IzN2ViNmNlZGI5NmUw
10
- ZGEwOTgxYjY0MTEwNTNmNjk2ODkwZWExMGE2YzVjZmZjMDViYzAyNzM5M2Yw
11
- NTQ2YmYwZTBkMzJiYjZjZWFjYmYwZGZmMTEzODQ3YTIwOWM5NjI=
9
+ ZWJjM2QzNzE4ZWVmMzcyYjlkNGZkYWYzYWNhZTA5Y2JhMmM5YjRkNmVkODMz
10
+ M2UzNjEwMjk2MTdhYWNiNTZhYTYwZDJhOTE0MzdhMjM0NDMyYmVhYjEwODY3
11
+ MzA2NGVmZTg5MTEyNmFiODlkMzA4NDM1YmMzOTMxZGUxZDM2OWE=
12
12
  data.tar.gz: !binary |-
13
- ZWYyYWNiZDEwNzJiMGNlMzU3YWFiYWNlNzUyNThiN2VkZDQ4N2NiN2I1OGZj
14
- N2EwM2QzN2Y0OTEyYTUwMzUwZTY0NzNhNDRhNDUzYzNhNTU1NGVhYjBmMWJj
15
- MGI3NTExOTQ5ODJhYzg1OWMxNTdiZjM5ZThlNGQyZDNlNzgxM2M=
13
+ NWI1OGU0MjAwY2IxYTc2M2U4YTBhMjc0Mzk4MzNlZTNlYjUwOTViNzMxZDYz
14
+ NTdjMGJmYTdjNGI2MTA0YmNjY2FlMDhkNmIwMGVkODc1MmNkMTYyMGViOTJk
15
+ MmZjNDA0ZTk5ZmJlNzFmYWRmMmE0MzAxZjg5ZTYxY2QwMGM3YzU=
@@ -42,7 +42,10 @@ module Infostrada
42
42
  end
43
43
 
44
44
  def self.last_update=(date)
45
- store.transaction { store[:last_update] = date }
45
+ store.transaction {
46
+ store[:last_update] = date
47
+ store.commit
48
+ }
46
49
  end
47
50
 
48
51
  def self.api_time(date)
@@ -51,27 +54,20 @@ module Infostrada
51
54
  end
52
55
 
53
56
  def self.get_latest
54
- since last_update || api_time(Time.now)
57
+ since(last_update || api_time(Time.now))
55
58
  end
56
59
 
57
60
  def self.since(date)
58
- date = date.strftime(DATE_FORMAT)
61
+ self.last_update = date
59
62
 
60
- # UGLY UGLY hack because of the bug happening in production servers
61
- date = "#{Time.now.strftime('%F')}T00:00:00"
63
+ date_str = date.strftime(DATE_FORMAT)
62
64
 
63
- self.last_update = api_time(Time.now)
65
+ list = get!(URL, query: { from: date_str, outputType: OUTPUT_TYPE, module: 'football' })
64
66
 
65
- list = get!(URL, query: { from: date, outputType: OUTPUT_TYPE, module: 'football' })
66
-
67
- endpoints = []
68
- list.each do |hash|
67
+ list.each_with_object([]) do |hash, endpoints|
69
68
  lang = hash['c_QueryString'].scan(/languagecode=(\d+)/).flatten.first.to_i
70
-
71
69
  endpoints << Endpoint.new(hash) if LANGUAGE_CODES.include?(lang)
72
70
  end
73
-
74
- endpoints
75
71
  end
76
72
  end
77
73
  end
@@ -1,3 +1,3 @@
1
1
  module Infostrada
2
- VERSION = '0.1.17'
2
+ VERSION = '0.1.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infostrada
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler