aranha-parsers 0.8.1 → 0.8.5

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: a3b16504277522c2b34639c2fc47ce7e0ff4eec2457b60aaaa7cd34e2e626f34
4
- data.tar.gz: 63173d948c7ba9340b31874a59442e1f0c1d96d430cd0efef2f8295ed4e31fa2
3
+ metadata.gz: 9fd66650df384bfd84cc234f0ed901e426f0000a7f11bd8cdcec959d5690efdb
4
+ data.tar.gz: a0b80baee8f763633753c9fefacd5a0ab528a8047a8f14a876a08f0cd443c6a1
5
5
  SHA512:
6
- metadata.gz: f2b6d5e521759810fc9ede27725b5c347a294813483d935178a22e709459026ee5cee9f92c89b8cd533feb1fbcdb35744548b9da6c352147072711f8b61fecf1
7
- data.tar.gz: c70c4460f3265e3d87138e2cf8bafd85cc4d6d9efdf9b2cf14d6f5225cf25b203cc79ff8f172f2151a99e38f0997f672b794083fb9d6ec6761068d5ae457d56f
6
+ metadata.gz: f9bd1e8d032eb4f782526e45b549aecdf6951a9c28ba55296293128d4a655a14f8cafda545560d794c5f39a4798c65b96c39e2e5dcea324057a85c5dec492d01
7
+ data.tar.gz: 577bd16ed893fa9df121de6be1844aefc1f178790871aa89caa9073633e83682059f326de48d8561a7928857d26c08f57bbc655d0205b2a7ef7126dd922e2398
@@ -5,11 +5,9 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Aranha
6
6
  module Parsers
7
7
  module Rspec
8
- class Setup
9
- common_constructor :setup_obj
10
-
11
- def perform
12
- require 'aranha/parsers/rspec/source_target_fixtures_example'
8
+ module Setup
9
+ def self.extended(_setup_obj)
10
+ require 'aranha/parsers/rspec/shared_examples/source_target_fixtures'
13
11
  end
14
12
  end
15
13
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aranha
4
+ module Parsers
5
+ class SourceAddress
6
+ class FetchContentError < ::RuntimeError
7
+ end
8
+ end
9
+ end
10
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'addressable'
4
4
  require 'curb'
5
+ require 'aranha/parsers/source_address/fetch_content_error'
5
6
 
6
7
  module Aranha
7
8
  module Parsers
@@ -34,15 +35,27 @@ module Aranha
34
35
  def content
35
36
  c = ::Curl::Easy.new(url)
36
37
  c.follow_location = true
37
- raise "Curl perform failed (URL: #{url})" unless c.perform
38
+ curl_perform(c)
38
39
  return c.body_str if c.status.to_i == 200
39
40
 
40
- raise "Get #{url} returned #{c.status.to_i}"
41
+ raise ::Aranha::Parsers::SourceAddress::FetchContentError,
42
+ "Get #{url} returned #{c.status.to_i}"
41
43
  end
42
44
 
43
45
  def serialize
44
46
  url
45
47
  end
48
+
49
+ private
50
+
51
+ def curl_perform(curl)
52
+ unless curl.perform
53
+ raise(::Aranha::Parsers::SourceAddress::FetchContentError,
54
+ "Curl perform failed (URL: #{url})")
55
+ end
56
+ rescue Curl::Err::CurlError => e
57
+ raise ::Aranha::Parsers::SourceAddress::FetchContentError, "CURL error: #{e.class.name}"
58
+ end
46
59
  end
47
60
  end
48
61
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Parsers
5
- VERSION = '0.8.1'
5
+ VERSION = '0.8.5'
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.8.1
4
+ version: 0.8.5
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: 2021-07-31 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.72'
61
+ version: '0.74'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.72'
68
+ version: '0.74'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: httpclient
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +86,26 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: 2.8.3
89
+ - !ruby/object:Gem::Dependency
90
+ name: nokogiri
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.12'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 1.12.4
99
+ type: :runtime
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '1.12'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 1.12.4
89
109
  - !ruby/object:Gem::Dependency
90
110
  name: ofx-parser
91
111
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +129,7 @@ dependencies:
109
129
  version: '0.3'
110
130
  - - ">="
111
131
  - !ruby/object:Gem::Version
112
- version: 0.3.1
132
+ version: 0.3.3
113
133
  type: :development
114
134
  prerelease: false
115
135
  version_requirements: !ruby/object:Gem::Requirement
@@ -119,7 +139,7 @@ dependencies:
119
139
  version: '0.3'
120
140
  - - ">="
121
141
  - !ruby/object:Gem::Version
122
- version: 0.3.1
142
+ version: 0.3.3
123
143
  description:
124
144
  email:
125
145
  executables: []
@@ -141,8 +161,9 @@ files:
141
161
  - lib/aranha/parsers/patches/ofx_parser.rb
142
162
  - lib/aranha/parsers/rspec.rb
143
163
  - lib/aranha/parsers/rspec/setup.rb
144
- - lib/aranha/parsers/rspec/source_target_fixtures_example.rb
164
+ - lib/aranha/parsers/rspec/shared_examples/source_target_fixtures.rb
145
165
  - lib/aranha/parsers/source_address.rb
166
+ - lib/aranha/parsers/source_address/fetch_content_error.rb
146
167
  - lib/aranha/parsers/source_address/file.rb
147
168
  - lib/aranha/parsers/source_address/hash_http_get.rb
148
169
  - lib/aranha/parsers/source_address/hash_http_post.rb