logue 1.0.1 → 1.0.2
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/logue/colors.rb +18 -0
- data/lib/logue/log.rb +4 -6
- data/lib/logue/loggable.rb +4 -7
- data/lib/logue/logger.rb +1 -2
- data/lib/logue/severity.rb +1 -1
- data/test/logue/testlog/loggable_test.rb +3 -3
- metadata +16 -11
- checksums.yaml +0 -7
data/lib/logue/colors.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
#
|
4
|
+
# = colors.rb
|
5
|
+
#
|
6
|
+
# Logging Module
|
7
|
+
#
|
8
|
+
# Author:: Jeff Pace <jeugenepace@gmail.com>
|
9
|
+
# Documentation:: Author
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'rainbow/color'
|
13
|
+
|
14
|
+
class Colors
|
15
|
+
def self.valid_colors
|
16
|
+
Rainbow::Color::Named::NAMES
|
17
|
+
end
|
18
|
+
end
|
data/lib/logue/log.rb
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
#
|
6
6
|
# Logging Module
|
7
7
|
#
|
8
|
-
# Author:: Jeff Pace <
|
8
|
+
# Author:: Jeff Pace <jeugenepace@gmail.com>
|
9
9
|
# Documentation:: Author
|
10
10
|
#
|
11
11
|
|
12
12
|
require 'logue/logger'
|
13
13
|
require 'logue/severity'
|
14
|
-
require '
|
14
|
+
require 'logue/colors'
|
15
15
|
require 'rainbow'
|
16
16
|
|
17
17
|
#
|
@@ -72,9 +72,8 @@ module Logue
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.method_missing meth, *args, &blk
|
75
|
-
validcolors = Sickill::Rainbow::TERM_COLORS
|
76
75
|
# only handling foregrounds, not backgrounds
|
77
|
-
if code =
|
76
|
+
if code = Colors::valid_colors[meth]
|
78
77
|
add_color_method meth.to_s, code + 30
|
79
78
|
send meth, *args, &blk
|
80
79
|
else
|
@@ -83,8 +82,7 @@ module Logue
|
|
83
82
|
end
|
84
83
|
|
85
84
|
def self.respond_to? meth
|
86
|
-
|
87
|
-
validcolors.include?(meth) || super
|
85
|
+
Colors::valid_colors.include?(meth) || super
|
88
86
|
end
|
89
87
|
|
90
88
|
def self.add_color_method color, code
|
data/lib/logue/loggable.rb
CHANGED
@@ -5,13 +5,12 @@
|
|
5
5
|
#
|
6
6
|
# Logging Module
|
7
7
|
#
|
8
|
-
# Author:: Jeff Pace <
|
8
|
+
# Author:: Jeff Pace <jeugenepace@gmail.com>
|
9
9
|
# Documentation:: Author
|
10
10
|
#
|
11
11
|
|
12
12
|
require 'logue/log'
|
13
|
-
require '
|
14
|
-
require 'rainbow'
|
13
|
+
require 'logue/colors'
|
15
14
|
|
16
15
|
#
|
17
16
|
# == Loggable
|
@@ -75,9 +74,8 @@ module Logue
|
|
75
74
|
end
|
76
75
|
|
77
76
|
def method_missing meth, *args, &blk
|
78
|
-
validcolors = Sickill::Rainbow::TERM_COLORS
|
79
77
|
# only handling foregrounds, not backgrounds
|
80
|
-
if code =
|
78
|
+
if code = Colors::valid_colors[meth]
|
81
79
|
add_color_method meth.to_s, code + 30
|
82
80
|
send meth, *args, &blk
|
83
81
|
else
|
@@ -86,8 +84,7 @@ module Logue
|
|
86
84
|
end
|
87
85
|
|
88
86
|
def respond_to? meth
|
89
|
-
|
90
|
-
validcolors.include?(meth) || super
|
87
|
+
Colors::valid_colors.include?(meth) || super
|
91
88
|
end
|
92
89
|
|
93
90
|
def add_color_method color, code
|
data/lib/logue/logger.rb
CHANGED
data/lib/logue/severity.rb
CHANGED
@@ -17,9 +17,9 @@ class LoggableTestCase < Test::Unit::TestCase
|
|
17
17
|
Logue::Log.output = io
|
18
18
|
|
19
19
|
expected = Array.new
|
20
|
-
expected << "[...testlog/lgbl_testee.rb:
|
21
|
-
expected << "[...testlog/lgbl_testee.rb:
|
22
|
-
expected << "[...testlog/lgbl_testee.rb:
|
20
|
+
expected << "[...testlog/lgbl_testee.rb: 10] {LgblTestee#crystal } hello!\n"
|
21
|
+
expected << "[...testlog/lgbl_testee.rb: 11] {LgblTestee#crystal } [34mazul ... [0m\n"
|
22
|
+
expected << "[...testlog/lgbl_testee.rb: 12] {LgblTestee#crystal } [31mrojo?[0m\n"
|
23
23
|
|
24
24
|
te = LgblTestee.new
|
25
25
|
te.crystal
|
metadata
CHANGED
@@ -1,29 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jeff Pace
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rainbow
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
21
|
+
version: 2.0.0
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 2.0.0
|
27
30
|
description: A module that adds logging/trace functionality.
|
28
31
|
email: jeugenepace@gmail.com
|
29
32
|
executables: []
|
@@ -32,6 +35,7 @@ extra_rdoc_files:
|
|
32
35
|
- README.md
|
33
36
|
files:
|
34
37
|
- lib/logue.rb
|
38
|
+
- lib/logue/colors.rb
|
35
39
|
- lib/logue/format.rb
|
36
40
|
- lib/logue/log.rb
|
37
41
|
- lib/logue/loggable.rb
|
@@ -45,26 +49,27 @@ files:
|
|
45
49
|
homepage: http://jeugenepace.github.com/logue
|
46
50
|
licenses:
|
47
51
|
- MIT
|
48
|
-
metadata: {}
|
49
52
|
post_install_message:
|
50
53
|
rdoc_options: []
|
51
54
|
require_paths:
|
52
55
|
- lib
|
53
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
54
58
|
requirements:
|
55
|
-
- - '>='
|
59
|
+
- - ! '>='
|
56
60
|
- !ruby/object:Gem::Version
|
57
61
|
version: '0'
|
58
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
59
64
|
requirements:
|
60
|
-
- - '>='
|
65
|
+
- - ! '>='
|
61
66
|
- !ruby/object:Gem::Version
|
62
67
|
version: '0'
|
63
68
|
requirements: []
|
64
69
|
rubyforge_project:
|
65
|
-
rubygems_version:
|
70
|
+
rubygems_version: 1.8.23
|
66
71
|
signing_key:
|
67
|
-
specification_version:
|
72
|
+
specification_version: 3
|
68
73
|
summary: A minimalist logging module.
|
69
74
|
test_files:
|
70
75
|
- test/logue/format_test.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 88e28403809dcd3bf80bfb7614e1293494594c94
|
4
|
-
data.tar.gz: bbfc67f7472582f138b128b217c2c45606ede499
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: bbd1cd395a13f24e304189fe48deeeb71a450c669c14aaee7425a0033956b1cdb50ef54be715ec2c0778624f0ff4a2b9c51487fd97fc1e8db159248c864021cf
|
7
|
-
data.tar.gz: b1fe33ab236e09f971c1d0e2c9249ba44ffd875812b296c567459dfa70197f2a2b81725da7cb5a53bd1042177da50e67595867e34e9802c69d11bf51f34b96e3
|