sports_south 4.0.0 → 5.0.0

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
  SHA256:
3
- metadata.gz: 14f58435980d9c679d29c36d8539f634fc438d05797ed712993c89dd51ec1ce8
4
- data.tar.gz: ef5c4b09f54268ac9de6b5c427d4cbfba6b4af90c92fc3ac0625f423674f9305
3
+ metadata.gz: 19a10bec089537426870e1faf6373b1ad2268fbde29ed5fc912bc21ce5b3526e
4
+ data.tar.gz: 7a356aa8a0a28ebbc59bc68e2b995ffc2ee3d0d4db32ae4df154c02c7dfb05e4
5
5
  SHA512:
6
- metadata.gz: 49e51b8c47c04e4a98f95f5d488ab3a9282d2d7e4db96c521a5c366cbedc2c3da23b2e2dbf66356680976d5710c30540d318025f8faede2d98a20835621cfa7a
7
- data.tar.gz: 46e39889b90fa2bf4b6e3f986c5e3f4fcd89356fe242282b84ab728ea2430d14a463b1fd0b0b474caf6f5370147d13173ca8f99a7710981684589278e1730493
6
+ metadata.gz: f81d5e2a1a8fb16fb7a9bca7a47711ffd3c042ac17ad57aae3b24c6278a718bacb818077716ac09a827baa9d039612b0c8922e9937eacbe1886834cb211e2231
7
+ data.tar.gz: 87d8a4dcd81a38b415d6d45ce17491aa0c30fcd382a523e0ef0ed978ff1771735d90b3ec9c3c7c89a9ca911a5b957cd6fe7ed75c765f06af71788ce7c7fac3db
@@ -19,7 +19,7 @@ module SportsSouth
19
19
  new(options).get_quantity_file
20
20
  end
21
21
 
22
- def self.all(options = {}, &block)
22
+ def self.all(options = {})
23
23
  requires!(options, :username, :password)
24
24
 
25
25
  if options[:last_updated].present?
@@ -30,7 +30,7 @@ module SportsSouth
30
30
 
31
31
  options[:last_item] ||= '-1'
32
32
 
33
- new(options).all(&block)
33
+ new(options).all
34
34
  end
35
35
 
36
36
  def self.get(item_identifier, options = {})
@@ -38,7 +38,7 @@ module SportsSouth
38
38
  new(options).get(item_identifier)
39
39
  end
40
40
 
41
- def all(&block)
41
+ def all
42
42
  http, request = get_http_and_request(API_URL, '/IncrementalOnhandUpdate')
43
43
 
44
44
  request.set_form_data(form_params = form_params(@options).merge({
@@ -46,7 +46,9 @@ module SportsSouth
46
46
  LastItem: @options[:last_item].to_s
47
47
  }))
48
48
 
49
+ items = []
49
50
  tempfile = download_to_tempfile(http, request)
51
+
50
52
  tempfile.rewind
51
53
 
52
54
  Nokogiri::XML::Reader.from_io(tempfile).each do |reader|
@@ -55,12 +57,15 @@ module SportsSouth
55
57
 
56
58
  node = Nokogiri::XML.parse(reader.outer_xml)
57
59
 
58
- yield map_hash(node.css(ITEM_NODE_NAME))
60
+ _map_hash = map_hash(node.css(ITEM_NODE_NAME))
61
+
62
+ items << _map_hash unless _map_hash.nil?
59
63
  end
60
64
 
61
65
  tempfile.close
62
66
  tempfile.unlink
63
- true
67
+
68
+ items
64
69
  end
65
70
 
66
71
  def get_quantity_file
@@ -83,7 +88,7 @@ module SportsSouth
83
88
  tempfile.path
84
89
  end
85
90
 
86
- def self.quantity(options = {}, &block)
91
+ def self.quantity(options = {})
87
92
  requires!(options, :username, :password)
88
93
 
89
94
  if options[:last_updated].present?
@@ -94,7 +99,7 @@ module SportsSouth
94
99
 
95
100
  options[:last_item] ||= '-1'
96
101
 
97
- new(options).all(&block)
102
+ new(options).all
98
103
  end
99
104
 
100
105
  def get(item_identifier)
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '5.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_south
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-01 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri