ifqar 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ifqar/fund_quoter.rb +15 -2
- data/lib/ifqar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a34ebc71e5e71a64a28399d0c281295071b72827
|
4
|
+
data.tar.gz: b2ac29a91dc705f3dbdfb418867fe5287aa481b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784e74e76ae0cd96ec94c8de06d3174aaacd6f3de54b6792aa9db2c7b2c7756e076d507b6a87c81da688d4f93448162762dda8966b620569801aa673b79f0390
|
7
|
+
data.tar.gz: 0ca467887985f74f3a735a6b819dd6cf9844acca7f43fe6658167d0034f347d24c9565167d47fed82b0cb9615b6c3d6cdfeb6c1b804cb3920152825ad36b1991
|
data/lib/ifqar/fund_quoter.rb
CHANGED
@@ -17,6 +17,8 @@ module Ifqar
|
|
17
17
|
:referer => 'http://www.cafci.org.ar/scripts/cfn_EstadisticasVCP.html'
|
18
18
|
}.freeze
|
19
19
|
|
20
|
+
MAX_RETRIES = 3
|
21
|
+
|
20
22
|
SET_PARAMS_URL = 'http://www.cafci.org.ar/Scripts/cfn_EstadisticaVCPXMLSet.asp'.freeze
|
21
23
|
QUERY_URL = 'http://www.cafci.org.ar/Scripts/cfn_PlanillaDiariaXMLList.asp'.freeze
|
22
24
|
|
@@ -37,8 +39,19 @@ module Ifqar
|
|
37
39
|
|
38
40
|
def query_service(date, type)
|
39
41
|
payload = payload_builder(date, type)
|
40
|
-
|
41
|
-
|
42
|
+
|
43
|
+
retries = 0
|
44
|
+
begin
|
45
|
+
response = RestClient.post(SET_PARAMS_URL, { :query => payload }, HEADERS)
|
46
|
+
response = RestClient.post(QUERY_URL, nil, HEADERS.merge(:cookies => response.cookies))
|
47
|
+
rescue RestClient::ExceptionWithResponse => error
|
48
|
+
if retries < MAX_RETRIES
|
49
|
+
retries += 1
|
50
|
+
retry
|
51
|
+
else
|
52
|
+
raise error
|
53
|
+
end
|
54
|
+
end
|
42
55
|
|
43
56
|
StatsDeserializer.deserialze(date, FUND_TYPE[type][:name], response.body)
|
44
57
|
end
|
data/lib/ifqar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ifqar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Hein
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|