transaction_logger 1.1.0 → 1.1.1

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: 9899c250fec9081879e51756423266f91857486c
4
- data.tar.gz: 4f34d0ec3361406baab8c5c0bf014d6907c0396f
3
+ metadata.gz: 4624efa12a5ac909c57afb89c621b8c4dd440584
4
+ data.tar.gz: d1da36be5b5c7f45796fcf66247be4588415ec65
5
5
  SHA512:
6
- metadata.gz: 5bbd22b54c4e58ca8db1ff00c8ac0a3deb9fff9bde48cd025cacdb51aa5120a1a96f5ff653fd180026deb87bea9708357c0550f84cd60c007a86883bc904ddaf
7
- data.tar.gz: 2cbab0495546119f4707185eea0896cb8bb13fce4ee972e61c113aa4c9fa2eaede01c61eac368feeb8db2166015eb384ce0acfa28b15f39c0fef90ae6e72d7de
6
+ metadata.gz: bb4acbefc4be24bdb388157dbc49b34be089e906a9249dcae239dd7287bcde4988af55c81aa2c44844fb37f7fdf51d3fc989ec85c93d2b9c770a2203bea40c70
7
+ data.tar.gz: 83beea056f701b80132c36c2d3d248305b51c7a14a45b757b6884784a94c51e7853b2bc4f1bdc3d954f51f30b358049fd42120ce5bfec5235e2e44492da9593c
@@ -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 { |transaction|
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
@@ -1,3 +1,3 @@
1
1
  module TransactionLogger
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  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 do |_t|
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 do |_t|
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 "TEST"
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 "TEST"
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 "TEST"
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.0
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-08-03 00:00:00.000000000 Z
12
+ date: 2015-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler