clog 0.1.1 → 0.2.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/README.rdoc +17 -5
- data/VERSION +1 -1
- data/clog.gemspec +2 -4
- data/created.rid +1 -1
- data/lib/clog.rb +2 -2
- data/test/rails3x_root/Gemfile.lock +1 -1
- data/test/test_clog.rb +3 -0
- metadata +4 -10
- data/README.html +0 -119
data/README.rdoc
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Little Ruby On Rails debugging gem for writing colorized output to log file.
|
4
4
|
|
5
5
|
Because clog is all about color
|
6
|
-
{here's a blog posting with color pictures}[http://kswope.com]
|
6
|
+
{here's a blog posting with color pictures}[http://kswope.com/2010/08/23/clog-colorful-ruby-on-rails-debug-statements]
|
7
7
|
|
8
8
|
== Usage
|
9
9
|
|
@@ -15,7 +15,8 @@ Rails 2x, in environment.rb
|
|
15
15
|
config.gem 'clog'
|
16
16
|
end
|
17
17
|
|
18
|
-
If you want to change the defaults you might have to require the
|
18
|
+
If you want to change the defaults in environment.rb you might have to require the
|
19
|
+
gem:
|
19
20
|
|
20
21
|
Rails::Initializer.run do |config|
|
21
22
|
config.gem 'clog'
|
@@ -29,6 +30,11 @@ Rails 3x, in Gemfile
|
|
29
30
|
|
30
31
|
You change the defaults in environment.rb just like rails 2x
|
31
32
|
|
33
|
+
|
34
|
+
=== No argument outputs a "flag"
|
35
|
+
|
36
|
+
clog
|
37
|
+
|
32
38
|
=== Single argument
|
33
39
|
|
34
40
|
clog var
|
@@ -60,10 +66,16 @@ Choices- :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white
|
|
60
66
|
Default is red background, white foreground.
|
61
67
|
|
62
68
|
=== Max width
|
63
|
-
clog figures out when its appropriate to place additional information (line number, etc) on the right of the output or below it on the next line. Think of maxwidth
|
64
|
-
as representing the width of your terminal window. The default is 150
|
65
69
|
|
66
|
-
|
70
|
+
clog figures out when its appropriate to place additional information (line number,
|
71
|
+
calling method, etc) on the right of the output or below it on the next line. Think
|
72
|
+
of maxwidth as representing the width of your terminal window. The default is 150
|
73
|
+
|
74
|
+
Clog.maxwidth(100)
|
75
|
+
|
76
|
+
=== Changes
|
77
|
+
|
78
|
+
version 0.2.0 now outputs during testing (not to log but to shell)
|
67
79
|
|
68
80
|
== Copyright
|
69
81
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/clog.gemspec
CHANGED
@@ -5,23 +5,21 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{clog}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kevin Swope"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-07}
|
13
13
|
s.description = %q{Little rails debugging gem for writing colorized output to log file.}
|
14
14
|
s.email = %q{gems-kevdev@snkmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
"README.html",
|
18
17
|
"README.rdoc"
|
19
18
|
]
|
20
19
|
s.files = [
|
21
20
|
".document",
|
22
21
|
".gitignore",
|
23
22
|
"LICENSE",
|
24
|
-
"README.html",
|
25
23
|
"README.rdoc",
|
26
24
|
"Rakefile",
|
27
25
|
"VERSION",
|
data/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Mon, 23 Aug 2010
|
1
|
+
Mon, 23 Aug 2010 22:19:02 -0400
|
data/lib/clog.rb
CHANGED
@@ -22,9 +22,9 @@ class Clog
|
|
22
22
|
def clog(*args)
|
23
23
|
|
24
24
|
# write to appopriate stream
|
25
|
-
if defined?(Rails.logger)
|
25
|
+
if defined?(Rails.logger) && Rails.env != 'test'
|
26
26
|
Rails.logger.debug(message(*args))
|
27
|
-
else #
|
27
|
+
else # for testing
|
28
28
|
puts message(*args)
|
29
29
|
end
|
30
30
|
|
data/test/test_clog.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 25
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Kevin Swope
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-10-07 00:00:00 -04:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -40,13 +38,11 @@ extensions: []
|
|
40
38
|
|
41
39
|
extra_rdoc_files:
|
42
40
|
- LICENSE
|
43
|
-
- README.html
|
44
41
|
- README.rdoc
|
45
42
|
files:
|
46
43
|
- .document
|
47
44
|
- .gitignore
|
48
45
|
- LICENSE
|
49
|
-
- README.html
|
50
46
|
- README.rdoc
|
51
47
|
- Rakefile
|
52
48
|
- VERSION
|
@@ -172,7 +168,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
168
|
requirements:
|
173
169
|
- - ">="
|
174
170
|
- !ruby/object:Gem::Version
|
175
|
-
hash: 3
|
176
171
|
segments:
|
177
172
|
- 0
|
178
173
|
version: "0"
|
@@ -181,7 +176,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
176
|
requirements:
|
182
177
|
- - ">="
|
183
178
|
- !ruby/object:Gem::Version
|
184
|
-
hash: 3
|
185
179
|
segments:
|
186
180
|
- 0
|
187
181
|
version: "0"
|
data/README.html
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>RDoc Documentation</title>
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
<h2>File: README.rdoc</h2>
|
10
|
-
<table>
|
11
|
-
<tr><td>Path:</td><td>README.rdoc</td></tr>
|
12
|
-
<tr><td>Modified:</td><td>Mon Aug 23 20:53:13 -0400 2010</td></tr>
|
13
|
-
</table>
|
14
|
-
|
15
|
-
<h1>clog ("color log")</h1>
|
16
|
-
<p>
|
17
|
-
Little Ruby On Rails debugging gem for writing colorized output to log
|
18
|
-
file.
|
19
|
-
</p>
|
20
|
-
<p>
|
21
|
-
Because clog is all about color <a href="http://kswope.com">here's a blog
|
22
|
-
posting with color pictures</a>
|
23
|
-
</p>
|
24
|
-
<h2>Usage</h2>
|
25
|
-
<pre>
|
26
|
-
> gem install clog
|
27
|
-
</pre>
|
28
|
-
<p>
|
29
|
-
Rails 2x, in environment.rb
|
30
|
-
</p>
|
31
|
-
<pre>
|
32
|
-
Rails::Initializer.run do |config|
|
33
|
-
config.gem 'clog'
|
34
|
-
end
|
35
|
-
</pre>
|
36
|
-
<p>
|
37
|
-
If you want to change the defaults you might have to require the gem also
|
38
|
-
</p>
|
39
|
-
<pre>
|
40
|
-
Rails::Initializer.run do |config|
|
41
|
-
config.gem 'clog'
|
42
|
-
require 'clog'
|
43
|
-
Clog.colors(:black, yellow)
|
44
|
-
end
|
45
|
-
</pre>
|
46
|
-
<p>
|
47
|
-
Rails 3x, in Gemfile
|
48
|
-
</p>
|
49
|
-
<pre>
|
50
|
-
gem "clog"
|
51
|
-
</pre>
|
52
|
-
<p>
|
53
|
-
You change the defaults in environment.rb just like rails 2x
|
54
|
-
</p>
|
55
|
-
<h3>Single argument</h3>
|
56
|
-
<pre>
|
57
|
-
clog var
|
58
|
-
</pre>
|
59
|
-
<h3>Tagged argument</h3>
|
60
|
-
<p>
|
61
|
-
First argument must be a symbol, which it outputs before second argument.
|
62
|
-
</p>
|
63
|
-
<pre>
|
64
|
-
clog :var, var
|
65
|
-
|
66
|
-
{:one=>1, :two=>2, :three=>3}.each do |k,v|
|
67
|
-
clog k, v
|
68
|
-
end
|
69
|
-
</pre>
|
70
|
-
<h3>Multiple arguments</h3>
|
71
|
-
<p>
|
72
|
-
Will output each on its own line.
|
73
|
-
</p>
|
74
|
-
<pre>
|
75
|
-
clog Object.new, Kernel, RUBY_VERSION, :a_symbol
|
76
|
-
</pre>
|
77
|
-
<h3>Changing color</h3>
|
78
|
-
<p>
|
79
|
-
Clog.colors(background, forground=white)
|
80
|
-
</p>
|
81
|
-
<p>
|
82
|
-
Choices- :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white
|
83
|
-
</p>
|
84
|
-
<pre>
|
85
|
-
Clog.colors(:blue)
|
86
|
-
Clog.colors(:black, yellow)
|
87
|
-
</pre>
|
88
|
-
<p>
|
89
|
-
Default is red background, white foreground.
|
90
|
-
</p>
|
91
|
-
<h3>Max width</h3>
|
92
|
-
<p>
|
93
|
-
clog figures out when its appropriate to place additional information (line
|
94
|
-
number, etc) on the right of the output or below it on the next line. Think
|
95
|
-
of maxwidth as representing the width of your terminal window. The default
|
96
|
-
is 150
|
97
|
-
</p>
|
98
|
-
<pre>
|
99
|
-
Clog.maxwidth(20)
|
100
|
-
</pre>
|
101
|
-
<h2>Copyright</h2>
|
102
|
-
<p>
|
103
|
-
Copyright (c) 2010 Kevin Swope. See LICENSE for details.
|
104
|
-
</p>
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
<h2>Classes</h2>
|
113
|
-
</body>
|
114
|
-
</html>
|
115
|
-
Files: 1
|
116
|
-
Classes: 0
|
117
|
-
Modules: 0
|
118
|
-
Methods: 0
|
119
|
-
Elapsed: 0.098s
|