time_bandits 0.10.3 → 0.10.4

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: 01eaedc2476f9acf317bb48a0a2c9e1aa77742a2
4
- data.tar.gz: 1fbf51beb7e4d4992639e3ae035fcd66ed3bec6f
3
+ metadata.gz: 6d4bbdee09ecd1f5428fe0c93b049b5f157814ba
4
+ data.tar.gz: 686ef134d2a40459582093824f69da699d8a0394
5
5
  SHA512:
6
- metadata.gz: f660bf5ae9ff600eecf8300247d6995564c97f87d662f1a46f5cd7a27997b55156e31ed464a26cc166066e1bdff9ab2ee9111fe234fb1116597efd8f32f0f862
7
- data.tar.gz: 404ea48c566456ab5c9d1aaf3dae5c9270e376a068fa3cd1f49615a83b46e14c7cca466812d617e6d1fda934cc20bafcbf3bd9afcaa436e93b0d2081dcd7e51b
6
+ metadata.gz: 90c532ac1341dd826a10abada88e6ddc003a0e7fac38f7a534d45f24ea29aadac2b9a522d060c95e2ae99d15387de7b054fad32a94ec91ea2f89b93107f83899
7
+ data.tar.gz: b8bdbe06f60a9acf31437a554562440611a68ea9ac35a6f8cb75de0dc2c2377c7239d815e7f50b8c6502fcca008028c8121b80aee905d80a4f835d3bd174381a
@@ -15,11 +15,19 @@ module TimeBandits
15
15
 
16
16
  ActiveSupport.on_load(:action_controller) do
17
17
  require 'time_bandits/monkey_patches/action_controller'
18
+
19
+ # Rails 5 may trigger the on_load event several times.
20
+ next if included_modules.include?(ActionController::TimeBanditry)
21
+ # For some magic reason, the test above is always false, but I'll leave it in
22
+ # here, should rails every decide to change this behavior.
23
+
18
24
  include ActionController::TimeBanditry
19
25
 
20
26
  # make sure TimeBandits.reset is called in test environment as middlewares are not executed
21
27
  if Rails.env.test?
22
28
  require 'action_controller/test_case'
29
+ # Rails 5 fires on_load events multiple times, so we need to protect against endless recursion here
30
+ next if ActionController::TestCase::Behavior.instance_methods.include?(:process_without_time_bandits)
23
31
  module ActionController::TestCase::Behavior
24
32
  def process_with_time_bandits(*args)
25
33
  TimeBandits.reset
@@ -33,6 +41,7 @@ module TimeBandits
33
41
 
34
42
  ActiveSupport.on_load(:active_record) do
35
43
  require 'time_bandits/monkey_patches/active_record'
44
+ # TimeBandits.add is idempotent, so no need to protect against on_load fired multiple times.
36
45
  TimeBandits.add TimeBandits::TimeConsumers::Database
37
46
  end
38
47
 
@@ -1,3 +1,3 @@
1
1
  module TimeBandits
2
- VERSION = "0.10.3"
2
+ VERSION = "0.10.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_bandits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-12 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thread_variables
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  version: '0'
296
296
  requirements: []
297
297
  rubyforge_project:
298
- rubygems_version: 2.5.1
298
+ rubygems_version: 2.6.10
299
299
  signing_key:
300
300
  specification_version: 4
301
301
  summary: Custom performance logging for Rails