cobalt 0.1.0 → 0.1.1

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/cobalt.gemspec +2 -2
  3. data/lib/cobalt.rb +7 -1
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cobalt}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Fernando Trasvi\303\261a", "Pablo Antonio Gonzalez Cervantes", "kazuyoshi tlacaelel"]
12
- s.date = %q{2012-04-03}
12
+ s.date = %q{2013-07-01}
13
13
  s.description = %q{Colored, Nesting, Multiple logging management.}
14
14
  s.email = %q{kazu.dev@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -13,6 +13,7 @@ module Cobalt
13
13
  @loggers = options[:loggers] || [::Logger.new(STDOUT)]
14
14
  @separator_length = 120
15
15
  @color = :white
16
+ @level = :info
16
17
  end
17
18
 
18
19
  def add_logger logger
@@ -28,7 +29,7 @@ module Cobalt
28
29
  the_string = object.to_s
29
30
  the_string = the_string.to_ansi.send(@color).to_s
30
31
  the_string = the_string.gsub(/^/, ' ' * @indent)
31
- @loggers.each { |logger| logger.info(the_string) }
32
+ @loggers.each { |logger| logger.send(@level, the_string) }
32
33
  end
33
34
  self
34
35
  end
@@ -48,15 +49,20 @@ module Cobalt
48
49
  end
49
50
 
50
51
  def notice(*objects)
52
+ @level = :info
51
53
  color(:cyan) { log(*objects) }
52
54
  end
53
55
 
54
56
  def warn(*objects)
57
+ @level = :warn
55
58
  color(:yellow) { log(*objects) }
59
+ @level = :info
56
60
  end
57
61
 
58
62
  def error(*objects)
63
+ @level = :error
59
64
  color(:red) { log(*objects) }
65
+ @level = :info
60
66
  end
61
67
 
62
68
  def separator(type = '-')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobalt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Fernando Trasvi\xC3\xB1a"
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-04-03 00:00:00 -05:00
20
+ date: 2013-07-01 00:00:00 -05:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency