show 0.2.1 → 0.3.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/VERSION +1 -1
- data/lib/{analyze.rb → show.rb} +4 -4
- data/spec/go.rb +1 -1
- data/spec/{spec.analyze.rb → spec.show.rb} +9 -9
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/{analyze.rb → show.rb}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
|
-
require 'stringio' # fix sequence bug
|
2
|
-
require 'redparse'
|
1
|
+
require 'stringio' # fix a sequence 0.4.0 bug
|
2
|
+
require 'redparse'
|
3
3
|
|
4
4
|
class Object
|
5
|
-
def
|
5
|
+
def show *args
|
6
6
|
a = caller
|
7
7
|
last_caller = a[0]
|
8
8
|
if last_caller[1..1] == ":"
|
9
|
-
#
|
9
|
+
# might be like E:/dev/ruby/sane/spec/../lib/sane/require_relative.rb:9:in `require_relative'
|
10
10
|
drive, file, line, *rest = last_caller.split(":")
|
11
11
|
else
|
12
12
|
# or like
|
data/spec/go.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
show 3
|
@@ -1,17 +1,17 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'sane'
|
3
|
-
require_relative '../lib/
|
3
|
+
require_relative '../lib/show'
|
4
4
|
require 'spec/autorun'
|
5
5
|
|
6
|
-
describe "
|
6
|
+
describe "show off" do
|
7
7
|
|
8
8
|
before do
|
9
9
|
a = 3
|
10
10
|
b=4
|
11
|
-
@output =
|
11
|
+
@output = show a, b
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should
|
14
|
+
it "should show the args" do
|
15
15
|
assert @output.contain?( "a=")
|
16
16
|
assert @output.contain?( "b=")
|
17
17
|
end
|
@@ -29,7 +29,7 @@ describe "analyze" do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should retrieve call nodes for ya" do
|
32
|
-
for string in ["c =
|
32
|
+
for string in ["c = show a, b", "show a, b"] do
|
33
33
|
parser=RedParse.new(string)
|
34
34
|
tree = parser.parse
|
35
35
|
node = give_me_first_call_node tree
|
@@ -39,7 +39,7 @@ describe "analyze" do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "shouldn't barf with more complex things" do
|
42
|
-
output =
|
42
|
+
output = show 3, 4+5
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should work with longer dir names in 1.8" do
|
@@ -50,14 +50,14 @@ describe "analyze" do
|
|
50
50
|
|
51
51
|
it "should use inspect" do
|
52
52
|
a = [1,2,3]
|
53
|
-
out =
|
53
|
+
out = show a
|
54
54
|
assert out.contain? "[1, 2, 3]"
|
55
|
-
out =
|
55
|
+
out = show [1,2,3]
|
56
56
|
assert out.contain? "[1, 2, 3]"
|
57
57
|
end
|
58
58
|
|
59
59
|
it "should pretend to work in eval" do
|
60
|
-
out = eval("
|
60
|
+
out = eval("show 1,2,3")
|
61
61
|
assert(out.contain?('?='))
|
62
62
|
assert(out.contain?('eval'))
|
63
63
|
assert(out.contain?('1'))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: show
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Pack
|
@@ -54,9 +54,9 @@ files:
|
|
54
54
|
- README
|
55
55
|
- Rakefile
|
56
56
|
- VERSION
|
57
|
-
- lib/
|
57
|
+
- lib/show.rb
|
58
58
|
- spec/go.rb
|
59
|
-
- spec/spec.
|
59
|
+
- spec/spec.show.rb
|
60
60
|
- spec/sub/go2.rb
|
61
61
|
has_rdoc: true
|
62
62
|
homepage: http://github.com/rdp/show
|
@@ -88,5 +88,5 @@ specification_version: 3
|
|
88
88
|
summary: "ruby tool for quick debug print statements, like: show(a, b) (prints out '[spec.analyze.rb,9]: a=3, b=3')"
|
89
89
|
test_files:
|
90
90
|
- spec/go.rb
|
91
|
-
- spec/spec.
|
91
|
+
- spec/spec.show.rb
|
92
92
|
- spec/sub/go2.rb
|