catalogos_sat 0.0.9 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/catalogos_sat.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc1e97ba07fa8cc3d1eb11fe0f576ce385bd02eb
|
4
|
+
data.tar.gz: 0e1638334ec83b453e5d97be9ee023e47946a59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af467876a1a8d4bf6f41a8135c50e4f790ce7e9bf8173c9d25e45fa1f38baa1125592e17c84f535aa8eea29d5dbe920612d8dd0b9ce2dd0e9814633462184a1d
|
7
|
+
data.tar.gz: 96d4abe422ee02a6a80d3382e21610fcdfe8ebd0c0f3b3c5f2b5c3d0dbf473776b32737294122896a27a0ca26e4e4d43a72c88d252c3409c80580c6fe79bd4da
|
data/lib/catalogos_sat.rb
CHANGED
@@ -82,7 +82,7 @@ class Catalogos
|
|
82
82
|
|http|
|
83
83
|
response = http.request_head(url_excel.path)
|
84
84
|
totalSize = response['content-length'].to_i
|
85
|
-
@local_eTag = response['etag']
|
85
|
+
@local_eTag = response['etag']
|
86
86
|
pbar = ProgressBar.create(:title => "Descargando:", :format => "%t %B %p%% %E")
|
87
87
|
|
88
88
|
tempdir = Dir.tmpdir()
|
@@ -161,8 +161,12 @@ class Catalogos
|
|
161
161
|
j = 0
|
162
162
|
hoja.each do |row|
|
163
163
|
j += 1
|
164
|
-
# Nos saltamos el primer renglon ya que siempre tiene la descripcion del catálogo, ejem "Catálogo de aduanas ..."
|
165
|
-
|
164
|
+
# Nos saltamos el primer renglon ya que siempre tiene la descripcion del catálogo, ejem "Catálogo de aduanas ..."
|
165
|
+
if j == 1
|
166
|
+
unless is_header?(row)
|
167
|
+
next
|
168
|
+
end
|
169
|
+
end
|
166
170
|
|
167
171
|
break if row.to_s.index("Continúa en") != nil
|
168
172
|
next if row.formats[0] == nil
|
@@ -173,6 +177,7 @@ class Catalogos
|
|
173
177
|
|
174
178
|
|
175
179
|
if is_header?(row) then
|
180
|
+
|
176
181
|
if renglones_json.nil? then
|
177
182
|
#puts "Ignorando: #{row}"
|
178
183
|
renglones_json = Array.new
|
@@ -293,7 +298,7 @@ class Catalogos
|
|
293
298
|
httpWork = Net::HTTP.start(url_excel.host) do
|
294
299
|
|http|
|
295
300
|
response = http.request_head(url_excel.path)
|
296
|
-
new_eTag = response['etag']
|
301
|
+
new_eTag = response['etag']
|
297
302
|
end
|
298
303
|
return new_eTag
|
299
304
|
end
|