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: d2ddf8d96b3eb46a3690802194d7bac810d77955dc2f79e6c0329c80ef326592
4
- data.tar.gz: 7caeceb58462533b58c9976ed6ab942f995a8756d4db00ff50f61fd730f98735
3
+ metadata.gz: 6a199311d583a58c2c57bd9440cf4427cacb84b2dea969c576f1be3e0fba1a33
4
+ data.tar.gz: 6f8ec7116bdeca022910267fcc27ebd64295fd70f93f99ceb0d409859c64601e
5
5
  SHA512:
6
- metadata.gz: 394353da9e1e5859005fcb65104629535162e9a89d2acf70c515f71358e2fca7b1291b6210549f4f1f9d64577aaef6a947670f8ae1903af4f16af1ade346c4ca
7
- data.tar.gz: 0bba5dff7e92e219a978f4708ccaa083a208671c0a810ad204da7397760e633645228aa2ddb718d33e508ca76ca8cb3da6f7c3f1b043a5d6d241c6d3cf2b8e37
6
+ metadata.gz: 75994fd4861bf9dab93c2fa9196ebb022004c9dcdc2d88702385d62d0b55fb81b985df82b42d980decd410e5c8d0dd8664e0e3bfe9b83c27f056f560b61da247
7
+ data.tar.gz: 5798eebdd9d63c3cd6717bbc33a58feec336e0d033df20181db42a49fb19b70e01b7264d8cdaa303bb1c649ed950d64793b612425ada4d65f29afeb1c84b7f64
@@ -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
- delegate :content, to: :source_address, prefix: true
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
 
@@ -15,7 +15,7 @@ module Aranha
15
15
  end
16
16
 
17
17
  def initialize(source)
18
- super source.to_s.gsub(/\A#{Regexp.quote(SCHEME)}/, '')
18
+ super(source.to_s.gsub(/\A#{Regexp.quote(SCHEME)}/, ''))
19
19
  end
20
20
 
21
21
  def url
@@ -58,7 +58,7 @@ module Aranha
58
58
 
59
59
  def content
60
60
  request = http_request
61
- request.response.body_str
61
+ request.response.body_str!
62
62
  rescue ::EacEnvs::Http::Error => e
63
63
  raise ::Aranha::Parsers::SourceAddress::FetchContentError, e.message, request
64
64
  end
@@ -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, e.message, request
48
+ raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(e.message, request)
47
49
  end
48
50
 
49
51
  def serialize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Parsers
5
- VERSION = '0.22.0'
5
+ VERSION = '0.23.1'
6
6
  end
7
7
  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.22.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: 2023-11-18 00:00:00.000000000 Z
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.5
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.5
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.4'
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.4'
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.119'
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.119'
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.4
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.4
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.9'
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.9'
122
+ version: '0.10'
135
123
  description:
136
124
  email:
137
125
  executables: []