lhc 7.3.0 → 7.3.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
  SHA1:
3
- metadata.gz: c3be90fe7f5118c0d39672fc3bd3d8977c5c29ef
4
- data.tar.gz: 1ebb19663db886f14fcae7e8ce5cf9c3fa895d85
3
+ metadata.gz: bd92ab1bfd15f3516a093944756c6ed93d6c87b6
4
+ data.tar.gz: 9f50976aa3e62662e9c882449dd14be7cb47c95a
5
5
  SHA512:
6
- metadata.gz: c7b6d90013ea2ff3eb3bcd23af36ee3a47d8b6e36ce8079a38dd9c8f86f1d777a8b293399a82fbb65383847b2b8c66b61d0eb71b5eb83590c48e8bc300231a27
7
- data.tar.gz: 65d6c5d0a893662d7553f0589dfd5121c44d124eedddccc93ddc857618c3888b371af52801db4b31184bd61e6b5ce791d1c43c88dde14eccdd2da52a64f48261
6
+ metadata.gz: 798f3a93d443eb1b3a3a65832dd4d5f0c8e3c6fb7fbcbdc3f163deb385fb2101be109345ab86196725bbb06a9487b6e3f752a80d797fbd573a48caa202dafefa
7
+ data.tar.gz: 1eba080feaf0757dcb8f8ad182a7ef974e97698f292905ee99327b709d645836f71667401c00ec272ae77fa32110af634a0617cb7c9e59deb0406416be9a9d3a
@@ -10,4 +10,11 @@ class LHC::Interceptor
10
10
 
11
11
  def after_response(response); end
12
12
 
13
+ # Prevent Interceptors from beeing duplicated!
14
+ # Their classes have flag-character.
15
+ # When duplicated you can't check for their class name anymore:
16
+ # e.g. options.deep_dup[:interceptors].include?(LHC::Caching) # false
17
+ def self.dup
18
+ self
19
+ end
13
20
  end
data/lib/lhc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module LHC
2
- VERSION ||= '7.3.0'
2
+ VERSION ||= '7.3.1'
3
3
  end
@@ -0,0 +1,17 @@
1
+ require 'rails_helper'
2
+
3
+ describe LHC do
4
+ context 'interceptor' do
5
+ before(:each) do
6
+ class SomeInterceptor < LHC::Interceptor
7
+ end
8
+ end
9
+
10
+ it 'does not dup' do
11
+ options = { interceptors: [SomeInterceptor] }
12
+ expect(
13
+ options.deep_dup[:interceptors].include?(SomeInterceptor)
14
+ ).to eq true
15
+ end
16
+ end
17
+ 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: 7.3.0
4
+ version: 7.3.1
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: 2018-02-08 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -309,6 +309,7 @@ files:
309
309
  - spec/interceptors/default_interceptors_spec.rb
310
310
  - spec/interceptors/default_timeout/main_spec.rb
311
311
  - spec/interceptors/define_spec.rb
312
+ - spec/interceptors/dup_spec.rb
312
313
  - spec/interceptors/monitoring/main_spec.rb
313
314
  - spec/interceptors/prometheus_spec.rb
314
315
  - spec/interceptors/response_competition_spec.rb
@@ -442,6 +443,7 @@ test_files:
442
443
  - spec/interceptors/default_interceptors_spec.rb
443
444
  - spec/interceptors/default_timeout/main_spec.rb
444
445
  - spec/interceptors/define_spec.rb
446
+ - spec/interceptors/dup_spec.rb
445
447
  - spec/interceptors/monitoring/main_spec.rb
446
448
  - spec/interceptors/prometheus_spec.rb
447
449
  - spec/interceptors/response_competition_spec.rb