yell 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/yell/adapters/base.rb +1 -1
- data/lib/yell/loggable.rb +11 -1
- data/lib/yell/version.rb +1 -1
- data/spec/yell/dsl_spec.rb +49 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abc47d23883cfb89cf96caea84d986fb4b6b49a3
|
4
|
+
data.tar.gz: f4fcf00a19dc75bdacf9da500585471d40244f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c64bc86a86f724f37067aa4000ab51b3d603a6c787ff1614242456ac12177c3636a42c58a9d9cfacff897aff9aaf2eb89abbd554aaa92c8fdb340eba52372b89
|
7
|
+
data.tar.gz: fd06a51a54e049e08a76bbab66e9d3733ea84689ef09b433e52b1a1b3f0417ff8f3755aa0723e581701fe00ec96df038ef71679b1659f40dfb41ba2b810ea90d
|
data/Gemfile
CHANGED
data/lib/yell/adapters/base.rb
CHANGED
@@ -180,7 +180,7 @@ module Yell #:nodoc:
|
|
180
180
|
# Adapter classes should provide their own implementation
|
181
181
|
# of this method (if applicable).
|
182
182
|
def setup!( options )
|
183
|
-
self.level = Yell.__fetch__(options
|
183
|
+
self.level = Yell.__fetch__(options, :level)
|
184
184
|
end
|
185
185
|
|
186
186
|
# Perform the actual write.
|
data/lib/yell/loggable.rb
CHANGED
@@ -18,8 +18,18 @@ module Yell #:nodoc:
|
|
18
18
|
# Foo.new.logger.info "Hello World"
|
19
19
|
module Loggable
|
20
20
|
|
21
|
+
def self.included(base)
|
22
|
+
base.extend(ClassMethods)
|
23
|
+
end
|
24
|
+
|
25
|
+
module ClassMethods
|
26
|
+
def logger
|
27
|
+
Yell[self]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
21
31
|
def logger
|
22
|
-
|
32
|
+
self.class.logger
|
23
33
|
end
|
24
34
|
|
25
35
|
end
|
data/lib/yell/version.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Yell Adapter DSL spec" do
|
4
|
+
|
5
|
+
class DSLAdapter < Yell::Adapters::Base
|
6
|
+
|
7
|
+
setup do |options|
|
8
|
+
@test_setup = true
|
9
|
+
end
|
10
|
+
|
11
|
+
write do |event|
|
12
|
+
@test_write = true
|
13
|
+
end
|
14
|
+
|
15
|
+
close do
|
16
|
+
@test_close = true
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_setup?; !!@test_setup; end
|
20
|
+
def test_write?; !!@test_write; end
|
21
|
+
def test_close?; !!@test_close; end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should perform #setup" do
|
25
|
+
adapter = DSLAdapter.new
|
26
|
+
expect(adapter.test_setup?).to be_true
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should perform #write" do
|
30
|
+
event = 'event'
|
31
|
+
stub(event).level { 0 }
|
32
|
+
|
33
|
+
adapter = DSLAdapter.new
|
34
|
+
expect(adapter.test_write?).to be_false
|
35
|
+
|
36
|
+
adapter.write(event)
|
37
|
+
expect(adapter.test_write?).to be_true
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should perform #close" do
|
41
|
+
adapter = DSLAdapter.new
|
42
|
+
expect(adapter.test_close?).to be_false
|
43
|
+
|
44
|
+
adapter.close
|
45
|
+
expect(adapter.test_close?).to be_true
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rudolf Schmidt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Yell - Your Extensible Logging Library. Define multiple adapters, various
|
14
14
|
log level combinations or message formatting options like you've never done before
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- spec/yell/adapters/streams_spec.rb
|
72
72
|
- spec/yell/adapters_spec.rb
|
73
73
|
- spec/yell/configuration_spec.rb
|
74
|
+
- spec/yell/dsl_spec.rb
|
74
75
|
- spec/yell/event_spec.rb
|
75
76
|
- spec/yell/formatter_spec.rb
|
76
77
|
- spec/yell/level_spec.rb
|
@@ -118,6 +119,7 @@ test_files:
|
|
118
119
|
- spec/yell/adapters/streams_spec.rb
|
119
120
|
- spec/yell/adapters_spec.rb
|
120
121
|
- spec/yell/configuration_spec.rb
|
122
|
+
- spec/yell/dsl_spec.rb
|
121
123
|
- spec/yell/event_spec.rb
|
122
124
|
- spec/yell/formatter_spec.rb
|
123
125
|
- spec/yell/level_spec.rb
|