sports_south 2.0.21 → 2.0.22

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: e6deef28dfc009db53313755232bcc90de127d54
4
- data.tar.gz: 9d9ffe7d2acee904982ab8f91ed6dc9318eb3ed9
3
+ metadata.gz: 24224e8811abc6e53b5c768ff5060d23fc909244
4
+ data.tar.gz: 915e75bae112af3001ff4c2e208a015f3d21b500
5
5
  SHA512:
6
- metadata.gz: e8753bafa4e89a3e3c1765a8d57226ba27f74392144f922d68a76e40e9439ca771d8c369a7dc54a63adad22a355fcfd5d3fa606f39d98fc5f2e61eb2057e5a03
7
- data.tar.gz: fa2a27c9f9a501510eddcf21084f1d2c387d69d227f91ba204415e9bfea3df89de1ab004be59a2a7aec9031027727366ed54df7660e902d7f91448b3149ff393
6
+ metadata.gz: bc9970620237510f7494b24c0a5a5be0d136c9839d0bafc81690a31504094890dd5b3400135a93345c376ce70ae23cafc6ff469f93a0bb022d6401b052a5400e
7
+ data.tar.gz: a85313d2b025ef5e4e8eeeb337ea0f486f24dd487528f7136551a6adf4cbcb733e2ffe993ad37d7ac9839700c9dbc004a216bd478e26573dfa868c0228550598
@@ -1,3 +1,5 @@
1
+ require 'cgi'
2
+
1
3
  module SportsSouth
2
4
  # Holds methods common to all classes.
3
5
  class Base
@@ -33,7 +33,7 @@ module SportsSouth
33
33
  def self.all(chunk_size = 15, options = {}, &block)
34
34
  requires!(options, :username, :password)
35
35
 
36
- if options[:last_updated].present?
36
+ if options[:last_updated]
37
37
  options[:last_updated] = options[:last_updated].strftime("%-m/%-d/%Y")
38
38
  else
39
39
  options[:last_updated] ||= '1/1/1990'
@@ -68,7 +68,7 @@ module SportsSouth
68
68
 
69
69
  chunker.reset!
70
70
  else
71
- chunker.add(map_hash(item, @options[:full_product].present?))
71
+ chunker.add(map_hash(item, !@options[:full_product].nil?))
72
72
  end
73
73
  end
74
74
 
@@ -97,13 +97,17 @@ module SportsSouth
97
97
  brand = @brands.find { |brand| brand[:brand_id] == content_for(node, 'ITBRDNO') }
98
98
  features = self.map_features(category.except(:category_id, :department_id, :department_description, :description), node)
99
99
 
100
- if features[:caliber].present?
100
+ model = content_for(node, 'IMODEL')
101
+ series = content_for(node, 'SERIES')
102
+ mfg_number = content_for(node, 'MFGINO')
103
+
104
+ if features[:caliber]
101
105
  caliber = features[:caliber]
102
- elsif features[:gauge].present?
106
+ elsif features[:gauge]
103
107
  caliber = features[:gauge]
104
108
  end
105
109
 
106
- if features[:action].present?
110
+ if features[:action]
107
111
  action = features[:action]
108
112
  end
109
113
 
@@ -114,12 +118,12 @@ module SportsSouth
114
118
  end
115
119
 
116
120
  if features.respond_to?(:[]=)
117
- features[:series] = content_for(node, 'SERIES')
121
+ features[:series] = series
118
122
  end
119
123
 
120
124
  {
121
- name: content_for(node, 'IDESC').gsub(/\s+/, ' '),
122
- model: content_for(node, 'IMODEL'),
125
+ name: "#{model} #{series} #{mfg_number}".gsub(/\s+/, ' ').rstrip,
126
+ model: model,
123
127
  upc: content_for(node, 'ITUPC').rjust(12, "0"),
124
128
  item_identifier: content_for(node, 'ITEMNO'),
125
129
  quantity: content_for(node, 'QTYOH').to_i,
@@ -128,7 +132,7 @@ module SportsSouth
128
132
  long_description: long_description,
129
133
  category: category[:description],
130
134
  product_type: ITEM_TYPES[content_for(node, 'ITYPE')],
131
- mfg_number: content_for(node, 'MFGINO'),
135
+ mfg_number: mfg_number,
132
136
  weight: content_for(node, 'WTPBX'),
133
137
  caliber: caliber,
134
138
  action: action,
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '2.0.21'.freeze
2
+ VERSION = '2.0.22'.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: 2.0.21
4
+ version: 2.0.22
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-01-03 00:00:00.000000000 Z
11
+ date: 2018-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri