aranha-parsers 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aranha/parsers/source_address/hash_http_base.rb +11 -7
- data/lib/aranha/parsers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ec41f5c85e077409458835a5cbd8d244a2f74ee4edb5e3c8d02ae9a3919f66b
|
4
|
+
data.tar.gz: 1a64b3f50994e1ed230b36a90861895faea86875963693ff95256d49d563ec09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfca3d50399e38f7eccdf8173e8f630ce7b05f255619bc603a65a1a0ca34c5534582b791e1d6e67a5dd91536e053dcb99df1acf32270e7b7ca12724e7fbbe302
|
7
|
+
data.tar.gz: 1deb6e809fe03032f681f79194e058709e822b31771293f6c796ab22ccc543836201771fccfc03ab6e1f3421370eefa1e28787a613972e248cb0ba6d3814bf40
|
@@ -26,6 +26,8 @@ module Aranha
|
|
26
26
|
DEFAULT_HEADERS = {}.freeze
|
27
27
|
DEFAULT_PARAMS = {}.freeze
|
28
28
|
|
29
|
+
enable_simple_cache
|
30
|
+
|
29
31
|
common_constructor :source do
|
30
32
|
self.source = source.with_indifferent_access
|
31
33
|
end
|
@@ -58,13 +60,6 @@ module Aranha
|
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
def faraday_request
|
62
|
-
faraday_connection.send(self.class.http_method, url) do |req|
|
63
|
-
headers.if_present { |v| req.headers = v }
|
64
|
-
body.if_present { |v| req.body = v }
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
63
|
def content
|
69
64
|
req = faraday_request
|
70
65
|
return req.body if req.status == 200
|
@@ -80,6 +75,15 @@ module Aranha
|
|
80
75
|
def params
|
81
76
|
source[:params].if_present(DEFAULT_PARAMS)
|
82
77
|
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def faraday_request_uncached
|
82
|
+
faraday_connection.send(self.class.http_method, url) do |req|
|
83
|
+
headers.if_present { |v| req.headers = v }
|
84
|
+
body.if_present { |v| req.body = v }
|
85
|
+
end
|
86
|
+
end
|
83
87
|
end
|
84
88
|
end
|
85
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aranha-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|