display 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,10 +1,19 @@
1
+ require 'stringio' # fix sequence bug, I think
1
2
  require 'redparse' # takes forever on doze [ltodo]
2
3
 
3
4
  class Object
4
5
  def display *args
5
6
  a = caller
6
- last_caller = a[0] # "spec.analyze:9" # TODO work with full paths
7
- file, line, *rest = last_caller.split(":") # TODO cache shtuff
7
+ last_caller = a[0]
8
+ if last_caller[1..1] == ":"
9
+ # could be like E:/dev/ruby/sane/spec/../lib/sane/require_relative.rb:9:in `require_relative'
10
+ drive, file, line, *rest = last_caller.split(":")
11
+ else
12
+ # or like
13
+ # "spec.analyze:9"
14
+ file, line, *rest = last_caller.split(":")
15
+ end
16
+
8
17
  exact_line = File.readlines(file)[line.to_i - 1].strip
9
18
  parser=RedParse.new(exact_line)
10
19
  tree = parser.parse
@@ -0,0 +1 @@
1
+ display 3
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'sane'
2
3
  require_rel '../lib/display'
3
4
  require 'spec/autorun'
@@ -19,8 +20,8 @@ describe "display" do
19
20
  assert @output.contain?(", ")
20
21
  end
21
22
 
22
- it "should show linenumber too" do
23
- assert @output.contain?(",10")
23
+ it "should show linenumber too" do
24
+ assert @output.contain?(",11")
24
25
  end
25
26
 
26
27
  it "should retrieve call nodes for ya" do
@@ -36,5 +37,11 @@ describe "display" do
36
37
  it "shouldn't barf with more complex things" do
37
38
  output = display 3, 4+5
38
39
  end
40
+
41
+ it "should work with longer dir names in 1.8" do
42
+ require 'sub/go2'
43
+ end
44
+
45
+ it "should cache lines instead of rereading the file each time"
39
46
 
40
47
  end
@@ -0,0 +1 @@
1
+ require 'go.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: display
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-09 00:00:00 -07:00
12
+ date: 2010-01-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -55,7 +55,9 @@ files:
55
55
  - Rakefile
56
56
  - VERSION
57
57
  - lib/display.rb
58
+ - spec/go.rb
58
59
  - spec/spec.display.rb
60
+ - spec/sub/go2.rb
59
61
  has_rdoc: true
60
62
  homepage: http://github.com/rdp/display
61
63
  licenses: []
@@ -85,4 +87,6 @@ signing_key:
85
87
  specification_version: 3
86
88
  summary: "ruby tool for quick debug statements display a, b => 'spec.display,9: a=3, b=3' without any extra work from you"
87
89
  test_files:
90
+ - spec/go.rb
88
91
  - spec/spec.display.rb
92
+ - spec/sub/go2.rb