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.
Files changed (9) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +16 -0
  3. data/LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/VERSION +1 -1
  6. data/lib/lll.rb +7 -4
  7. data/lll.gemspec +24 -21
  8. metadata +69 -103
  9. data/.gitignore +0 -6
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+ gem 'jeweler'
3
+ gem 'rake'
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ git (1.2.5)
5
+ jeweler (1.6.4)
6
+ bundler (~> 1.0)
7
+ git (>= 1.2.5)
8
+ rake
9
+ rake (0.9.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ jeweler
16
+ rake
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Mark Wilden
1
+ Copyright (c) 2011 Mark Wilden
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -55,4 +55,4 @@ be useful to simply print a string without an expression:
55
55
 
56
56
  === Copyright
57
57
 
58
- Copyright (c) 2009 Mark Wilden. See LICENSE for details.
58
+ Copyright (c) 2011 Mark Wilden. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
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
- Kernel.puts format(output_string, ENV['TERM'] != 'dumb')
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) && !value.is_a?(String) && !value.is_a?(Nokogiri::HTML::Document) &&
46
- !value.is_a?(Nokogiri::XML::Element)
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 the gemspec command
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.4.0"
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 = ["Mark Wilden"]
12
- s.date = %q{2011-03-11}
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) 2009 Mark Wilden. See LICENSE for details.
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
- "README.rdoc"
75
+ "README.rdoc"
76
76
  ]
77
77
  s.files = [
78
78
  ".document",
79
- ".gitignore",
80
- "LICENSE",
81
- "README.rdoc",
82
- "Rakefile",
83
- "VERSION",
84
- "doc/README_rdoc.html",
85
- "lib/lll.rb",
86
- "lll.gemspec",
87
- "test/test.rb"
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.rdoc_options = ["--charset=UTF-8"]
91
- s.require_paths = ["lib"]
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
- hash: 7
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
- date: 2011-03-11 00:00:00 -08:00
19
- default_executable:
20
- dependencies: []
21
-
22
- description: |
23
- = lll
24
-
25
- lll() is used in debugging to display an expression and its value.
26
-
27
- === Motivation
28
-
29
- One of the most basic tools in debugging is printing out the values of
30
- variables (or other expressions) during program execution:
31
-
32
- puts user_name
33
-
34
- Sometimes you need to label these values so you know what they're
35
- referring to, especially if you're outputting a lot of them:
36
-
37
- puts "user_name = #{message}"
38
-
39
- lll() does the labelling automatically:
40
-
41
- lll{'user_name'}
42
-
43
- The expression is passed as a string inside a block. It's useful to
44
- create a text editor macro that outputs <tt>lll{''}</tt> and leaves the
45
- cursor inside the apostrophes.
46
-
47
- === Other benefits
48
-
49
- Output goes to standard output and the Rails log (if available).
50
-
51
- Output is displayed in reverse video, so it's easy to pick out from the
52
- log or console.
53
-
54
- lll() uses #inspect to output the expression. It outputs Enumerable
55
- members (except strings) on separate lines.
56
-
57
- Output is tagged with the file and line number where it appears, so
58
- you can easily find lll's that you forgot to take out. The time of
59
- day (but not the date) is also printed, so you don't waste time
60
- looking at old output.
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
- - .gitignore
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
- - --charset=UTF-8
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
- hash: 3
116
- segments:
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ segments:
117
88
  - 0
118
- version: "0"
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
- hash: 3
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.5.0
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: []
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- instructions
2
- *.sw?
3
- .DS_Store
4
- coverage
5
- rdoc
6
- pkg