transaction_logger 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4624efa12a5ac909c57afb89c621b8c4dd440584
|
4
|
+
data.tar.gz: d1da36be5b5c7f45796fcf66247be4588415ec65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4acbefc4be24bdb388157dbc49b34be089e906a9249dcae239dd7287bcde4988af55c81aa2c44844fb37f7fdf51d3fc989ec85c93d2b9c770a2203bea40c70
|
7
|
+
data.tar.gz: 83beea056f701b80132c36c2d3d248305b51c7a14a45b757b6884784a94c51e7853b2bc4f1bdc3d954f51f30b358049fd42120ce5bfec5235e2e44492da9593c
|
data/lib/transaction_logger.rb
CHANGED
@@ -32,7 +32,7 @@ module TransactionLogger
|
|
32
32
|
options[:logger] = TransactionLogger::Configure.instance_variable_get :@logger
|
33
33
|
options[:level_threshold] = TransactionLogger::Configure.instance_variable_get :@level_threshold
|
34
34
|
|
35
|
-
define_method method do
|
35
|
+
define_method method do |*params|
|
36
36
|
context = options[:context]
|
37
37
|
|
38
38
|
if context.is_a? Proc
|
@@ -46,7 +46,7 @@ module TransactionLogger
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
TransactionManager.start options, lambda
|
49
|
+
TransactionManager.start options, lambda { |transaction|
|
50
50
|
transaction.name = options[:name]
|
51
51
|
transaction.name ||= "#{old_method.bind(self).owner}#{method.inspect}"
|
52
52
|
transaction.context = context || {}
|
@@ -69,7 +69,7 @@ module TransactionLogger
|
|
69
69
|
TransactionLogger::Helper.trap_logger method, transaction, method_info
|
70
70
|
end
|
71
71
|
|
72
|
-
old_method.bind(self).call
|
72
|
+
old_method.bind(self).call(*params)
|
73
73
|
}
|
74
74
|
end
|
75
75
|
end
|
@@ -15,7 +15,7 @@ describe TransactionLogger::Transaction do
|
|
15
15
|
describe "#run" do
|
16
16
|
context "when no exception is raised" do
|
17
17
|
let (:test_lmbda) {
|
18
|
-
lambda
|
18
|
+
lambda do |_t|
|
19
19
|
"result"
|
20
20
|
end
|
21
21
|
}
|
@@ -29,7 +29,7 @@ describe TransactionLogger::Transaction do
|
|
29
29
|
|
30
30
|
context "when an exception is raised" do
|
31
31
|
let (:test_lmbda) {
|
32
|
-
lambda
|
32
|
+
lambda do |_t|
|
33
33
|
fail "test error"
|
34
34
|
end
|
35
35
|
}
|
@@ -12,8 +12,8 @@ describe TransactionLogger do
|
|
12
12
|
Class.new do
|
13
13
|
include TransactionLogger
|
14
14
|
|
15
|
-
def do_something
|
16
|
-
logger.info
|
15
|
+
def do_something(var)
|
16
|
+
logger.info var
|
17
17
|
end
|
18
18
|
|
19
19
|
def logger
|
@@ -28,8 +28,8 @@ describe TransactionLogger do
|
|
28
28
|
Class.new do
|
29
29
|
include TransactionLogger
|
30
30
|
|
31
|
-
def do_something
|
32
|
-
self.class.logger.info
|
31
|
+
def do_something(var)
|
32
|
+
self.class.logger.info var
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.logger
|
@@ -44,8 +44,8 @@ describe TransactionLogger do
|
|
44
44
|
Class.new do
|
45
45
|
include TransactionLogger
|
46
46
|
|
47
|
-
def do_something
|
48
|
-
puts
|
47
|
+
def do_something(var)
|
48
|
+
puts var
|
49
49
|
end
|
50
50
|
|
51
51
|
add_transaction_log :do_something
|
@@ -56,21 +56,21 @@ describe TransactionLogger do
|
|
56
56
|
expect_any_instance_of(TransactionLogger::LoggerProxy).to receive(:info).and_call_original
|
57
57
|
expect_any_instance_of(Logger).to receive(:info).and_call_original
|
58
58
|
test = instance_logger.new
|
59
|
-
test.do_something
|
59
|
+
test.do_something "value"
|
60
60
|
end
|
61
61
|
|
62
62
|
it "supports .logger" do
|
63
63
|
expect_any_instance_of(TransactionLogger::LoggerProxy).to receive(:info).and_call_original
|
64
64
|
expect_any_instance_of(Logger).to receive(:info).and_call_original
|
65
65
|
test = klass_logger.new
|
66
|
-
test.do_something
|
66
|
+
test.do_something "value"
|
67
67
|
end
|
68
68
|
|
69
69
|
it "supports no logger" do
|
70
70
|
expect_any_instance_of(TransactionLogger::LoggerProxy).to_not receive(:info)
|
71
71
|
expect_any_instance_of(Logger).to_not receive(:info)
|
72
72
|
test = no_logger.new
|
73
|
-
test.do_something
|
73
|
+
test.do_something "value"
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -170,12 +170,4 @@ describe TransactionLogger do
|
|
170
170
|
expect(test_parent_log_queue).to include(child)
|
171
171
|
end
|
172
172
|
end
|
173
|
-
|
174
|
-
describe ".start" do
|
175
|
-
let (:test_lmbda) {
|
176
|
-
described_class.start lambda (t) do
|
177
|
-
t.log ""
|
178
|
-
end
|
179
|
-
}
|
180
|
-
end
|
181
173
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transaction_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Donner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|