relaton-3gpp 1.9.0 → 1.9.1

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: 2cb4d367d6487eb29deffcb0805e874e089ee23b296879ab64e0d0697e3d29f4
4
- data.tar.gz: 520706a92250b455c31e8ed63def3573da3c67d8d7329c027186e5ab66330cbc
3
+ metadata.gz: d3dde90217a532390e200d4fc35039d7bc15b975fe183c2eb830c25025c7fa55
4
+ data.tar.gz: 2767355041bb1b5d16c85e084f808e64f5ab4a7696ce11d55e7281706d93ed77
5
5
  SHA512:
6
- metadata.gz: 0350b940358a6fe6793e6c18361a61befd891b7efa814d73c88fd612123b174f7ffea185ccfdd65711873a3f75697108c60a15d85446a2d8091bf3f1c97c377a
7
- data.tar.gz: e0a8e4c26623f84b997862ebc3c66c0f2c665dfea62cef07d0db8601431b0340d2778b782ee730d6cf248411b6056f7f5073be7823580bd7e60072ce79137b91
6
+ metadata.gz: 0e7a4e7bb55d8b520be6a4bcd796e76283dd07e70b99f1e1f2d6c275d19412d14d936cec0297d92cf5b232c342f36dd4f11247142116e4a95a7842dc429ef75d
7
+ data.tar.gz: 4d235cffb4d8f772e89f532157e648e1c27e3a4483039f51da88307fb9ec8ad639c4acf7c9facc67acae56712053a8852d04a0d3778f4be659f533a7e71ed4d6
@@ -63,18 +63,25 @@ module Relaton3gpp
63
63
  #
64
64
  # @return [String] file name
65
65
  #
66
- def get_file # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
66
+ def get_file # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
67
67
  @current = YAML.load_file CURRENT if File.exist? CURRENT
68
68
  @current ||= {}
69
- ftp = Net::FTP.new("www.3gpp.org")
70
- ftp.resume = true
71
- ftp.login
72
- ftp.chdir "/Information/Databases/Spec_Status/"
73
- d, t, _, file = ftp.list("*.zip").first.split
74
- dt = DateTime.strptime("#{d} #{t}", "%m-%d-%y %I:%M%p")
75
- return if file == @current["file"] && dt == DateTime.parse(@current["date"])
69
+ n = 0
70
+ begin
71
+ ftp = Net::FTP.new("www.3gpp.org")
72
+ ftp.resume = true
73
+ ftp.login
74
+ ftp.chdir "/Information/Databases/Spec_Status/"
75
+ d, t, _, file = ftp.list("*.zip").first.split
76
+ dt = DateTime.strptime("#{d} #{t}", "%m-%d-%y %I:%M%p")
77
+ return if file == @current["file"] && dt == DateTime.parse(@current["date"])
76
78
 
77
- ftp.getbinaryfile file
79
+ ftp.getbinaryfile file
80
+ rescue Net::ReadTimeout => e
81
+ n += 1
82
+ retry if n < 5
83
+ raise e
84
+ end
78
85
  @current["file"] = file
79
86
  @current["date"] = dt.to_s
80
87
  file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relaton3gpp
4
- VERSION = "1.9.0"
4
+ VERSION = "1.9.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-3gpp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.