rbx-linecache 1.2-universal-rubinius-1.2 → 1.4-universal-rubinius-1.2

Sign up to get free protection for your applications and to get access to all the features.
data/test/data/block1.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [2, 2, 3, 4, 6]
1
+ # [0, 0, 2, 2, 3, 4, 6]
2
2
  if true
3
3
  puts '3'
4
4
  puts '4'
data/test/data/case1.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2, 2, 3, 4, 6, 6 ]
1
+ # [ 0, 2, 2, 3, 4, 6, 6 ]
2
2
  case 2
3
3
  when 3
4
4
  when 4
data/test/data/case2.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 3, 4, 5, 5 ]
1
+ # [ 0, 3, 4, 5, 5 ]
2
2
  case
3
3
  when 3 != 3
4
4
  when 4 != 4
data/test/data/case3.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [2, 2, 3, 4, 5, 5]
1
+ # [0, 2, 2, 3, 4, 5, 5]
2
2
  case "2"
3
3
  when Array
4
4
  when Fixnum
data/test/data/case4.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [2, 2, 3, 4]
1
+ # [0, 2, 2, 3, 4]
2
2
  case "2"
3
3
  when Array, Fixnum
4
4
  end
data/test/data/case5.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [3, 4, 5, 6, 7, 9]
1
+ # [0, 3, 4, 5, 6, 7, 9]
2
2
  # Note: lines 5 and 7 won't appear in a trace.
3
3
  case '3'
4
4
  when '4'
data/test/data/if1.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2 ]
1
+ # [ 2, 2 ]
2
2
  x = true ? 1 : 2
3
3
 
4
4
 
data/test/data/if2.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2 ]
1
+ # [ 0, 2 ]
2
2
  x = 2 if false
3
3
 
4
4
 
data/test/data/if3.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2, 3, 4, 4, 5, 6]
1
+ # [ 0, 2, 3, 4, 4, 5, 6]
2
2
  lines = ''
3
3
  opts = {:print_source => true}
4
4
  if opts[:print_source]
data/test/data/if4.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 6, 6, 7, 8, 10]
1
+ # [ 0, 6, 6, 7, 8, 10]
2
2
 
3
3
  # Running through Tracer will not give the line numbers in the same
4
4
  # order. Also note 9 before 7. This is because in the parse tree
data/test/data/if5.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [2, 3, 3, 4, 4]
1
+ # [0, 2, 3, 3, 4, 4]
2
2
  x=2
3
3
  x=3 if x='a' or
4
4
  false
data/test/data/if6.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2 ]
1
+ # [ 0, 2 ]
2
2
  x = 2 if x=3
3
3
 
4
4
 
data/test/data/if7.rb CHANGED
@@ -1,4 +1,4 @@
1
- # [ 2, 2, 3, 4, 6 ]
1
+ # [ 0, 2, 2, 3, 4, 6 ]
2
2
  def f()
3
3
  y=1
4
4
  true
@@ -9,30 +9,30 @@ class TestLineCache < Test::Unit::TestCase
9
9
  @@TEST_DIR = File.expand_path(File.dirname(__FILE__))
10
10
  @@TOP_SRC_DIR = File.join(@@TEST_DIR, '..', 'lib')
11
11
  require File.join(@@TOP_SRC_DIR, 'linecache.rb')
12
-
12
+
13
13
  def setup
14
14
  LineCache::clear_file_cache
15
15
  end
16
-
16
+
17
17
  def test_basic
18
18
  fp = File.open(__FILE__, 'r')
19
19
  compare_lines = fp.readlines()
20
20
  fp.close
21
-
21
+
22
22
  # Test getlines to read this file.
23
23
  lines = LineCache::getlines(__FILE__)
24
24
  assert_equal(compare_lines, lines,
25
25
  'We should get exactly the same lines as reading this file.')
26
-
26
+
27
27
  # Test getline to read this file. The file should now be cached,
28
28
  # so internally a different set of routines are used.
29
29
  test_line = 1
30
30
  line = LineCache::getline(__FILE__, test_line)
31
31
  assert_equal(compare_lines[test_line-1], line,
32
32
  'We should get exactly the same line as reading this file.')
33
-
33
+
34
34
  # Test getting the line via a relative file name
35
- Dir.chdir(File.dirname(__FILE__)) do
35
+ Dir.chdir(File.dirname(__FILE__)) do
36
36
  short_file = File.basename(__FILE__)
37
37
  test_line = 10
38
38
  line = LineCache::getline(short_file, test_line)
@@ -73,7 +73,7 @@ class TestLineCache < Test::Unit::TestCase
73
73
  assert_equal(false, LineCache::cached_script?('./short-file'),
74
74
  "Should not find './short-file' in SCRIPT_LINES__")
75
75
  assert_equal(true, 78 < LineCache.size(__FILE__))
76
- # Dir.chdir(File.dirname(__FILE__)) do
76
+ # Dir.chdir(File.dirname(__FILE__)) do
77
77
  # load('./short-file', 0)
78
78
  # assert_equal(true, LineCache::cached_script?('./short-file'),
79
79
  # "Should be able to find './short-file' in SCRIPT_LINES__")
@@ -93,23 +93,23 @@ class TestLineCache < Test::Unit::TestCase
93
93
  line5 = LineCache::getline(__FILE__, 5)
94
94
  LineCache::remap_file_lines(__FILE__, 'test2', 9, 5)
95
95
  rline9 = LineCache::getline('test2', 9)
96
- assert_equal(line5, rline9,
96
+ assert_equal(line5, rline9,
97
97
  'lines should be the same via remap_file_line - remap integer')
98
98
 
99
99
  line6 = LineCache::getline(__FILE__, 6)
100
100
  rline10 = LineCache::getline('test2', 10)
101
- assert_equal(line6, rline10,
101
+ assert_equal(line6, rline10,
102
102
  'lines should be the same via remap_file_line - range')
103
103
 
104
104
  line7 = LineCache::getline(__FILE__, 7)
105
105
  rline11 = LineCache::getline('test2', 11)
106
- assert_equal(line7, rline11,
106
+ assert_equal(line7, rline11,
107
107
  'lines should be the same via remap_file_line - range')
108
108
 
109
109
  line8 = LineCache::getline(__FILE__, 8)
110
110
  LineCache::remap_file_lines(__FILE__, nil, 20, 8)
111
111
  rline20 = LineCache::getline(__FILE__, 20)
112
- assert_equal(line8, rline20,
112
+ assert_equal(line8, rline20,
113
113
  'lines should be the same via remap_file_line - nil file')
114
114
  end
115
115
 
@@ -142,7 +142,7 @@ class TestLineCache < Test::Unit::TestCase
142
142
  end
143
143
 
144
144
  def test_sha1
145
- test_file = File.join(@@TEST_DIR, 'short-file')
145
+ test_file = File.join(@@TEST_DIR, 'short-file')
146
146
  LineCache::cache(test_file)
147
147
  assert_equal('3e1d87f3399fc73ae5683e106bce1b5ba823fc50',
148
148
  LineCache::sha1(test_file))
@@ -152,12 +152,12 @@ class TestLineCache < Test::Unit::TestCase
152
152
  x = nil
153
153
  line1 = "loc = Rubinius::VM::backtrace(0)[0]"
154
154
  eval(line1 + "
155
- x = LineCache::getline(loc.static_scope.script, 1)")
155
+ x = LineCache::getline(loc.constant_scope.script, 1)")
156
156
  assert_equal(line1, x)
157
157
  eval("loc = Rubinius::VM::backtrace(0)[0]
158
- assert_equal(2, LineCache::size(loc.static_scope.script))")
158
+ assert_equal(2, LineCache::size(loc.constant_scope.script))")
159
159
  string = "loc = Rubinius::VM::backtrace(0)[0]
160
- LineCache::map_script(loc.static_scope.script)"
160
+ LineCache::map_script(loc.constant_scope.script)"
161
161
  temp_filename = eval(string)
162
162
  got_lines = File.open(temp_filename).readlines.join('')
163
163
  assert_equal(string, got_lines.chomp)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: test-tracelines.rb 235 2010-12-25 14:22:47Z rockyb $
2
+ # $Id$
3
3
  require 'test/unit'
4
4
  require 'fileutils'
5
5
  require 'tempfile'
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbx-linecache
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 728101489
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
9
- version: "1.2"
8
+ - 4
9
+ version: "1.4"
10
10
  platform: universal-rubinius-1.2
11
11
  authors:
12
12
  - R. Bernstein
@@ -14,8 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-15 00:00:00 -04:00
18
- default_executable:
17
+ date: 2013-07-11 00:00:00 Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: rbx-require-relative
@@ -25,7 +24,7 @@ dependencies:
25
24
  requirements:
26
25
  - - ">="
27
26
  - !ruby/object:Gem::Version
28
- hash: 3
27
+ hash: 881230260
29
28
  segments:
30
29
  - 0
31
30
  version: "0"
@@ -55,84 +54,81 @@ files:
55
54
  - NEWS
56
55
  - README
57
56
  - Rakefile
58
- - lib/tracelines.rb
59
57
  - lib/linecache.rb
60
- - test/parse-show.rb
58
+ - lib/tracelines.rb
61
59
  - test/lnum-diag.rb
60
+ - test/parse-show.rb
62
61
  - test/rcov-bug.rb
63
- - test/test-lnum.rb
64
62
  - test/test-linecache.rb
63
+ - test/test-lnum.rb
65
64
  - test/test-tracelines.rb
66
- - test/data/if1.rb
67
- - test/data/comments1.rb
68
- - test/data/not-lit.rb
65
+ - test/data/begin1.rb
69
66
  - test/data/begin2.rb
67
+ - test/data/begin3.rb
68
+ - test/data/block1.rb
70
69
  - test/data/block2.rb
71
- - test/data/if6.rb
72
- - test/data/end.rb
70
+ - test/data/case1.rb
71
+ - test/data/case2.rb
72
+ - test/data/case3.rb
73
73
  - test/data/case4.rb
74
- - test/data/begin1.rb
75
- - test/data/for1.rb
76
- - test/data/match.rb
77
- - test/data/match3a.rb
74
+ - test/data/case5.rb
78
75
  - test/data/class1.rb
79
- - test/data/if3.rb
80
- - test/data/if5.rb
81
- - test/data/case1.rb
76
+ - test/data/comments1.rb
82
77
  - test/data/def1.rb
83
- - test/data/if7.rb
84
- - test/data/block1.rb
85
- - test/data/begin3.rb
86
- - test/data/case3.rb
87
- - test/data/case2.rb
88
78
  - test/data/each1.rb
79
+ - test/data/end.rb
80
+ - test/data/for1.rb
81
+ - test/data/if1.rb
89
82
  - test/data/if2.rb
90
- - test/data/match3.rb
83
+ - test/data/if3.rb
91
84
  - test/data/if4.rb
92
- - test/data/case5.rb
85
+ - test/data/if5.rb
86
+ - test/data/if6.rb
87
+ - test/data/if7.rb
88
+ - test/data/match.rb
89
+ - test/data/match3.rb
90
+ - test/data/match3a.rb
91
+ - test/data/not-lit.rb
93
92
  - test/short-file
94
93
  - test/short-file2
95
- has_rdoc: true
96
- homepage: http://wiki.github.com/rocky/rbx-trepanning
94
+ homepage: http://rubyforge.org/projects/rocky-hacks/linecache
97
95
  licenses:
98
96
  - MIT
99
97
  post_install_message:
100
98
  rdoc_options:
101
99
  - --title
102
- - LineCache 1.2 Documentation
100
+ - LineCache 1.4 Documentation
103
101
  require_paths:
104
102
  - lib
105
103
  required_ruby_version: !ruby/object:Gem::Requirement
106
104
  none: false
107
105
  requirements:
108
- - - ~>
106
+ - - ">="
109
107
  - !ruby/object:Gem::Version
110
- hash: 57
108
+ hash: 881230260
111
109
  segments:
112
- - 1
113
- - 8
114
- - 7
115
- version: 1.8.7
110
+ - 0
111
+ version: "0"
116
112
  required_rubygems_version: !ruby/object:Gem::Requirement
117
113
  none: false
118
114
  requirements:
119
115
  - - ">="
120
116
  - !ruby/object:Gem::Version
121
- hash: 3
117
+ hash: 881230260
122
118
  segments:
123
119
  - 0
124
120
  version: "0"
125
121
  requirements: []
126
122
 
127
123
  rubyforge_project: rocky-hacks
128
- rubygems_version: 1.5.2
124
+ rubygems_version: 1.8.25
129
125
  signing_key:
130
126
  specification_version: 3
131
- summary: Read file with caching
127
+ summary: Module to read and cache Ruby program files and file information
132
128
  test_files:
133
- - test/parse-show.rb
134
129
  - test/lnum-diag.rb
130
+ - test/parse-show.rb
135
131
  - test/rcov-bug.rb
136
- - test/test-lnum.rb
137
132
  - test/test-linecache.rb
133
+ - test/test-lnum.rb
138
134
  - test/test-tracelines.rb