tagged_logger 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ pkg
2
+ doc
3
+ Manifest
4
+
data/Rakefile CHANGED
@@ -10,8 +10,7 @@ end
10
10
 
11
11
  begin
12
12
  require 'jeweler'
13
- gemspec = Gem::Specification.new do |s|
14
-
13
+ Jeweler::Tasks.new do |s|
15
14
  s.name = "tagged_logger"
16
15
  s.summary = "Split your logging by using tags-based rules (tags are generated automatically)"
17
16
  s.email = "fkocherga@gmail.com"
@@ -27,7 +26,7 @@ END
27
26
  s.authors = ["Fedor Kocherga"]
28
27
  s.test_files = ['test/test.rb']
29
28
  end
30
- Jeweler::Tasks.new gemspec
29
+ Jeweler::GemcutterTasks.new
31
30
  rescue LoadError
32
31
  puts "Jeweler not available. Install it with: sudo gem install jeweler"
33
32
  end
data/lib/tagged_logger.rb CHANGED
@@ -15,11 +15,14 @@ class TaggedLogger
15
15
  end
16
16
 
17
17
  def for_tag(*args, &block)
18
- case args.first
19
- when Regexp then rules[args.first] = block
20
- when Class then rules[Regexp.new("^#{args.first.to_s}$")] = block
21
- when Array then args.first.each {|e| for_tag(args.first, block)}
22
- when Symbol then rules[Regexp.new("^#{args.first.to_s}$")] = block
18
+ tags = args
19
+ tags.each do |tag|
20
+ case tag
21
+ when Regexp then rules[args.first] = block
22
+ when Class then rules[Regexp.new("^#{tag.to_s}$")] = block
23
+ when Array then args.first.each {|e| for_tag(tag, block)}
24
+ when Symbol then rules[Regexp.new("^#{tag.to_s}$")] = block
25
+ end
23
26
  end
24
27
  end
25
28
 
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{tagged_logger}
5
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Fedor Kocherga"]
9
- s.date = %q{2009-10-09}
12
+ s.date = %q{2009-10-13}
10
13
  s.description = %q{When you need to use logging for different code in different ways,
11
14
  here is help for you: create tags-based rules for logging. Tags are
12
15
  class names by default, so you do not have to specify them in
@@ -19,7 +22,8 @@ Logger, log4r, writing to STDOUT or something else.
19
22
  "README.rdoc"
20
23
  ]
21
24
  s.files = [
22
- "MIT-LICENSE",
25
+ ".gitignore",
26
+ "MIT-LICENSE",
23
27
  "README.rdoc",
24
28
  "Rakefile",
25
29
  "VERSION",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tagged_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedor Kocherga
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 +04:00
12
+ date: 2009-10-13 00:00:00 +04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -29,6 +29,7 @@ extensions: []
29
29
  extra_rdoc_files:
30
30
  - README.rdoc
31
31
  files:
32
+ - .gitignore
32
33
  - MIT-LICENSE
33
34
  - README.rdoc
34
35
  - Rakefile