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 +4 -4
- data/lib/lhc/interceptor.rb +7 -0
- data/lib/lhc/version.rb +1 -1
- data/spec/interceptors/dup_spec.rb +17 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd92ab1bfd15f3516a093944756c6ed93d6c87b6
|
4
|
+
data.tar.gz: 9f50976aa3e62662e9c882449dd14be7cb47c95a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798f3a93d443eb1b3a3a65832dd4d5f0c8e3c6fb7fbcbdc3f163deb385fb2101be109345ab86196725bbb06a9487b6e3f752a80d797fbd573a48caa202dafefa
|
7
|
+
data.tar.gz: 1eba080feaf0757dcb8f8ad182a7ef974e97698f292905ee99327b709d645836f71667401c00ec272ae77fa32110af634a0617cb7c9e59deb0406416be9a9d3a
|
data/lib/lhc/interceptor.rb
CHANGED
@@ -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
@@ -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.
|
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-
|
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
|