paul_bunyan 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paul_bunyan/metadata_logging.rb +12 -0
- data/lib/paul_bunyan/version.rb +1 -1
- data/spec/lib/paul_bunyan/metadata_logging_spec.rb +15 -0
- 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: 171388d288887542610c069c558db27316b5126e
|
4
|
+
data.tar.gz: fe2ec569d2228aa11a55e2b16bdbcaacd5075a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28d191b3a06b5d193e1bcf530a8e60ae0de981909695009d7610d256db62fb8ad459c1ec50b6efe43aa7af9c543cf34d516a52f91fc589a7f62801832d46f146
|
7
|
+
data.tar.gz: 960b65912617acd94f0eec1a67020586a2eb04243f770523e5861f24c1fee4e080c296058e76308e8e8fa0adaee4234ff8d023cc604cbd0dc6902630cdbb38fa
|
@@ -8,6 +8,18 @@ module PaulBunyan
|
|
8
8
|
formatter.with_metadata(metadata) { yield self }
|
9
9
|
end
|
10
10
|
|
11
|
+
def add_metadata(metadata)
|
12
|
+
formatter.add_metadata(metadata)
|
13
|
+
end
|
14
|
+
|
15
|
+
def remove_metadata(metadata)
|
16
|
+
formatter.remove_metadata(metadata)
|
17
|
+
end
|
18
|
+
|
19
|
+
def current_metadata
|
20
|
+
formatter.current_metadata
|
21
|
+
end
|
22
|
+
|
11
23
|
def flush
|
12
24
|
clear_metadata!
|
13
25
|
super if defined?(super)
|
data/lib/paul_bunyan/version.rb
CHANGED
@@ -21,6 +21,21 @@ describe PaulBunyan::MetadataLogging do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
it 'must delegate add_metadata to the formatter' do
|
25
|
+
expect(formatter).to receive(:add_metadata).with(foo: 'bar')
|
26
|
+
subject.add_metadata(foo: 'bar')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'must delegate current_metadata to the formatter' do
|
30
|
+
expect(formatter).to receive(:current_metadata).and_return({})
|
31
|
+
subject.current_metadata
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'must delegate remove_metadata to the formatter' do
|
35
|
+
expect(formatter).to receive(:remove_metadata).with(foo: 'bar')
|
36
|
+
subject.remove_metadata(foo: 'bar')
|
37
|
+
end
|
38
|
+
|
24
39
|
context '#flush' do
|
25
40
|
it 'clears metadata on the formatter' do
|
26
41
|
expect(formatter).to receive(:clear_metadata!)
|