lhc 11.1.1 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 236cb60f77bb99d1d14c61dd9fc9cd3c78a8bcacd734deb34b20eb72eee2c7c2
4
- data.tar.gz: 6956f64dc5409d253b7bff60f384dba7b02aff6df7286c50a8c762011eeb8575
3
+ metadata.gz: 19e2069105d325acde5b2d89abcb267604658239dfc8808acc58637aac94a97a
4
+ data.tar.gz: f1795b3999b8307cca582bfd55318a663a823b87057535e9652b1c611d952292
5
5
  SHA512:
6
- metadata.gz: '0559059bd1594c8cf6efd9ea3805318af91835e20e87e200176f3eb2c74b7fb83e40f682725a7b4043d443e8950debf9edf1016cc40b41518a8f608a22e10fae'
7
- data.tar.gz: 93846206064d7c3547814aa6e8f4aecd857dc59b139de09c0b921937709c6088be9e1fd8b0c0e8ab5218f6fa3a6ab85bd86ba80cc3bddac36affc449c6f13456
6
+ metadata.gz: 2b0da63bf8c0ff0a66c37e7c3ca3b28f14e4940c2c16d432734b56ff957c4b305ca408660b5448c5f81e87cf19faf76578ddf52b0fbe826a2f63d1ad8c59468d
7
+ data.tar.gz: bd50aacfc4667b1d30cf9e1c1b2961d31b46e5603868a6d14ebcc2690deb4e9e3691e5ef65881f5b1744994d342eaf11be47b48cbd60bb33c1a9065033b32e5c
@@ -59,6 +59,10 @@ class LHC::Error < StandardError
59
59
  self.response = response
60
60
  end
61
61
 
62
+ def self.to_a
63
+ [self]
64
+ end
65
+
62
66
  def to_s
63
67
  return response if response.is_a?(String)
64
68
  request = response.request
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHC
4
- VERSION ||= '11.1.1'
4
+ VERSION ||= '11.2.0'
5
5
  end
@@ -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.1.1
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-04-20 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport