debugger-linecache 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +2 -0
- data/COPYING +340 -0
- data/ChangeLog +68 -0
- data/NEWS +32 -0
- data/OLD_README +50 -0
- data/README.md +5 -0
- data/Rakefile +169 -0
- data/VERSION +1 -0
- data/debugger-linecache.gemspec +19 -0
- data/ext/trace_nums/extconf.rb +26 -0
- data/ext/trace_nums/trace_nums.c +105 -0
- data/ext/trace_nums/trace_nums.h +111 -0
- data/lib/linecache19.rb +412 -0
- data/lib/tracelines19.rb +47 -0
- data/svn2cl_usermap +1 -0
- data/test/data/begin1.rb +3 -0
- data/test/data/begin2.rb +3 -0
- data/test/data/begin3.rb +6 -0
- data/test/data/block1.rb +7 -0
- data/test/data/block2.rb +4 -0
- data/test/data/case1.rb +6 -0
- data/test/data/case2.rb +5 -0
- data/test/data/case3.rb +5 -0
- data/test/data/case4.rb +4 -0
- data/test/data/case5.rb +10 -0
- data/test/data/class1.rb +5 -0
- data/test/data/comments1.rb +6 -0
- data/test/data/def1.rb +9 -0
- data/test/data/each1.rb +3 -0
- data/test/data/end.rb +3 -0
- data/test/data/for1.rb +4 -0
- data/test/data/if1.rb +4 -0
- data/test/data/if2.rb +4 -0
- data/test/data/if3.rb +9 -0
- data/test/data/if4.rb +14 -0
- data/test/data/if5.rb +7 -0
- data/test/data/if6.rb +4 -0
- data/test/data/if7.rb +8 -0
- data/test/data/match.rb +3 -0
- data/test/data/match3.rb +5 -0
- data/test/data/match3a.rb +6 -0
- data/test/data/not-lit.rb +6 -0
- data/test/lnum-diag.rb +130 -0
- data/test/parse-show.rb +14 -0
- data/test/rcov-bug.rb +10 -0
- data/test/short-file +2 -0
- data/test/test-linecache.rb +151 -0
- data/test/test-lnum.rb +36 -0
- data/test/test-tracelines.rb +41 -0
- metadata +118 -0
data/test/test-lnum.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# $Id$
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
# require 'rubygems'
|
6
|
+
# require 'ruby-debug'; Debugger.init
|
7
|
+
|
8
|
+
# Test TraceLineNumbers module
|
9
|
+
class TestLineNumbers2 < Test::Unit::TestCase
|
10
|
+
@@TEST_DIR = File.expand_path(File.dirname(__FILE__))
|
11
|
+
@@TOP_SRC_DIR = File.join(@@TEST_DIR, '..')
|
12
|
+
require File.join(@@TOP_SRC_DIR, 'lib', 'tracelines19.rb')
|
13
|
+
|
14
|
+
def test_all_lnum_data
|
15
|
+
test_dir = File.join(@@TEST_DIR, 'data')
|
16
|
+
Dir.chdir(test_dir) do
|
17
|
+
Dir.glob('*.rb').sort.each do |f|
|
18
|
+
puts f
|
19
|
+
fp = File.open(f, 'r')
|
20
|
+
lines = fp.read
|
21
|
+
fp.rewind
|
22
|
+
first_line = fp.readline.chomp
|
23
|
+
fp.close()
|
24
|
+
expected_str = first_line[1..-1]
|
25
|
+
begin
|
26
|
+
expected_lnums = eval(expected_str, binding, __FILE__, __LINE__)
|
27
|
+
rescue
|
28
|
+
assert nil, "Failed reading expected values from #{f}"
|
29
|
+
else
|
30
|
+
got_lnums = TraceLineNumbers.lnums_for_str(lines)
|
31
|
+
assert_equal(expected_lnums, got_lnums)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# $Id$
|
3
|
+
require 'test/unit'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'tempfile'
|
6
|
+
|
7
|
+
# require 'rubygems'
|
8
|
+
# require 'ruby-debug'; Debugger.init
|
9
|
+
|
10
|
+
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
|
11
|
+
# Test TestLineNumbers module
|
12
|
+
class TestLineNumbers1 < Test::Unit::TestCase
|
13
|
+
|
14
|
+
@@TEST_DIR = File.expand_path(File.dirname(__FILE__))
|
15
|
+
@@TOP_SRC_DIR = File.join(@@TEST_DIR, '..', 'lib')
|
16
|
+
require File.join(@@TOP_SRC_DIR, 'tracelines19.rb')
|
17
|
+
|
18
|
+
@@rcov_file = File.join(@@TEST_DIR, 'rcov-bug.rb')
|
19
|
+
File.open(@@rcov_file, 'r') {|fp|
|
20
|
+
first_line = fp.readline[1..-2]
|
21
|
+
@@rcov_lnums = eval(first_line, binding, __FILE__, __LINE__)
|
22
|
+
}
|
23
|
+
|
24
|
+
def test_for_file
|
25
|
+
rcov_lines = TraceLineNumbers.lnums_for_file(@@rcov_file)
|
26
|
+
assert_equal(@@rcov_lnums, rcov_lines)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_for_string
|
30
|
+
string = "# Some rcov bugs.\nz = \"\nNow is the time\n\"\n\nz =~ \n /\n 5\n /ix\n"
|
31
|
+
rcov_lines = TraceLineNumbers.lnums_for_str(string)
|
32
|
+
assert_equal([2, 9], rcov_lines)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_for_string_array
|
36
|
+
load(@@rcov_file, 0)
|
37
|
+
rcov_lines =
|
38
|
+
TraceLineNumbers.lnums_for_str_array(SCRIPT_LINES__[@@rcov_file])
|
39
|
+
assert_equal(@@rcov_lnums, rcov_lines)
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: debugger-linecache
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- R. Bernstein
|
9
|
+
- Mark Moseley
|
10
|
+
- Gabriel Horner
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2012-03-30 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: ruby_core_source
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.1.5
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 0.1.5
|
32
|
+
description: ! 'Linecache is a module for reading and caching lines. This may be useful
|
33
|
+
for
|
34
|
+
|
35
|
+
example in a debugger where the same lines are shown many times.
|
36
|
+
|
37
|
+
'
|
38
|
+
email: gabriel.horner@gmail.com
|
39
|
+
executables: []
|
40
|
+
extensions:
|
41
|
+
- ext/trace_nums/extconf.rb
|
42
|
+
extra_rdoc_files:
|
43
|
+
- README.md
|
44
|
+
files:
|
45
|
+
- AUTHORS
|
46
|
+
- COPYING
|
47
|
+
- ChangeLog
|
48
|
+
- NEWS
|
49
|
+
- OLD_README
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- VERSION
|
53
|
+
- debugger-linecache.gemspec
|
54
|
+
- ext/trace_nums/extconf.rb
|
55
|
+
- ext/trace_nums/trace_nums.c
|
56
|
+
- ext/trace_nums/trace_nums.h
|
57
|
+
- lib/linecache19.rb
|
58
|
+
- lib/tracelines19.rb
|
59
|
+
- svn2cl_usermap
|
60
|
+
- test/data/begin1.rb
|
61
|
+
- test/data/begin2.rb
|
62
|
+
- test/data/begin3.rb
|
63
|
+
- test/data/block1.rb
|
64
|
+
- test/data/block2.rb
|
65
|
+
- test/data/case1.rb
|
66
|
+
- test/data/case2.rb
|
67
|
+
- test/data/case3.rb
|
68
|
+
- test/data/case4.rb
|
69
|
+
- test/data/case5.rb
|
70
|
+
- test/data/class1.rb
|
71
|
+
- test/data/comments1.rb
|
72
|
+
- test/data/def1.rb
|
73
|
+
- test/data/each1.rb
|
74
|
+
- test/data/end.rb
|
75
|
+
- test/data/for1.rb
|
76
|
+
- test/data/if1.rb
|
77
|
+
- test/data/if2.rb
|
78
|
+
- test/data/if3.rb
|
79
|
+
- test/data/if4.rb
|
80
|
+
- test/data/if5.rb
|
81
|
+
- test/data/if6.rb
|
82
|
+
- test/data/if7.rb
|
83
|
+
- test/data/match.rb
|
84
|
+
- test/data/match3.rb
|
85
|
+
- test/data/match3a.rb
|
86
|
+
- test/data/not-lit.rb
|
87
|
+
- test/lnum-diag.rb
|
88
|
+
- test/parse-show.rb
|
89
|
+
- test/rcov-bug.rb
|
90
|
+
- test/short-file
|
91
|
+
- test/test-linecache.rb
|
92
|
+
- test/test-lnum.rb
|
93
|
+
- test/test-tracelines.rb
|
94
|
+
homepage: http://github.com/cldwalker/debugger-linecache
|
95
|
+
licenses: []
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ! '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.3.6
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 1.8.19
|
115
|
+
signing_key:
|
116
|
+
specification_version: 3
|
117
|
+
summary: Read file with caching
|
118
|
+
test_files: []
|