yell 0.0.1 → 0.1.0
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.
- data/lib/yell.rb +0 -2
- data/lib/yell/adapters.rb +2 -0
- data/lib/yell/logger.rb +2 -2
- data/lib/yell/version.rb +1 -1
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/yell_spec.rb +17 -0
- metadata +4 -1
data/lib/yell.rb
CHANGED
data/lib/yell/adapters.rb
CHANGED
data/lib/yell/logger.rb
CHANGED
@@ -2,7 +2,7 @@ module Yell
|
|
2
2
|
class Logger
|
3
3
|
Levels = [ 'debug', 'info', 'warn', 'error', 'fatal', 'unknown' ]
|
4
4
|
|
5
|
-
|
5
|
+
|
6
6
|
def initialize( *args, &block )
|
7
7
|
@adapters = []
|
8
8
|
|
@@ -26,7 +26,7 @@ module Yell
|
|
26
26
|
def adapter ( type, options = {}, &block )
|
27
27
|
@adapters << Yell::Adapters.new( type, @options.merge(options), &block )
|
28
28
|
rescue LoadError => e
|
29
|
-
|
29
|
+
raise Yell::NoSuchAdapter, e.message
|
30
30
|
end
|
31
31
|
|
32
32
|
def level ( val )
|
data/lib/yell/version.rb
CHANGED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
|
4
|
+
require 'yell'
|
5
|
+
|
6
|
+
require 'rspec'
|
7
|
+
require 'timecop'
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
|
11
|
+
config.before do
|
12
|
+
Yell.config.stub!( :yaml_file ).and_return( File.dirname(__FILE__) + '/config/yell.yml' )
|
13
|
+
end
|
14
|
+
|
15
|
+
config.after do
|
16
|
+
Yell.config.reload! # to not run into caching problems during tests
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
data/spec/yell_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Yell do
|
4
|
+
|
5
|
+
describe "a new Yell instance" do
|
6
|
+
let( :logger ) { Yell.new }
|
7
|
+
|
8
|
+
it "should return a Yell::Logger" do
|
9
|
+
logger.should be_kind_of( Yell::Logger )
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should raise NoSuchAdapter when adapter cant be loaded" do
|
13
|
+
lambda { Yell.new :unknownadapter }.should raise_error( Yell::NoSuchAdapter )
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -30,6 +30,9 @@ files:
|
|
30
30
|
- lib/yell/formatter.rb
|
31
31
|
- lib/yell/logger.rb
|
32
32
|
- lib/yell/version.rb
|
33
|
+
- spec/spec.opts
|
34
|
+
- spec/spec_helper.rb
|
35
|
+
- spec/yell_spec.rb
|
33
36
|
- yell.gemspec
|
34
37
|
homepage: http://rubygems.org/gems/yell
|
35
38
|
licenses: []
|