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 +4 -4
- data/lib/time_bandits/railtie.rb +9 -0
- data/lib/time_bandits/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4bbdee09ecd1f5428fe0c93b049b5f157814ba
|
4
|
+
data.tar.gz: 686ef134d2a40459582093824f69da699d8a0394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c532ac1341dd826a10abada88e6ddc003a0e7fac38f7a534d45f24ea29aadac2b9a522d060c95e2ae99d15387de7b054fad32a94ec91ea2f89b93107f83899
|
7
|
+
data.tar.gz: b8bdbe06f60a9acf31437a554562440611a68ea9ac35a6f8cb75de0dc2c2377c7239d815e7f50b8c6502fcca008028c8121b80aee905d80a4f835d3bd174381a
|
data/lib/time_bandits/railtie.rb
CHANGED
@@ -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
|
|
data/lib/time_bandits/version.rb
CHANGED
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.
|
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:
|
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.
|
298
|
+
rubygems_version: 2.6.10
|
299
299
|
signing_key:
|
300
300
|
specification_version: 4
|
301
301
|
summary: Custom performance logging for Rails
|