lll 1.4.0 → 1.9.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/Gemfile +3 -0
- data/Gemfile.lock +16 -0
- data/LICENSE +1 -1
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/lll.rb +7 -4
- data/lll.gemspec +24 -21
- metadata +69 -103
- data/.gitignore +0 -6
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.9.2
|
data/lib/lll.rb
CHANGED
@@ -16,7 +16,7 @@ module Lll
|
|
16
16
|
if block
|
17
17
|
output_string << msg + ': ' if msg
|
18
18
|
expression_string = block.call
|
19
|
-
expression_value = eval(expression_string, block)
|
19
|
+
expression_value = eval(expression_string, block.binding)
|
20
20
|
output_string << expression_string + ' = '
|
21
21
|
if enumerable? expression_value
|
22
22
|
output_string << " \n"
|
@@ -29,7 +29,7 @@ module Lll
|
|
29
29
|
output_string << " \n"
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
$stderr.puts format(output_string, ENV['TERM'] != 'dumb')
|
33
33
|
Rails.logger.debug(format(output_string)) if defined?(Rails) && Rails.logger
|
34
34
|
|
35
35
|
expression_value
|
@@ -42,7 +42,10 @@ module Lll
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.enumerable? value
|
45
|
-
value.respond_to?(:each) &&
|
46
|
-
|
45
|
+
value.respond_to?(:each) &&
|
46
|
+
!value.is_a?(String) &&
|
47
|
+
(!defined? Nokogiri ||
|
48
|
+
(!value.is_a?(Nokogiri::HTML::Document) &&
|
49
|
+
!value.is_a?(Nokogiri::XML::Element)))
|
47
50
|
end
|
48
51
|
end
|
data/lll.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{lll}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.9.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{Mark Wilden}]
|
12
|
+
s.date = %q{2011-08-26}
|
13
13
|
s.description = %q{= lll
|
14
14
|
|
15
15
|
lll() is used in debugging to display an expression and its value.
|
@@ -67,41 +67,44 @@ be useful to simply print a string without an expression:
|
|
67
67
|
|
68
68
|
=== Copyright
|
69
69
|
|
70
|
-
Copyright (c)
|
70
|
+
Copyright (c) 2011 Mark Wilden. See LICENSE for details.
|
71
71
|
}
|
72
72
|
s.email = %q{mark@mwilden.com}
|
73
73
|
s.extra_rdoc_files = [
|
74
74
|
"LICENSE",
|
75
|
-
|
75
|
+
"README.rdoc"
|
76
76
|
]
|
77
77
|
s.files = [
|
78
78
|
".document",
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
79
|
+
"Gemfile",
|
80
|
+
"Gemfile.lock",
|
81
|
+
"LICENSE",
|
82
|
+
"README.rdoc",
|
83
|
+
"Rakefile",
|
84
|
+
"VERSION",
|
85
|
+
"doc/README_rdoc.html",
|
86
|
+
"lib/lll.rb",
|
87
|
+
"lll.gemspec",
|
88
|
+
"test/test.rb"
|
88
89
|
]
|
89
90
|
s.homepage = %q{http://github.com/mwilden/lll}
|
90
|
-
s.
|
91
|
-
s.
|
92
|
-
s.rubygems_version = %q{1.5.0}
|
91
|
+
s.require_paths = [%q{lib}]
|
92
|
+
s.rubygems_version = %q{1.8.6}
|
93
93
|
s.summary = %q{Output labeled data when debugging}
|
94
|
-
s.test_files = [
|
95
|
-
"test/test.rb"
|
96
|
-
]
|
97
94
|
|
98
95
|
if s.respond_to? :specification_version then
|
99
96
|
s.specification_version = 3
|
100
97
|
|
101
98
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
99
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
100
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
102
101
|
else
|
102
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
103
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
103
104
|
end
|
104
105
|
else
|
106
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
107
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
105
108
|
end
|
106
109
|
end
|
107
110
|
|
metadata
CHANGED
@@ -1,95 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: lll
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.9.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 4
|
9
|
-
- 0
|
10
|
-
version: 1.4.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Mark Wilden
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
=== Outputting additional text
|
63
|
-
|
64
|
-
Sometimes you want to include some other string, along with the label
|
65
|
-
and value like this:
|
66
|
-
|
67
|
-
puts "After polling the queue, user_name = #{user_name}"
|
68
|
-
|
69
|
-
You can pass a string to lll() to print a string:
|
70
|
-
|
71
|
-
lll("After polling the queue"){'user_name'}
|
72
|
-
|
73
|
-
And because lll() outputs in reverse video, and to the Rails log, it can
|
74
|
-
be useful to simply print a string without an expression:
|
75
|
-
|
76
|
-
lll "After read_user"
|
77
|
-
|
78
|
-
=== Copyright
|
79
|
-
|
80
|
-
Copyright (c) 2009 Mark Wilden. See LICENSE for details.
|
81
|
-
|
12
|
+
date: 2011-08-26 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jeweler
|
16
|
+
requirement: &2155042180 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2155042180
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &2155041700 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2155041700
|
36
|
+
description: ! "= lll\n\nlll() is used in debugging to display an expression and its
|
37
|
+
value.\n\n=== Motivation\n\nOne of the most basic tools in debugging is printing
|
38
|
+
out the values of\nvariables (or other expressions) during program execution:\n\n
|
39
|
+
\ puts user_name\n\nSometimes you need to label these values so you know what
|
40
|
+
they're\nreferring to, especially if you're outputting a lot of them:\n\n puts
|
41
|
+
\"user_name = #{message}\"\n\nlll() does the labelling automatically: \n\n lll{'user_name'}\n\nThe
|
42
|
+
expression is passed as a string inside a block. It's useful to\ncreate a text editor
|
43
|
+
macro that outputs <tt>lll{''}</tt> and leaves the\ncursor inside the apostrophes.\n\n===
|
44
|
+
Other benefits\n\nOutput goes to standard output and the Rails log (if available).\n\nOutput
|
45
|
+
is displayed in reverse video, so it's easy to pick out from the\nlog or console.\n\nlll()
|
46
|
+
uses #inspect to output the expression. It outputs Enumerable\nmembers (except strings)
|
47
|
+
on separate lines.\n\nOutput is tagged with the file and line number where it appears,
|
48
|
+
so\nyou can easily find lll's that you forgot to take out. The time of\nday (but
|
49
|
+
not the date) is also printed, so you don't waste time\nlooking at old output.\n\n===
|
50
|
+
Outputting additional text\n\nSometimes you want to include some other string, along
|
51
|
+
with the label\nand value like this:\n\n puts \"After polling the queue, user_name
|
52
|
+
= #{user_name}\"\n\nYou can pass a string to lll() to print a string:\n\n lll(\"After
|
53
|
+
polling the queue\"){'user_name'}\n\nAnd because lll() outputs in reverse video,
|
54
|
+
and to the Rails log, it can\nbe useful to simply print a string without an expression:\n\n
|
55
|
+
\ lll \"After read_user\"\n\n=== Copyright\n\nCopyright (c) 2011 Mark Wilden.
|
56
|
+
See LICENSE for details.\n"
|
82
57
|
email: mark@mwilden.com
|
83
58
|
executables: []
|
84
|
-
|
85
59
|
extensions: []
|
86
|
-
|
87
|
-
extra_rdoc_files:
|
60
|
+
extra_rdoc_files:
|
88
61
|
- LICENSE
|
89
62
|
- README.rdoc
|
90
|
-
files:
|
63
|
+
files:
|
91
64
|
- .document
|
92
|
-
-
|
65
|
+
- Gemfile
|
66
|
+
- Gemfile.lock
|
93
67
|
- LICENSE
|
94
68
|
- README.rdoc
|
95
69
|
- Rakefile
|
@@ -98,39 +72,31 @@ files:
|
|
98
72
|
- lib/lll.rb
|
99
73
|
- lll.gemspec
|
100
74
|
- test/test.rb
|
101
|
-
has_rdoc: true
|
102
75
|
homepage: http://github.com/mwilden/lll
|
103
76
|
licenses: []
|
104
|
-
|
105
77
|
post_install_message:
|
106
|
-
rdoc_options:
|
107
|
-
|
108
|
-
require_paths:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
109
80
|
- lib
|
110
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
82
|
none: false
|
112
|
-
requirements:
|
113
|
-
- -
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
|
116
|
-
segments:
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
segments:
|
117
88
|
- 0
|
118
|
-
|
119
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
hash: -983821844545616334
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
91
|
none: false
|
121
|
-
requirements:
|
122
|
-
- -
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
|
125
|
-
segments:
|
126
|
-
- 0
|
127
|
-
version: "0"
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
128
96
|
requirements: []
|
129
|
-
|
130
97
|
rubyforge_project:
|
131
|
-
rubygems_version: 1.
|
98
|
+
rubygems_version: 1.8.6
|
132
99
|
signing_key:
|
133
100
|
specification_version: 3
|
134
101
|
summary: Output labeled data when debugging
|
135
|
-
test_files:
|
136
|
-
- test/test.rb
|
102
|
+
test_files: []
|