debug_me 1.0.0 → 1.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rultor.yml +9 -0
- data/Rakefile +1 -2
- data/debug_me.gemspec +11 -11
- data/lib/debug_me.rb +18 -22
- data/lib/debug_me/version.rb +1 -1
- data/rubygems.yml.asc +17 -0
- metadata +25 -15
- checksums.yaml +0 -7
data/.rultor.yml
ADDED
data/Rakefile
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
require
|
2
|
-
|
1
|
+
require 'bundler/gem_tasks'
|
data/debug_me.gemspec
CHANGED
@@ -4,23 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'debug_me/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'debug_me'
|
8
8
|
spec.version = DebugMe::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
9
|
+
spec.authors = ['Dewayne VanHoozer']
|
10
|
+
spec.email = ['dvanhoozer@gmail.com']
|
11
|
+
spec.summary = 'A tool to print the labeled value of variables.'
|
12
|
+
spec.description = 'This thing is pretty old. There are much better
|
13
13
|
ways of debugging in a complex application. But,
|
14
14
|
you know, I keep returning to this little method
|
15
|
-
time after time. I guess that marks me as a geezer.
|
16
|
-
spec.homepage =
|
17
|
-
spec.license =
|
15
|
+
time after time. I guess that marks me as a geezer.'
|
16
|
+
spec.homepage = 'http://github.com/MadBomber/debug_me'
|
17
|
+
spec.license = 'You want it, its yours'
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0")
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
end
|
data/lib/debug_me.rb
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
require 'pp'
|
2
|
-
require
|
2
|
+
require 'debug_me/version'
|
3
3
|
|
4
4
|
module DebugMe
|
5
|
-
|
6
|
-
def debug_me( options={}, &block )
|
7
|
-
|
5
|
+
def debug_me(options = {}, &block)
|
8
6
|
default_options = {
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
7
|
+
tag: 'DEBUG:', # A tag to prepend to each output line
|
8
|
+
time: true, # Include a time-stamp in front of the tag
|
9
|
+
header: true, # Print a header string before printing the variables
|
10
|
+
ivar: true, # Include instance variables in the output
|
11
|
+
cvar: true, # Include class variables in the output
|
12
|
+
file: $stdout # The output file
|
15
13
|
}
|
16
14
|
|
17
15
|
if 'Hash' == options.class.to_s
|
18
16
|
options = default_options.merge(options)
|
19
17
|
else
|
20
|
-
options = default_options.merge(
|
18
|
+
options = default_options.merge(tag: options)
|
21
19
|
end
|
22
20
|
|
23
21
|
f = options[:file]
|
24
|
-
s =
|
22
|
+
s = ''
|
25
23
|
s += "#{sprintf('%010.6f', Time.now.to_f)} " if options[:time]
|
26
24
|
s += " #{options[:tag]}"
|
27
25
|
wf = caller # where_from under 1.8.6 its a stack trace array under 1.8.7 is a string
|
@@ -31,30 +29,28 @@ module DebugMe
|
|
31
29
|
|
32
30
|
if block_given?
|
33
31
|
|
34
|
-
block_value = [
|
32
|
+
block_value = [block.call].flatten.compact
|
35
33
|
|
36
34
|
if block_value.empty?
|
37
35
|
block_value = eval('local_variables', block.binding)
|
38
|
-
block_value += [
|
39
|
-
block_value += [
|
36
|
+
block_value += [eval('instance_variables', block.binding)] if options[:ivar]
|
37
|
+
block_value += [self.class.send('class_variables')] if options[:cvar]
|
40
38
|
block_value = block_value.flatten.compact
|
41
39
|
else
|
42
|
-
block_value.map!
|
40
|
+
block_value.map!(&:to_s)
|
43
41
|
end
|
44
42
|
|
45
43
|
block_value.each do |v|
|
46
44
|
ev = eval(v, block.binding)
|
47
|
-
f.puts "#{s} #{v} -=> #{pp ev}"
|
45
|
+
f.puts "#{s} #{v} -=> #{pp ev}" # .pretty_inspect}"
|
48
46
|
end
|
49
47
|
|
50
48
|
end ## if block_given?
|
51
49
|
|
52
50
|
f.flush
|
53
|
-
|
54
51
|
end ## def debug_me( options={}, &block )
|
55
52
|
|
56
|
-
# def log_me(msg, opts={})
|
57
|
-
# debug_me({:tag => msg, :header => false}.merge(opts))
|
58
|
-
# end
|
59
|
-
|
53
|
+
# def log_me(msg, opts={})
|
54
|
+
# debug_me({:tag => msg, :header => false}.merge(opts))
|
55
|
+
# end
|
60
56
|
end # module DebugMe
|
data/lib/debug_me/version.rb
CHANGED
data/rubygems.yml.asc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
-----BEGIN PGP MESSAGE-----
|
2
|
+
Version: GnuPG v1
|
3
|
+
|
4
|
+
hQEMA5qETcGag5w6AQgAmaiIITBNv5VUSyq32o7keQ2O64yFIYfwO8eBP8J3jNTt
|
5
|
+
CiejhbesdC+gLebBIakZ+NWPQSFAmfda+5kY0i4Ftty0jlCNt4sbGrh/O/WFrd/Z
|
6
|
+
7xmIcit8n+gETXDatRxOw6RPUyqz8U69vnwr+iFa2tuF/XjlbRoAH8RFlhzPqBlh
|
7
|
+
ad19FzQWuXehQvP/VK05K3+/mn2qay7ESEjWo6jidq8fp3HTklUJiwQ0HAuI7FLr
|
8
|
+
OEuGlIGLI2UGRLCZ+T3TSAF2QTNYgi+EscNpOI71dZmGSTudW+HhMk4uHPSffDax
|
9
|
+
ZlMAzRTBua6LNBjKQ7Iq2Xd8yR8SuHU9E/ZWfGBxFdLARQEU5QW82mQ8uxU8gSGu
|
10
|
+
kaB7hsK0aeSs2pu9AH9+CsQmjGC26b31helc8r1cy3nrW1esNZSeREUv7xRnUNae
|
11
|
+
gwqztLDFnSQC8QZGvbw2EBqqTEHhM825mGjzJxvZcI5pgwbcgO+K3NoJHWjslnPa
|
12
|
+
KdagjI3Mzhi+nPuUU75nnF95SJQGb00UdaTnYhw9zir7DYM5Wws+gtG5LBO7I1/i
|
13
|
+
3XMAE8uxDG61q8YOUNbbjWXqG4rysKXTHt67vcly35fNSjG4BdO0SL86lsolUZjI
|
14
|
+
zMfIeNOUkgOZNuwaRD1Z2xvzPQNProD+cbSpR9WpSu/3xL02MwkpFgtAnp9P9OC4
|
15
|
+
Hm0F9+IV0g==
|
16
|
+
=dpAM
|
17
|
+
-----END PGP MESSAGE-----
|
metadata
CHANGED
@@ -1,55 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Dewayne VanHoozer
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.7'
|
20
22
|
type: :development
|
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
29
|
version: '1.7'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rake
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '10.0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '10.0'
|
41
|
-
description:
|
42
|
-
|
46
|
+
description: ! 'This thing is pretty old. There are much better
|
47
|
+
|
43
48
|
ways of debugging in a complex application. But,
|
49
|
+
|
44
50
|
you know, I keep returning to this little method
|
45
|
-
|
51
|
+
|
52
|
+
time after time. I guess that marks me as a geezer.'
|
46
53
|
email:
|
47
54
|
- dvanhoozer@gmail.com
|
48
55
|
executables: []
|
49
56
|
extensions: []
|
50
57
|
extra_rdoc_files: []
|
51
58
|
files:
|
52
|
-
-
|
59
|
+
- .gitignore
|
60
|
+
- .rultor.yml
|
53
61
|
- Gemfile
|
54
62
|
- LICENSE.txt
|
55
63
|
- README.md
|
@@ -57,28 +65,30 @@ files:
|
|
57
65
|
- debug_me.gemspec
|
58
66
|
- lib/debug_me.rb
|
59
67
|
- lib/debug_me/version.rb
|
68
|
+
- rubygems.yml.asc
|
60
69
|
homepage: http://github.com/MadBomber/debug_me
|
61
70
|
licenses:
|
62
71
|
- You want it, its yours
|
63
|
-
metadata: {}
|
64
72
|
post_install_message:
|
65
73
|
rdoc_options: []
|
66
74
|
require_paths:
|
67
75
|
- lib
|
68
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
69
78
|
requirements:
|
70
|
-
- -
|
79
|
+
- - ! '>='
|
71
80
|
- !ruby/object:Gem::Version
|
72
81
|
version: '0'
|
73
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
74
84
|
requirements:
|
75
|
-
- -
|
85
|
+
- - ! '>='
|
76
86
|
- !ruby/object:Gem::Version
|
77
87
|
version: '0'
|
78
88
|
requirements: []
|
79
89
|
rubyforge_project:
|
80
|
-
rubygems_version:
|
90
|
+
rubygems_version: 1.8.23
|
81
91
|
signing_key:
|
82
|
-
specification_version:
|
92
|
+
specification_version: 3
|
83
93
|
summary: A tool to print the labeled value of variables.
|
84
94
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 910d8a6178916e6c0c6d19362e6eddfd7e5dc813
|
4
|
-
data.tar.gz: 0072112c8789c4a6417ebca895825ad4d81d9df8
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 803d7ae403786bf55cf5370721f9977d551c7f30d02930f4fdec015b32c0c23a5ea70abb54bade240cdba8e931037084b2ea9fa2e842e9c435437f4ae1f04784
|
7
|
-
data.tar.gz: 8373de00f006b6054b59d2cbb3c9a596f5da47eadb10db6f781b4b2f6ceafd5f64a6314322cb362116bc58dd76845c391d20996f957e18563e96b1335fabe959
|