linecache 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,35 +1,286 @@
1
- 2007-12-10 16:24 rockyb
1
+ 2008-03-04 22:47 Rocky Bernstein
2
+
3
+ * README: Ooops - forgot to credit Ryan Davis and ParseTree.
4
+
5
+ 2008-02-10 13:59 Rocky Bernstein
6
+
7
+ * ChangeLog, Rakefile, ext/trace_nums.c, ext/win32, svn2cl_usermap:
8
+ Go over Rakefile and doc for 0.3 release.
9
+
10
+ 2008-01-29 21:51 Rocky Bernstein
11
+
12
+ * test/test-linecache.rb: Interface change. Don't know why this
13
+ didn't get updated before.
14
+
15
+ 2008-01-28 15:35 Rocky Bernstein
16
+
17
+ * ChangeLog, lib/linecache.rb: Change line number return from a Set
18
+ to an Array.
19
+
20
+ 2008-01-27 11:24 Rocky Bernstein
21
+
22
+ * ext/trace_nums.c, ext/trace_nums.h, test/data/if5.rb: Handle
23
+ defined? node. Add "if" weirdness test.
24
+
25
+ 2008-01-27 04:26 Rocky Bernstein
26
+
27
+ * test/data/case5.rb: Verify that the 'else' doesn't appear in a
28
+ trace.
29
+
30
+ 2008-01-27 04:21 Rocky Bernstein
31
+
32
+ * ext/trace_nums.c, test/data/block1.rb, test/data/block2.rb,
33
+ test/data/case1.rb, test/data/case2.rb, test/data/case3.rb,
34
+ test/data/case4.rb, test/data/case5.rb, test/data/def1.rb,
35
+ test/data/each1.rb, test/data/for1.rb, test/data/if3.rb,
36
+ test/data/if4.rb, test/data/match3.rb, test/data/match3a.rb,
37
+ test/data/not-lit.rb: Was not showing blocks after when's.
38
+
39
+ 2008-01-27 04:03 Rocky Bernstein
40
+
41
+ * ext/trace_nums.c, test/data/block1.rb, test/data/block2.rb,
42
+ test/data/if4.rb, test/lnum-diag.rb: trace_nums.c, block1.c,
43
+ block2.c: bug in handling blocks
44
+ lnum-diag.rb: more graceful about not finding the source.
45
+ if4.rb: note weirdness in the way comparison works.
46
+
47
+ 2008-01-27 02:11 Rocky Bernstein
48
+
49
+ * ext/trace_nums.c, ext/trace_nums.h, test/data/case4.rb,
50
+ test/data/def1.rb, test/data/if3.rb, test/lnum-diag.rb: Finish
51
+ adding all tree nodes. Work on case nodes some more.
52
+ lnum-diag.rb: add options to turn on and off various parts.
53
+
54
+ 2008-01-26 11:12 Rocky Bernstein
55
+
56
+ * test/data/comments1.rb: Add comment test and situation where no
57
+ lines traced.
58
+
59
+ 2008-01-26 11:08 Rocky Bernstein
60
+
61
+ * ext/trace_nums.c, test/data/class1.rb: Add class, scope and
62
+ module nodes.
63
+
64
+ 2008-01-26 10:18 Rocky Bernstein
65
+
66
+ * ext/trace_nums.c, test/rcov-bug.rb, test/test-linecache.rb,
67
+ test/test-tracelines.rb: Add more tree nodes.
68
+
69
+ 2008-01-26 02:09 Rocky Bernstein
70
+
71
+ * test/data/each1.rb, test/data/for1.rb, test/data/if1.rb,
72
+ test/data/if2.rb, test/test-lnum.rb: Add Debugger.init which
73
+ intializes things that rdebug does. This
74
+ allows a restart even though rdebug wasn't called initially.
75
+
76
+ 2008-01-25 03:50 Rocky Bernstein
77
+
78
+ * ext/trace_nums.c: Some code cleanup.
79
+
80
+ 2008-01-25 02:50 Rocky Bernstein
81
+
82
+ * ext/trace_nums.c, test/data/case1.rb, test/data/case2.rb,
83
+ test/data/case3.rb, test/data/match3.rb, test/data/match3a.rb:
84
+ Work over case, when and match3.
85
+
86
+ 2008-01-25 00:17 Rocky Bernstein
87
+
88
+ * ext/trace_nums.c, test/data, test/lnum-data, test/lnum-diag.rb,
89
+ test/test-lnum.rb, test/test-tracelines.rb: Trace just line
90
+ numbers for now until we get a better handle on things.
91
+
92
+ 2008-01-24 13:36 Rocky Bernstein
93
+
94
+ * test/lnum-diag.rb, test/rcov-bug.rb, test/test-linecache.rb,
95
+ test/test-tracelines.rb: Need recursion in more places because of
96
+ block continuation nodes.
97
+ Add nodes needed so we don't complain about rcov-bug.rb:
98
+ NODE_MATCH3, NODE_LASN, and NODE_STR (and those similar to that).
99
+
100
+ 2008-01-24 04:09 Rocky Bernstein
101
+
102
+ * test/lnum-diag.rb: Fix bug if print_file == false
103
+
104
+ 2008-01-24 04:04 Rocky Bernstein
105
+
106
+ * ext/trace_nums.c, test/lnum-data/begin3.rb,
107
+ test/lnum-data/end.rb, test/lnum-data/match.rb,
108
+ test/lnum-data/not-lit.rb, test/lnum-diag.rb: Add more
109
+ operatiors. Go over existing ones and add more tests of them.
110
+
111
+ 2008-01-23 19:17 Rocky Bernstein
112
+
113
+ * NEWS: What's up.
114
+
115
+ 2008-01-23 19:12 Rocky Bernstein
116
+
117
+ * test/lnum-diag.rb: Don't assume we have expected line numbers.
118
+
119
+ 2008-01-23 19:05 Rocky Bernstein
120
+
121
+ * test/lnum-diag.rb: A conversion-error bug.
122
+
123
+ 2008-01-23 19:04 Rocky Bernstein
124
+
125
+ * test/lnum-diag.rb: variable name typo.
126
+
127
+ 2008-01-23 19:03 Rocky Bernstein
128
+
129
+ * ext, ext/trace_nums.c, test/lnum-diag.rb, test/parse-show.rb:
130
+ lnum-diag.rb and parse-show.rb - some diagnostic tools.
131
+
132
+ 2008-01-23 16:06 Rocky Bernstein
133
+
134
+ * ChangeLog, ext/trace_nums.c: Show add_lines level, nicer
135
+ formatting including \n for end.
136
+
137
+ 2008-01-23 15:32 Rocky Bernstein
138
+
139
+ * test/test-lnum.rb: Generalized routine to test everything in
140
+ lnum-data
141
+
142
+ 2008-01-23 12:07 Rocky Bernstein
143
+
144
+ * Rakefile, ext, ext/extconf.rb, ext/trace_nums.c,
145
+ ext/trace_nums.h, lib/linecache.rb, lib/tracelines.rb,
146
+ test/lnum-data, test/lnum-data/begin1.rb,
147
+ test/lnum-data/begin2.rb, test/lnum-data/begin3.rb,
148
+ test/test-tracelines.rb: ParseTree is broken for our purposes.
149
+ Having custom code for getting
150
+ the trace line numbers is going remove a lot of headaches down
151
+ the line.
152
+
153
+ 2008-01-20 21:37 Rocky Bernstein
154
+
155
+ * Rakefile, lib/linecache.rb, test/test-linecache.rb: Add
156
+ trace_line_numbers to save/get line numbers which we can set
157
+ breakpoints
158
+ on.
159
+
160
+ 2008-01-20 16:31 Rocky Bernstein
161
+
162
+ * ChangeLog, Rakefile, lib/linecache.rb, lib/tracelines.rb,
163
+ test/rcov-bug.rb, test/test-tracelines.rb: Add module
164
+ TraceLineNumbers for extracting the stoppable lines in a
165
+ Ruby program.
166
+
167
+ 2008-01-19 15:55 Rocky Bernstein
168
+
169
+ * lib/linecache.rb, test/test-linecache.rb: Allow nil to mean the
170
+ same file. More tests.
171
+
172
+ 2008-01-19 15:45 Rocky Bernstein
173
+
174
+ * lib/linecache.rb, test/test-linecache.rb: Start remap_file_lines:
175
+ ability to remap file ranges.
176
+
177
+ 2008-01-17 22:25 Rocky Bernstein
178
+
179
+ * lib/linecache.rb, test/test-linecache.rb: lines -> size. Add
180
+ empty? Add remap_file.
181
+
182
+ 2008-01-17 20:05 Rocky Bernstein
183
+
184
+ * lib/linecache.rb, test/test-linecache.rb: Add method to get the
185
+ number of lines in a cached file.
186
+
187
+ 2008-01-17 19:42 Rocky Bernstein
188
+
189
+ * lib/linecache.rb, test/short-file, test/test-linecache.rb: Add
190
+ convenience method for testing presence in SCRIPT_LINES__.
191
+
192
+ 2008-01-17 07:30 Rocky Bernstein
193
+
194
+ * lib/linecache.rb, test/test-linecache.rb: Add path method and
195
+ test.
196
+
197
+ 2008-01-17 06:54 Rocky Bernstein
198
+
199
+ * VERSION, lib/linecache.rb, test/test-linecache.rb: Add
200
+ @@full2file_cache_key. getlines wasn't returning the right value
201
+ sometimes.
202
+ Make return from checkcache meaningful. Change return value of
203
+ upate_cache().
204
+ test-linecache.rb: was testing for buggy behavior!
205
+ VERSION: now in 0.3 - hope we get it right this time.
206
+
207
+ 2008-01-16 12:51 Rocky Bernstein
208
+
209
+ * lib/linecache.rb: Add cached_files.
210
+
211
+ 2008-01-16 01:30 Rocky Bernstein
212
+
213
+ * NEWS: Update news for 0.2 release.
214
+
215
+ 2008-01-15 22:43 Rocky Bernstein
216
+
217
+ * test/test-linecache.rb: Remove debug line.
218
+
219
+ 2008-01-15 22:42 Rocky Bernstein
220
+
221
+ * lib/linecache.rb: Fix some syntax errors.
222
+
223
+ 2008-01-15 22:40 Rocky Bernstein
224
+
225
+ * Rakefile, lib/linecache.rb, test/short-file,
226
+ test/test-linecache.rb: Add routine to save and get SHA1.
227
+
228
+ 2008-01-15 22:16 Rocky Bernstein
229
+
230
+ * lib/linecache.rb, test/test-linecache.rb: Add cached? and stat
231
+ methods to determine in a file is cached and get
232
+ File.stat from it.
233
+
234
+ 2008-01-15 08:49 Rocky Bernstein
235
+
236
+ * lib/linecache.rb: Don't ever modify SCRIPT_LINES__. And until
237
+ SCRIPT_LINES__ is fixed,
238
+ don't read from it. Corrections to comments.
239
+
240
+ 2008-01-14 12:27 Rocky Bernstein
241
+
242
+ * ChangeLog, VERSION, lib/linecache.rb: Add parameter to getline
243
+ and getlines to reload file on change. Add
244
+ option on clear_file_cache to clear out SCRIPT_LINES__ as well.
245
+ TESTS ARE NEEDED.
246
+ Update to version 0.2.
247
+
248
+ 2008-01-14 03:41 Rocky Bernstein
249
+
250
+ * lib/linecache.rb: Use SCRIPT_LINES__ if we can.
251
+
252
+ 2007-12-10 16:24 Rocky Bernstein
2
253
 
3
254
  * linecache/linecache: release 0.1
4
255
 
5
- 2007-12-09 17:47 rockyb
256
+ 2007-12-09 17:47 Rocky Bernstein
6
257
 
7
258
  * linecache/trunk/lib/linecache.rb: Make Ruby 1.9 compatible.
8
259
 
9
- 2007-12-09 17:17 rockyb
260
+ 2007-12-09 17:17 Rocky Bernstein
10
261
 
11
262
  * linecache/trunk/ChangeLog, linecache/trunk/Rakefile,
12
263
  linecache/trunk/lib/linecache.rb,
13
264
  linecache/trunk/test/test-linecache.rb: Better tests mean more
14
265
  bugs found. "rake" defaults now to "test".
15
266
 
16
- 2007-12-09 14:10 rockyb
267
+ 2007-12-09 14:10 Rocky Bernstein
17
268
 
18
269
  * linecache/trunk/Rakefile: Add VERSION to gem.
19
270
 
20
- 2007-12-09 14:09 rockyb
271
+ 2007-12-09 14:09 Rocky Bernstein
21
272
 
22
273
  * linecache/trunk/test/test-linecache.rb: Change classname to
23
274
  something more appropriate.
24
275
 
25
- 2007-12-09 13:41 rockyb
276
+ 2007-12-09 13:41 Rocky Bernstein
26
277
 
27
278
  * linecache/trunk, linecache/trunk/Rakefile: . : ignore doc and pkg
28
279
  Rakefile: clean now does clobber_rdoc and clobber_package, i.e.
29
280
  removes
30
281
  the doc and pkg directories.
31
282
 
32
- 2007-12-09 13:15 rockyb
283
+ 2007-12-09 13:15 Rocky Bernstein
33
284
 
34
285
  * linecache/trunk/ChangeLog, linecache/trunk/NEWS,
35
286
  linecache/trunk/README, linecache/trunk/Rakefile,
@@ -39,7 +290,7 @@
39
290
  test-linecache.rb: make executable
40
291
  Rakefile: Correct documentation
41
292
 
42
- 2007-12-09 12:58 rockyb
293
+ 2007-12-09 12:58 Rocky Bernstein
43
294
 
44
295
  * linecache, linecache/trunk, linecache/trunk/AUTHORS,
45
296
  linecache/trunk/COPYING, linecache/trunk/ChangeLog,
data/NEWS CHANGED
@@ -1,9 +1,19 @@
1
+ 0.3
2
+ - Add tracelines: get line numbers that can be stopped at.
3
+
4
+ - Add routines to allow line-number
5
+ remapping and filename remapping.
6
+
7
+ - Add access methods to get the number of lines in a file.
8
+
1
9
  0.2
2
10
  - Make this work with ruby-debug-base. Add reload-on-change parameters.
3
11
  add checkcache, cache, cached? sha1, and stat methods.
4
12
 
13
+ - Use SCRIPT_LINES__.
14
+
5
15
  0.1
6
16
 
7
17
  - Initial release of LineCache, a module for reading and caching lines.
8
18
 
9
- $Id: NEWS 25 2008-01-16 01:30:13Z rockyb $
19
+ $Id: NEWS 43 2008-01-23 19:17:26Z rockyb $
data/README CHANGED
@@ -19,10 +19,13 @@
19
19
 
20
20
  This is a port of the module of the same name from the Python distribution.
21
21
 
22
+ The idea for how TraceLineNumbers works, and some code was taken
23
+ from ParseTree by Ryan Davis.
24
+
22
25
  == Other stuff
23
26
 
24
27
  Author:: Rocky Bernstein <rockyb@rubyforge.net>
25
- License:: Copyright (c) 2007 Rocky Bernstein
28
+ License:: Copyright (c) 2007, 2008 Rocky Bernstein
26
29
  Released under the GNU GPL 2 license
27
30
 
28
31
  == Warranty
@@ -32,4 +35,4 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
32
35
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33
36
  GNU General Public License for more details.
34
37
 
35
- $Id: README 4 2007-12-09 13:15:09Z rockyb $
38
+ $Id: README 63 2008-03-04 22:47:26Z rockyb $
data/Rakefile CHANGED
@@ -5,6 +5,8 @@ require 'rake/gempackagetask'
5
5
  require 'rake/rdoctask'
6
6
  require 'rake/testtask'
7
7
 
8
+ SO_NAME = "trace_nums.so"
9
+
8
10
  # ------- Default Package ----------
9
11
  PACKAGE_VERSION = open(File.join(File.dirname(__FILE__), 'VERSION')) do
10
12
  |f| f.readlines[0].chomp
@@ -18,6 +20,8 @@ FILES = FileList[
18
20
  'README',
19
21
  'Rakefile',
20
22
  'VERSION',
23
+ 'ext/trace_nums.*',
24
+ 'ext/extconf.rb',
21
25
  'lib/*.rb',
22
26
  'test/*.rb',
23
27
  'test/short-file'
@@ -26,18 +30,25 @@ FILES = FileList[
26
30
  desc "Test everything."
27
31
  test_task = task :test => :lib do
28
32
  Rake::TestTask.new(:test) do |t|
29
- t.libs << ['./lib']
30
33
  t.pattern = 'test/test-*.rb'
31
34
  t.verbose = true
32
35
  end
33
36
  end
34
37
 
38
+ desc "Create the core ruby-debug shared library extension"
39
+ task :lib do
40
+ Dir.chdir("ext") do
41
+ system("#{Gem.ruby} extconf.rb && make")
42
+ end
43
+ end
44
+
45
+
35
46
  desc "Test everything - same as test."
36
47
  task :check => :test
37
48
 
38
49
  desc "Create a GNU-style ChangeLog via svn2cl"
39
50
  task :ChangeLog do
40
- system("svn2cl")
51
+ system("svn2cl --authors=svn2cl_usermap")
41
52
  end
42
53
 
43
54
  # Base GEM Specification
@@ -65,7 +76,7 @@ EOF
65
76
 
66
77
  # rdoc
67
78
  spec.has_rdoc = true
68
- spec.extra_rdoc_files = ['README', 'lib/linecache.rb']
79
+ spec.extra_rdoc_files = ['README', 'lib/linecache.rb', 'lib/tracelines.rb']
69
80
  end
70
81
 
71
82
  # Rake task to build the default package
@@ -75,11 +86,34 @@ end
75
86
 
76
87
  task :default => [:test]
77
88
 
89
+ # Windows specification
90
+ win_spec = default_spec.clone
91
+ win_spec.extensions = []
92
+ win_spec.platform = Gem::Platform::WIN32
93
+ win_spec.files += ["lib/#{SO_NAME}"]
94
+
95
+ desc "Create Windows Gem"
96
+ task :win32_gem do
97
+ # Copy the win32 extension the top level directory.
98
+ current_dir = File.expand_path(File.dirname(__FILE__))
99
+ source = File.join(current_dir, "ext", "win32", SO_NAME)
100
+ target = File.join(current_dir, "lib", SO_NAME)
101
+ cp(source, target)
102
+
103
+ # Create the gem, then move it to pkg.
104
+ Gem::Builder.new(win_spec).build
105
+ gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
106
+ mv(gem_file, "pkg/#{gem_file}")
107
+
108
+ # Remove win extension from top level directory.
109
+ rm(target)
110
+ end
111
+
78
112
  desc "Publish linecache to RubyForge."
79
113
  task :publish do
80
114
  require 'rake/contrib/sshpublisher'
81
115
 
82
- # Get ruby-debug path
116
+ # Get ruby-debug path.
83
117
  ruby_debug_path = File.expand_path(File.dirname(__FILE__))
84
118
 
85
119
  publisher = Rake::SshDirPublisher.new("rockyb@rubyforge.org",
@@ -87,7 +121,16 @@ task :publish do
87
121
  end
88
122
 
89
123
  desc "Remove built files"
90
- task :clean => [:clobber_package, :clobber_rdoc]
124
+ task :clean => [:clobber_package, :clobber_rdoc] do
125
+ cd "ext" do
126
+ if File.exists?("Makefile")
127
+ sh "make clean"
128
+ rm "Makefile"
129
+ end
130
+ derived_files = Dir.glob(".o") + Dir.glob("*.so")
131
+ rm derived_files unless derived_files.empty?
132
+ end
133
+ end
91
134
 
92
135
  # --------- RDoc Documentation ------
93
136
  desc "Generate rdoc documentation"
@@ -98,6 +141,9 @@ Rake::RDocTask.new("rdoc") do |rdoc|
98
141
  rdoc.options << "--inline-source" << "--line-numbers"
99
142
  # Make the readme file the start page for the generated html
100
143
  rdoc.options << '--main' << 'README'
101
- rdoc.rdoc_files.include('lib/*.rb', 'README', 'COPYING')
144
+ rdoc.rdoc_files.include('ext/**/*.c',
145
+ 'lib/*.rb',
146
+ 'README',
147
+ 'COPYING')
102
148
  end
103
149