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 +4 -4
- data/lib/relaton_3gpp/data_fetcher.rb +16 -9
- data/lib/relaton_3gpp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3dde90217a532390e200d4fc35039d7bc15b975fe183c2eb830c25025c7fa55
|
4
|
+
data.tar.gz: 2767355041bb1b5d16c85e084f808e64f5ab4a7696ce11d55e7281706d93ed77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
-
|
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
|
data/lib/relaton_3gpp/version.rb
CHANGED