sports_south 3.0.3 → 3.0.4

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: b736895ad6b25eaba7670b07b9c656540af38f4f10f9dd1e33a98a4b6a0a53a4
4
- data.tar.gz: fa5df6f96b4e6dcda10e5d15e14a2aaa14413d4987d951dad85a399e3e89bb98
3
+ metadata.gz: b8ffcf4d3fbb056d53b5cdb05ea2dd3174ca8fd306b0721f0c067a523b86339b
4
+ data.tar.gz: 814ed8f3c6649ee0fb52bdc024ee934d919976613270d71f91167adc8634e74d
5
5
  SHA512:
6
- metadata.gz: d1faa1e1fe88d5cd8a5570c09f358c025b9e9fc53bf77c94d19c22d2157dd63f0ef3d14398de0871fafd3a6de2f7bb07d2d41c616546fa285ecda70a60289add
7
- data.tar.gz: d2bb33af61ab8f14ad44b4aa121105f45f5be2a4c84ac6a590c5073a6845a725c811440bbff33a3d8e2edbf92f462ee7c26393ffcb4b225649b6c49b1bef3b2f
6
+ metadata.gz: 881d8cbd200ae7b66ca98f04b39c6bfbf1efe86a416b8d509711e7b029e74c954441bb1b8f2411fdeef7b4e1e8a28b278e35808913e7f1458e07af20d5a97ac8
7
+ data.tar.gz: af555a914628c4b1217a506ff1b345e6a2b6f4f07e10cf27c5438ce4be0584f8b056c885d0fa443b672b329ac65a4bf8ad37865355aa5f3a7a7c3f7e0c7db117
@@ -73,7 +73,7 @@ module SportsSouth
73
73
 
74
74
  node = Nokogiri::XML.parse(reader.outer_xml)
75
75
 
76
- yield map_hash(node.css('Table'), @options[:full_product])
76
+ yield map_hash(node.css(ITEM_NODE_NAME), @options[:full_product])
77
77
  end
78
78
 
79
79
  tempfile.close
@@ -2,6 +2,7 @@ module SportsSouth
2
2
  class Inventory < Base
3
3
 
4
4
  API_URL = 'http://webservices.theshootingwarehouse.com/smart/inventory.asmx'
5
+ ITEM_NODE_NAME = 'Onhand'
5
6
 
6
7
  def initialize(options = {})
7
8
  requires!(options, :username, :password)
@@ -45,12 +46,21 @@ module SportsSouth
45
46
  LastItem: @options[:last_item].to_s
46
47
  }))
47
48
 
48
- response = http.request(request)
49
- xml_doc = Nokogiri::XML(sanitize_response(response))
49
+ tempfile = download_to_tempfile(http, request)
50
+ tempfile.rewind
50
51
 
51
- xml_doc.css('Onhand').map do |item|
52
- yield(self.map_hash(item))
52
+ Nokogiri::XML::Reader.from_io(tempfile).each do |reader|
53
+ next unless reader.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
54
+ next unless reader.name == ITEM_NODE_NAME
55
+
56
+ node = Nokogiri::XML.parse(reader.outer_xml)
57
+
58
+ yield map_hash(node.css(ITEM_NODE_NAME))
53
59
  end
60
+
61
+ tempfile.close
62
+ tempfile.unlink
63
+ true
54
64
  end
55
65
 
56
66
  def get_quantity_file
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '3.0.3'.freeze
2
+ VERSION = '3.0.4'.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: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-19 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri