tee_logger 2.3.1 → 2.4.0

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: c7cfa1233c7382b0aa859ac597dcf46c6624e631
4
- data.tar.gz: 9c9c42fb945df93f0649e7a96c603045232efe4b
3
+ metadata.gz: a0ff6fc15c1c8e804ba3667f9d181483125639e7
4
+ data.tar.gz: b7370c6fd53453ad75b82aac738fbe310fca0d5a
5
5
  SHA512:
6
- metadata.gz: e766a42f2e74e1b03399eba2ceb86376088f04b18b0220ab9db72304ea0588f18c9d498ab9f6ddcf90fec182f3cd754b5b6e5cfa53f11f39c8b87921ec0b4646
7
- data.tar.gz: ee19b4b2f1d5af0aaee20f7a72b268953d4e660b27e77cb9e4f81754d77e73c518fb9666be9b83919fc9ba7c3703c8a6852861bbb4087bf50a4fcab4cba26197
6
+ metadata.gz: 4b83206e8378f1e44920fa27419f07829dd00106a7e9b899eab201bfe11608ec8840038175e7e8629c91cbdc532b5a213ac6982a7e595a7dfb2078cb86abf71d
7
+ data.tar.gz: b724b8b6e99e0213cb0aebb98e7b51ea1ef0398989f34563a232ef8f1badc0e0b77e79ff4bd9843ec947648169155c492fcb0c61616db0281968145b9d3f6532
@@ -1,36 +1,38 @@
1
- # 2.3.1
2
- - refactoring
3
- - TeeLogger#disable
4
-
5
- # 2.3.0
6
- - remove TeeLogger.attr_reader
7
- - and rename instance variable: @logger => @logfile
8
- - implementation `#level` and `level=`
9
- - implementation `#formatter` and `formatter=`
10
-
11
- # 2.2.0
12
- - disabling and enabling
13
-
14
- # 2.1.1
15
- - refactoring of test case
16
- - Introduced capture_stdout
17
- - Introduced FakeFS
18
- - Change logdev of Console for Logger from STDOUT to $ stdout
19
-
20
- # 2.1.0
21
- - Integrate TeeLogger::Base class to TeeLogger::TeeLogger class
22
-
23
- # 2.0.2
24
- - bugfix
25
-
26
- # 2.0.1
27
- - bugfix
28
-
29
- # 2.0.0
30
- - Change to Class from Module
31
-
32
- # 1.1.0
33
- - bugfix
34
-
35
- # 1.0.0
36
- - first
1
+ # v2.4.0
2
+ - TeeLogger#disable is allow block given
3
+
4
+ # v2.3.1
5
+ - refactoring TeeLogger#disable
6
+
7
+ # v2.3.0
8
+ - remove TeeLogger.attr_reader
9
+ - and rename instance variable: @logger => @logfile
10
+ - implementation `#level` and `level=`
11
+ - implementation `#formatter` and `formatter=`
12
+
13
+ # v2.2.0
14
+ - disabling and enabling
15
+
16
+ # v2.1.1
17
+ - refactoring of test case
18
+ - Introduced capture_stdout
19
+ - Introduced FakeFS
20
+ - Change logdev of Console for Logger from STDOUT to $ stdout
21
+
22
+ # v2.1.0
23
+ - Integrate TeeLogger::Base class to TeeLogger::TeeLogger class
24
+
25
+ # v2.0.2
26
+ - bugfix
27
+
28
+ # v2.0.1
29
+ - bugfix
30
+
31
+ # v2.0.0
32
+ - Change to Class from Module
33
+
34
+ # v1.1.0
35
+ - bugfix
36
+
37
+ # v1.0.0
38
+ - first
@@ -103,7 +103,13 @@ module TeeLogger
103
103
  # @todo Too miscellaneous
104
104
  # @param target [String, Symbol]
105
105
  def disable(target)
106
- instance_variable_get("@#{target}").formatter = proc { |_, _, _, _| '' }
106
+ if block_given?
107
+ disable(target)
108
+ yield
109
+ enable(target)
110
+ else
111
+ instance_variable_get("@#{target}").formatter = proc { |_, _, _, _| '' }
112
+ end
107
113
  end
108
114
 
109
115
  # @todo Too miscellaneous
@@ -1,5 +1,5 @@
1
1
  # namespace
2
2
  module TeeLogger
3
3
  # version number
4
- VERSION = '2.3.1'
4
+ VERSION = '2.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tee_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-ta-yamada