aranha-parsers 0.10.0 → 0.11.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/base.rb +7 -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: ea4e3ac094b66f5e1b02e6af4f102c752a869e0a234354b0badb3b2d666368c7
|
4
|
+
data.tar.gz: 95de53aed0f9e7157894515f3b3c881c740c6a9d4e2e787d4c5bbb2bb4432294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 176470a9a8163f44654485f96285c254ecf8d6661f3b435f7af0bc6ccf076c8081cb0554f7b31d77a751f2ce9caa4592454d7b3b5de4cd522a008c2798ecdc7d
|
7
|
+
data.tar.gz: ebc4b32f65dc83d6ba681a0af28babcd8375f4b4c9585985080fc5bcdb5f7bae653979bf21377f10075862c1ab7fa589cca4c1ce0b254b134f1d8d9e7c1f9d3e
|
data/lib/aranha/parsers/base.rb
CHANGED
@@ -37,21 +37,21 @@ module Aranha
|
|
37
37
|
delegate :url, to: :source_address
|
38
38
|
|
39
39
|
def content
|
40
|
-
@content ||=
|
41
|
-
s = source_address.content
|
42
|
-
log_content(s)
|
43
|
-
s
|
44
|
-
end
|
40
|
+
@content ||= log_content(source_address_content)
|
45
41
|
end
|
46
42
|
|
43
|
+
# @return [String]
|
44
|
+
delegate :content, to: :source_address, prefix: true
|
45
|
+
|
47
46
|
private
|
48
47
|
|
48
|
+
# @return [String]
|
49
49
|
def log_content(content, suffix = '')
|
50
50
|
path = log_file(suffix)
|
51
51
|
|
52
|
-
|
52
|
+
File.open(path, 'wb') { |file| file.write(content) } if path
|
53
53
|
|
54
|
-
|
54
|
+
content
|
55
55
|
end
|
56
56
|
|
57
57
|
def log_file(suffix)
|
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.11.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:
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|