catalogos_sat 0.0.91 → 0.0.92

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/catalogos_sat.rb +19 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc1e97ba07fa8cc3d1eb11fe0f576ce385bd02eb
4
- data.tar.gz: 0e1638334ec83b453e5d97be9ee023e47946a59a
3
+ metadata.gz: 3c83c1267e5be95fcf193c99ef4a7c783e529d37
4
+ data.tar.gz: ee3a719022beda64b93d44c6eb7903e4371e550f
5
5
  SHA512:
6
- metadata.gz: af467876a1a8d4bf6f41a8135c50e4f790ce7e9bf8173c9d25e45fa1f38baa1125592e17c84f535aa8eea29d5dbe920612d8dd0b9ce2dd0e9814633462184a1d
7
- data.tar.gz: 96d4abe422ee02a6a80d3382e21610fcdfe8ebd0c0f3b3c5f2b5c3d0dbf473776b32737294122896a27a0ca26e4e4d43a72c88d252c3409c80580c6fe79bd4da
6
+ metadata.gz: b5084e6325e90fed75c2a16d6cdd704efcdec3307c13500ec12e2843959d4a449fb727004faff5a13ec45bddfe9375fc23447a36b39a72484f07428f0958b9c3
7
+ data.tar.gz: 4f7fc4c2c59d96e9e167698d42092a5f288e92d089e7f3d9da6d4bdb5550acff4a87aab283ef1ed17303dc582579df52f9beddc442fb3a6e7336aa4c1f8479f3
data/lib/catalogos_sat.rb CHANGED
@@ -292,6 +292,20 @@ class Catalogos
292
292
 
293
293
  end
294
294
 
295
+
296
+
297
+ =begin
298
+ def nueva(url_excel = "http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/catCFDI.xls")
299
+ url_excel = URI.parse(url_excel)
300
+ last_modified = nil
301
+ httpWork = Net::HTTP.start(url_excel.host) do
302
+ |http|
303
+ response = http.request_head(url_excel.path)
304
+ last_modified = response['Last-Modified']
305
+ end
306
+ return last_modified
307
+ end
308
+
295
309
  def nueva_eTag(url_excel = "http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/catCFDI.xls")
296
310
  url_excel = URI.parse(url_excel)
297
311
  new_eTag = nil
@@ -315,21 +329,19 @@ class Catalogos
315
329
  return new_eTag != local_eTag
316
330
 
317
331
  end
332
+ =end
318
333
 
319
334
  # Encapsula los demas metodos en una sola rutina
320
335
  # @param local_eTag [String] siempre intentara utilizar el @last_eTag a menos que se mande explicitamente un eTag, este se puede
321
336
  # obtener de @last_eTag en una iteracion previa del programa.
322
337
  # @param url_excel [String] el url donde el SAT tiene los catalogos, valor default "http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/catCFDI.xls"
323
338
  # @return [Bool] verdadero si no hubo ningun error.
324
- def main(local_eTag = nil, url_excel = "http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/catCFDI.xls")
325
-
326
- if (nuevo_xls?(local_eTag, url_excel))
327
- descargar(url_excel)
328
- procesar()
329
- end
339
+ def main(url_excel = "http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/catCFDI.xls")
340
+
341
+ descargar(url_excel)
342
+ procesar()
330
343
 
331
344
  return true
332
-
333
345
 
334
346
  end
335
347
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catalogos_sat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.91
4
+ version: 0.0.92
5
5
  platform: ruby
6
6
  authors:
7
7
  - BambuCode
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-07 00:00:00.000000000 Z
12
+ date: 2017-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-progressbar