lhc 11.1.1 → 11.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhc/error.rb +4 -0
- data/lib/lhc/request.rb +1 -1
- data/lib/lhc/version.rb +1 -1
- data/spec/request/ignore_errors_spec.rb +8 -0
- 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: 19e2069105d325acde5b2d89abcb267604658239dfc8808acc58637aac94a97a
|
4
|
+
data.tar.gz: f1795b3999b8307cca582bfd55318a663a823b87057535e9652b1c611d952292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b0da63bf8c0ff0a66c37e7c3ca3b28f14e4940c2c16d432734b56ff957c4b305ca408660b5448c5f81e87cf19faf76578ddf52b0fbe826a2f63d1ad8c59468d
|
7
|
+
data.tar.gz: bd50aacfc4667b1d30cf9e1c1b2961d31b46e5603868a6d14ebcc2690deb4e9e3691e5ef65881f5b1744994d342eaf11be47b48cbd60bb33c1a9065033b32e5c
|
data/lib/lhc/error.rb
CHANGED
data/lib/lhc/request.rb
CHANGED
@@ -15,7 +15,7 @@ class LHC::Request
|
|
15
15
|
attr_accessor :response, :options, :raw, :format, :error_handler, :errors_ignored, :source
|
16
16
|
|
17
17
|
def initialize(options, self_executing = true)
|
18
|
-
self.errors_ignored = (options.fetch(:ignored_errors, []) || []).compact
|
18
|
+
self.errors_ignored = (options.fetch(:ignored_errors, []) || []).to_a.compact
|
19
19
|
self.source = options&.dig(:source)
|
20
20
|
self.options = format!(options.deep_dup || {})
|
21
21
|
self.error_handler = options.delete :error_handler
|
data/lib/lhc/version.rb
CHANGED
@@ -62,4 +62,12 @@ describe LHC::Request do
|
|
62
62
|
}.to raise_error(LHC::NotFound)
|
63
63
|
end
|
64
64
|
end
|
65
|
+
|
66
|
+
context 'passing keys instead of arrays' do
|
67
|
+
before { stub_request(:get, 'http://local.ch').to_return(status: 404) }
|
68
|
+
|
69
|
+
it "does not raise an error when ignored errors is a key instead of an array" do
|
70
|
+
LHC.get('http://local.ch', ignored_errors: LHC::NotFound)
|
71
|
+
end
|
72
|
+
end
|
65
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.
|
4
|
+
version: 11.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhc/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|