aranha-parsers 0.22.0 → 0.23.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a199311d583a58c2c57bd9440cf4427cacb84b2dea969c576f1be3e0fba1a33
|
4
|
+
data.tar.gz: 6f8ec7116bdeca022910267fcc27ebd64295fd70f93f99ceb0d409859c64601e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75994fd4861bf9dab93c2fa9196ebb022004c9dcdc2d88702385d62d0b55fb81b985df82b42d980decd410e5c8d0dd8664e0e3bfe9b83c27f056f560b61da247
|
7
|
+
data.tar.gz: 5798eebdd9d63c3cd6717bbc33a58feec336e0d033df20181db42a49fb19b70e01b7264d8cdaa303bb1c649ed950d64793b612425ada4d65f29afeb1c84b7f64
|
data/lib/aranha/parsers/base.rb
CHANGED
@@ -45,8 +45,17 @@ module Aranha
|
|
45
45
|
@content ||= log_content(source_address_content)
|
46
46
|
end
|
47
47
|
|
48
|
+
# @return [String, nil]
|
49
|
+
def content_encoding
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
48
53
|
# @return [String]
|
49
|
-
|
54
|
+
def source_address_content
|
55
|
+
source_address.content.then do |r|
|
56
|
+
content_encoding.if_present(r) { |v| r.force_encoding(v) }
|
57
|
+
end
|
58
|
+
end
|
50
59
|
|
51
60
|
private
|
52
61
|
|
@@ -38,12 +38,14 @@ module Aranha
|
|
38
38
|
@final_url
|
39
39
|
end
|
40
40
|
|
41
|
+
# @return [String]
|
42
|
+
# @raise [Aranha::Parsers::SourceAddress::FetchContentError]
|
41
43
|
def content
|
42
44
|
request = ::EacEnvs::Http::Request.new.url(url).retry(true).follow_redirect(true)
|
43
45
|
.header('user-agent', self.class.name)
|
44
|
-
request.response.body_str
|
46
|
+
request.response.body_str!
|
45
47
|
rescue ::EacEnvs::Http::Error => e
|
46
|
-
raise ::Aranha::Parsers::SourceAddress::FetchContentError
|
48
|
+
raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(e.message, request)
|
47
49
|
end
|
48
50
|
|
49
51
|
def serialize
|
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.23.1
|
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: 2024-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '2.8'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 2.8.
|
36
|
+
version: 2.8.7
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,47 +43,35 @@ dependencies:
|
|
43
43
|
version: '2.8'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.8.
|
46
|
+
version: 2.8.7
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: eac_envs-http
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 0.4.1
|
53
|
+
version: '0.6'
|
57
54
|
type: :runtime
|
58
55
|
prerelease: false
|
59
56
|
version_requirements: !ruby/object:Gem::Requirement
|
60
57
|
requirements:
|
61
58
|
- - "~>"
|
62
59
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0.
|
64
|
-
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: 0.4.1
|
60
|
+
version: '0.6'
|
67
61
|
- !ruby/object:Gem::Dependency
|
68
62
|
name: eac_ruby_utils
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
70
64
|
requirements:
|
71
65
|
- - "~>"
|
72
66
|
- !ruby/object:Gem::Version
|
73
|
-
version: '0.
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: 0.119.2
|
67
|
+
version: '0.123'
|
77
68
|
type: :runtime
|
78
69
|
prerelease: false
|
79
70
|
version_requirements: !ruby/object:Gem::Requirement
|
80
71
|
requirements:
|
81
72
|
- - "~>"
|
82
73
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0.
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: 0.119.2
|
74
|
+
version: '0.123'
|
87
75
|
- !ruby/object:Gem::Dependency
|
88
76
|
name: nokogiri
|
89
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +81,7 @@ dependencies:
|
|
93
81
|
version: '1.15'
|
94
82
|
- - ">="
|
95
83
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.15.
|
84
|
+
version: 1.15.6
|
97
85
|
type: :runtime
|
98
86
|
prerelease: false
|
99
87
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -103,7 +91,7 @@ dependencies:
|
|
103
91
|
version: '1.15'
|
104
92
|
- - ">="
|
105
93
|
- !ruby/object:Gem::Version
|
106
|
-
version: 1.15.
|
94
|
+
version: 1.15.6
|
107
95
|
- !ruby/object:Gem::Dependency
|
108
96
|
name: ofx-parser
|
109
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,14 +112,14 @@ dependencies:
|
|
124
112
|
requirements:
|
125
113
|
- - "~>"
|
126
114
|
- !ruby/object:Gem::Version
|
127
|
-
version: '0.
|
115
|
+
version: '0.10'
|
128
116
|
type: :development
|
129
117
|
prerelease: false
|
130
118
|
version_requirements: !ruby/object:Gem::Requirement
|
131
119
|
requirements:
|
132
120
|
- - "~>"
|
133
121
|
- !ruby/object:Gem::Version
|
134
|
-
version: '0.
|
122
|
+
version: '0.10'
|
135
123
|
description:
|
136
124
|
email:
|
137
125
|
executables: []
|