mini_logger 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mini_logger.rb +7 -3
  2. data/lib/version.rb +12 -2
  3. metadata +70 -44
data/lib/mini_logger.rb CHANGED
@@ -27,7 +27,9 @@ module MiniLogger
27
27
  ::Logger::ERROR => ERROR,
28
28
  ::Logger::FATAL => FATAL
29
29
  }
30
-
30
+
31
+ @logger = nil
32
+
31
33
  def self.standarize_log_level(ll)
32
34
 
33
35
  case ll
@@ -93,6 +95,7 @@ module MiniLogger
93
95
  end
94
96
 
95
97
  def level!(nll)
98
+
96
99
  if @logger
97
100
 
98
101
  raise ArgumentError.new("Invalid log level #{nll.class.name}:'#{nll}'") unless validate_log_level?(nll)
@@ -102,7 +105,8 @@ module MiniLogger
102
105
  end
103
106
  end
104
107
 
105
- def level
108
+ def level
109
+
106
110
  RLLM[@logger.level] if @logger
107
111
  end
108
112
 
@@ -113,4 +117,4 @@ module MiniLogger
113
117
  @logger.send(method, *arguments, &block)
114
118
  end
115
119
  end
116
- end
120
+ end
data/lib/version.rb CHANGED
@@ -4,11 +4,21 @@ module MiniLogger
4
4
  INFO = {
5
5
  :major =>0,
6
6
  :minor =>5,
7
- :patch =>0
7
+ :patch =>1
8
8
  }
9
9
 
10
+ def self.number(version_info=INFO)
11
+
12
+ if RUBY_VERSION =~ /1\.8\.\d/
13
+ [version_info[:major], version_info[:minor],version_info[:patch]].join('.')
14
+ else
15
+ version_info.values.join('.')
16
+ end
17
+ end
18
+
19
+
10
20
  NAME = 'mini_logger'
11
- NUMBER = INFO.values.join('.')
21
+ NUMBER = "#{number()}"
12
22
  VERSION = [NAME, NUMBER].join('-')
13
23
  end
14
24
  end
metadata CHANGED
@@ -1,84 +1,110 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mini_logger
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 1
10
+ version: 0.5.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Javier Juarez
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-06-18 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: jeweler
16
- requirement: &2156243800 !ruby/object:Gem::Requirement
17
+
18
+ date: 2011-06-20 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ requirement: &id001 !ruby/object:Gem::Requirement
17
22
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ hash: 3
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ version_requirements: *id001
22
31
  type: :development
32
+ name: jeweler
23
33
  prerelease: false
24
- version_requirements: *2156243800
25
- - !ruby/object:Gem::Dependency
26
- name: file-tail
27
- requirement: &2156228220 !ruby/object:Gem::Requirement
34
+ - !ruby/object:Gem::Dependency
35
+ requirement: &id002 !ruby/object:Gem::Requirement
28
36
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ hash: 3
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ version_requirements: *id002
33
45
  type: :development
46
+ name: file-tail
34
47
  prerelease: false
35
- version_requirements: *2156228220
36
- - !ruby/object:Gem::Dependency
37
- name: rcov
38
- requirement: &2156225680 !ruby/object:Gem::Requirement
48
+ - !ruby/object:Gem::Dependency
49
+ requirement: &id003 !ruby/object:Gem::Requirement
39
50
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ version_requirements: *id003
44
59
  type: :development
60
+ name: rcov
45
61
  prerelease: false
46
- version_requirements: *2156225680
47
62
  description: A minimal standard Logger wrapper perfect for CLI applications
48
63
  email: javier.juarez@gmail.com
49
64
  executables: []
65
+
50
66
  extensions: []
51
- extra_rdoc_files:
67
+
68
+ extra_rdoc_files:
52
69
  - README.rdoc
53
- files:
70
+ files:
54
71
  - lib/mini_logger.rb
55
72
  - lib/version.rb
56
73
  - test/helpers/tail_file_helper.rb
57
74
  - test/unit/test_mini_logger.rb
58
75
  - README.rdoc
59
76
  homepage: http://github.com/jjuarez/mini_logger
60
- licenses:
77
+ licenses:
61
78
  - MIT
62
79
  post_install_message:
63
80
  rdoc_options: []
64
- require_paths:
81
+
82
+ require_paths:
65
83
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
84
+ required_ruby_version: !ruby/object:Gem::Requirement
67
85
  none: false
68
- requirements:
69
- - - ! '>='
70
- - !ruby/object:Gem::Version
71
- version: '0'
72
- required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
94
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
101
+ version: "0"
78
102
  requirements: []
103
+
79
104
  rubyforge_project: http://github.com/jjuarez/mini_logger
80
105
  rubygems_version: 1.8.5
81
106
  signing_key:
82
107
  specification_version: 3
83
108
  summary: A tiny logger utility for small applications
84
109
  test_files: []
110
+