benchmark_methods 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/benchmark_methods.rb +5 -4
- data/lib/benchmark_methods/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e960d0ae445df9d78d7d69ed765bef6ddd461a3
|
4
|
+
data.tar.gz: 0b66d4b9e885cf6a2c53793264eadf62000c7201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae991f3112b574e06d5e8abc82dfca3fd0d1ccaf8654649c0aa6d89faae7d6b96cca3f2c4dd7179c826b70b19034c4f58951d6747525998ca214f4ebd42f72b9
|
7
|
+
data.tar.gz: db519116419caf1aca2bb73c9737d3d34e347521bf3e67f17bd0041fc2e376d6598dae5e82c2eff3f847e6bd64750d22ca44ed2f756106fa8805d7d51528cedc
|
data/lib/benchmark_methods.rb
CHANGED
@@ -6,15 +6,16 @@ module BenchmarkMethods
|
|
6
6
|
|
7
7
|
def self.included(base_klass)
|
8
8
|
base_klass.extend(ClassMethods)
|
9
|
-
|
10
|
-
|
9
|
+
unless Object.const_defined?("#{base_klass.name.demodulize}Interceptor")
|
10
|
+
interceptor = const_set("#{base_klass.name.demodulize}Interceptor", Module.new)
|
11
|
+
base_klass.send(:prepend, interceptor)
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
13
15
|
def self.log(report)
|
14
16
|
if Object.const_defined?("Rails")
|
15
17
|
Rails.logger.debug(" --> #{report.label}")
|
16
|
-
Rails.logger.debug(Benchmark::CAPTION)
|
17
|
-
Rails.logger.debug(report.to_s)
|
18
|
+
Rails.logger.debug("#{Benchmark::CAPTION}#{report.to_s}")
|
18
19
|
else
|
19
20
|
puts(" --> #{report.label}")
|
20
21
|
puts(Benchmark::CAPTION)
|