debugger-linecache 1.0.1 → 1.1.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/.travis.yml +5 -0
- data/{NEWS → CHANGELOG.md} +14 -2
- data/LICENSE.txt +22 -0
- data/{ChangeLog → OLD_CHANGELOG} +0 -0
- data/README.md +14 -3
- data/Rakefile +8 -106
- data/debugger-linecache.gemspec +2 -0
- data/ext/trace_nums/extconf.rb +6 -17
- data/ext/trace_nums/trace_nums.c +1 -1
- data/lib/debugger/linecache.rb +1 -1
- data/lib/linecache19.rb +39 -41
- data/lib/tracelines19.rb +5 -14
- data/test/lnum-diag.rb +5 -8
- data/test/parse-show.rb +0 -1
- data/test/test-linecache.rb +12 -15
- data/test/test-lnum.rb +2 -5
- data/test/test-tracelines.rb +3 -6
- metadata +39 -9
- data/AUTHORS +0 -2
- data/COPYING +0 -340
- data/VERSION +0 -1
- data/svn2cl_usermap +0 -1
data/.travis.yml
ADDED
data/{NEWS → CHANGELOG.md}
RENAMED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 1.1.0
|
2
|
+
* Point to new debugger-ruby_core_source API
|
3
|
+
* rename trace_nums19 ext to trace_nums
|
4
|
+
* Renable Rakefile and tests
|
5
|
+
* General cleanup
|
6
|
+
|
7
|
+
## 1.0.1
|
8
|
+
* Point to debugger-ruby_core_source as dependency
|
9
|
+
|
10
|
+
## 1.0.0
|
11
|
+
* Initial release - fork and release latest linecache
|
12
|
+
|
13
|
+
## From previous gem's NEWS file
|
14
|
+
|
1
15
|
0.5 (7/23/09)
|
2
16
|
- updated for Ruby 1.9
|
3
17
|
|
@@ -28,5 +42,3 @@
|
|
28
42
|
0.1
|
29
43
|
|
30
44
|
- Initial release of LineCache, a module for reading and caching lines.
|
31
|
-
|
32
|
-
$Id$
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT LICENSE
|
2
|
+
|
3
|
+
Copyright (c) 2012 Gabriel Horner
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/{ChangeLog → OLD_CHANGELOG}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
|
-
Description
|
2
|
-
===========
|
1
|
+
## Description
|
3
2
|
Fork of linecache for [debugger](http://github.com/cldwalker/debugger)
|
3
|
+
For more info see OLD\_README.
|
4
4
|
|
5
|
-
|
5
|
+
[](http://travis-ci.org/cldwalker/debugger-linecache)
|
6
|
+
|
7
|
+
## Credits
|
8
|
+
|
9
|
+
* Original authors: R. Bernstein, Mark Moseley
|
10
|
+
|
11
|
+
## TODO
|
12
|
+
* Fix todo test
|
13
|
+
|
14
|
+
## LICENSE
|
15
|
+
|
16
|
+
Original library was under gnu. This fork is licensed under MIT.
|
data/Rakefile
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
1
|
# -*- Ruby -*-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'rake/gempackagetask'
|
5
|
-
require 'rake/rdoctask'
|
2
|
+
require 'rubygems/package_task'
|
6
3
|
require 'rake/testtask'
|
7
4
|
require 'rake/extensiontask'
|
8
5
|
|
@@ -10,36 +7,11 @@ Rake::ExtensionTask.new('trace_nums')
|
|
10
7
|
|
11
8
|
SO_NAME = "trace_nums.so"
|
12
9
|
|
13
|
-
# ------- Default Package ----------
|
14
|
-
PKG_VERSION = open(File.join(File.dirname(__FILE__), 'VERSION')) do
|
15
|
-
|f| f.readlines[0].chomp
|
16
|
-
end
|
17
|
-
PKG_NAME = 'linecache'
|
18
|
-
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
19
|
-
RUBY_FORGE_PROJECT = 'rocky-hacks'
|
20
|
-
RUBY_FORGE_USER = 'rockyb'
|
21
|
-
|
22
|
-
FILES = FileList[
|
23
|
-
'AUTHORS',
|
24
|
-
'COPYING',
|
25
|
-
'ChangeLog',
|
26
|
-
'NEWS',
|
27
|
-
'README',
|
28
|
-
'Rakefile',
|
29
|
-
'VERSION',
|
30
|
-
'ext/trace_nums.c',
|
31
|
-
'ext/trace_nums.h',
|
32
|
-
'ext/extconf.rb',
|
33
|
-
'lib/*.rb',
|
34
|
-
'test/*.rb',
|
35
|
-
'test/data/*.rb',
|
36
|
-
'test/short-file'
|
37
|
-
]
|
38
|
-
|
39
10
|
desc "Test everything."
|
40
|
-
test_task = task :test => :lib do
|
11
|
+
test_task = task :test => :lib do
|
41
12
|
Rake::TestTask.new(:test) do |t|
|
42
|
-
|
13
|
+
# TODO: fix test-lnum
|
14
|
+
t.test_files = Dir['test/test-*.rb'] - ['test/test-lnum.rb']
|
43
15
|
t.verbose = true
|
44
16
|
end
|
45
17
|
end
|
@@ -51,55 +23,17 @@ task :lib do
|
|
51
23
|
end
|
52
24
|
end
|
53
25
|
|
54
|
-
|
55
26
|
desc "Test everything - same as test."
|
56
27
|
task :check => :test
|
57
28
|
|
58
|
-
|
59
|
-
task :ChangeLog do
|
60
|
-
system("svn2cl --authors=svn2cl_usermap")
|
61
|
-
end
|
62
|
-
|
63
|
-
# Base GEM Specification
|
64
|
-
default_spec = Gem::Specification.new do |spec|
|
65
|
-
spec.name = "linecache"
|
66
|
-
|
67
|
-
spec.homepage = "http://rubyforge.org/projects/rocky-hacks/linecache"
|
68
|
-
spec.summary = "Read file with caching"
|
69
|
-
spec.description = <<-EOF
|
70
|
-
LineCache is a module for reading and caching lines. This may be useful for
|
71
|
-
example in a debugger where the same lines are shown many times.
|
72
|
-
EOF
|
73
|
-
|
74
|
-
spec.version = PKG_VERSION
|
75
|
-
|
76
|
-
spec.author = "R. Bernstein"
|
77
|
-
spec.email = "rockyb@rubyforge.net"
|
78
|
-
spec.platform = Gem::Platform::RUBY
|
79
|
-
spec.require_path = "lib"
|
80
|
-
spec.files = FILES.to_a
|
81
|
-
spec.extensions = ["ext/extconf.rb"]
|
82
|
-
|
83
|
-
spec.required_ruby_version = '>= 1.8.2'
|
84
|
-
spec.date = Time.now
|
85
|
-
spec.rubyforge_project = 'rocky-hacks'
|
86
|
-
|
87
|
-
# rdoc
|
88
|
-
spec.has_rdoc = true
|
89
|
-
spec.extra_rdoc_files = ['README', 'lib/linecache.rb', 'lib/tracelines.rb']
|
90
|
-
|
91
|
-
spec.test_files = FileList['test/*.rb']
|
92
|
-
end
|
29
|
+
base_spec = eval(File.read('debugger-linecache.gemspec'), binding, 'debugger-linecache.gemspec')
|
93
30
|
|
94
|
-
|
95
|
-
Rake::GemPackageTask.new(default_spec) do |pkg|
|
31
|
+
Gem::PackageTask.new(base_spec) do |pkg|
|
96
32
|
pkg.need_tar = true
|
97
33
|
end
|
98
34
|
|
99
|
-
task :default => [:test]
|
100
|
-
|
101
35
|
# Windows specification
|
102
|
-
win_spec =
|
36
|
+
win_spec = base_spec.clone
|
103
37
|
win_spec.extensions = []
|
104
38
|
## win_spec.platform = Gem::Platform::WIN32 # deprecated
|
105
39
|
win_spec.platform = 'mswin32'
|
@@ -122,17 +56,6 @@ task :win32_gem do
|
|
122
56
|
rm(target)
|
123
57
|
end
|
124
58
|
|
125
|
-
desc "Publish linecache to RubyForge."
|
126
|
-
task :publish do
|
127
|
-
require 'rake/contrib/sshpublisher'
|
128
|
-
|
129
|
-
# Get ruby-debug path.
|
130
|
-
ruby_debug_path = File.expand_path(File.dirname(__FILE__))
|
131
|
-
|
132
|
-
publisher = Rake::SshDirPublisher.new("rockyb@rubyforge.org",
|
133
|
-
"/var/www/gforge-projects/rocky-hacks/linecache", ruby_debug_path)
|
134
|
-
end
|
135
|
-
|
136
59
|
desc "Remove built files"
|
137
60
|
task :clean => [:clobber_package, :clobber_rdoc] do
|
138
61
|
cd "ext" do
|
@@ -145,25 +68,4 @@ task :clean => [:clobber_package, :clobber_rdoc] do
|
|
145
68
|
end
|
146
69
|
end
|
147
70
|
|
148
|
-
|
149
|
-
desc "Generate rdoc documentation"
|
150
|
-
Rake::RDocTask.new("rdoc") do |rdoc|
|
151
|
-
rdoc.rdoc_dir = 'doc'
|
152
|
-
rdoc.title = "linecache"
|
153
|
-
# Show source inline with line numbers
|
154
|
-
rdoc.options << "--inline-source" << "--line-numbers"
|
155
|
-
# Make the readme file the start page for the generated html
|
156
|
-
rdoc.options << '--main' << 'README'
|
157
|
-
rdoc.rdoc_files.include('ext/**/*.c',
|
158
|
-
'lib/*.rb',
|
159
|
-
'README',
|
160
|
-
'COPYING')
|
161
|
-
end
|
162
|
-
|
163
|
-
desc "Publish the release files to RubyForge."
|
164
|
-
task :rubyforge_upload do
|
165
|
-
`rubyforge login`
|
166
|
-
release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
|
167
|
-
puts release_command
|
168
|
-
system(release_command)
|
169
|
-
end
|
71
|
+
task :default => [:test]
|
data/debugger-linecache.gemspec
CHANGED
@@ -17,4 +17,6 @@ example in a debugger where the same lines are shown many times.
|
|
17
17
|
s.files = `git ls-files`.split("\n")
|
18
18
|
s.extensions << "ext/trace_nums/extconf.rb"
|
19
19
|
s.add_dependency "debugger-ruby_core_source"
|
20
|
+
s.add_development_dependency 'rake', '~> 0.9.2.2'
|
21
|
+
s.add_development_dependency 'rake-compiler', '~> 0.8.0'
|
20
22
|
end
|
data/ext/trace_nums/extconf.rb
CHANGED
@@ -1,14 +1,8 @@
|
|
1
1
|
require "mkmf"
|
2
|
-
require "ruby_core_source"
|
2
|
+
require "debugger/ruby_core_source"
|
3
3
|
|
4
|
-
if RUBY_VERSION
|
5
|
-
|
6
|
-
STDERR.print("Ruby version is too old\n")
|
7
|
-
exit(1)
|
8
|
-
end
|
9
|
-
else
|
10
|
-
STDERR.print("Ruby version is too old\n")
|
11
|
-
exit(1)
|
4
|
+
if RUBY_VERSION < '1.9'
|
5
|
+
abort("Ruby version is too old")
|
12
6
|
end
|
13
7
|
|
14
8
|
hdrs = proc {
|
@@ -16,11 +10,6 @@ hdrs = proc {
|
|
16
10
|
}
|
17
11
|
|
18
12
|
dir_config("ruby")
|
19
|
-
if !
|
20
|
-
|
21
|
-
|
22
|
-
STDERR.print(" NOTE: For Ruby 1.9 installation instructions, please see:\n\n")
|
23
|
-
STDERR.print(" http://wiki.github.com/mark-moseley/ruby-debug\n\n")
|
24
|
-
STDERR.print("*************************************************************\n\n")
|
25
|
-
exit(1)
|
26
|
-
end
|
13
|
+
if !Debugger::RubyCoreSource.create_makefile_with_core(hdrs, "trace_nums")
|
14
|
+
abort("Makefile creation failed.")
|
15
|
+
end
|
data/ext/trace_nums/trace_nums.c
CHANGED
@@ -97,7 +97,7 @@ lnums_for_str(VALUE self, VALUE src)
|
|
97
97
|
return result;
|
98
98
|
}
|
99
99
|
|
100
|
-
void
|
100
|
+
void Init_trace_nums(void)
|
101
101
|
{
|
102
102
|
mTraceLineNumbers = rb_define_module("TraceLineNumbers");
|
103
103
|
rb_define_module_function(mTraceLineNumbers, "lnums_for_str",
|
data/lib/debugger/linecache.rb
CHANGED
data/lib/linecache19.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# $Id$
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Copyright (C) 2007, 2008 Rocky Bernstein <rockyb@rubyforge.net>
|
5
5
|
#
|
6
6
|
# This program is free software; you can redistribute it and/or modify
|
@@ -22,14 +22,14 @@
|
|
22
22
|
# Author:: Rocky Bernstein (mailto:rockyb@rubyforge.net)
|
23
23
|
#
|
24
24
|
# = linecache
|
25
|
-
# A module to read and cache lines of a Ruby program.
|
25
|
+
# A module to read and cache lines of a Ruby program.
|
26
26
|
# == Version
|
27
27
|
# :include:VERSION
|
28
28
|
|
29
29
|
# == SYNOPSIS
|
30
30
|
#
|
31
31
|
# The LineCache module allows one to get any line from any file,
|
32
|
-
# caching lines of the file on first access to the file. Although the
|
32
|
+
# caching lines of the file on first access to the file. Although the
|
33
33
|
# file may be any file, the common use is when the file is a Ruby
|
34
34
|
# script since parsing of the file is done to figure out where the
|
35
35
|
# statement boundaries are.
|
@@ -65,20 +65,18 @@ SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
|
|
65
65
|
require 'digest/sha1'
|
66
66
|
require 'set'
|
67
67
|
|
68
|
-
begin require 'rubygems' rescue LoadError end
|
69
68
|
require 'tracelines19'
|
70
|
-
# require 'ruby-debug' ; Debugger.start
|
71
69
|
|
72
70
|
# = module LineCache
|
73
|
-
# A module to read and cache lines of a Ruby program.
|
71
|
+
# A module to read and cache lines of a Ruby program.
|
74
72
|
module LineCache
|
75
73
|
LineCacheInfo = Struct.new(:stat, :line_numbers, :lines, :path, :sha1) unless
|
76
74
|
defined?(LineCacheInfo)
|
77
|
-
|
78
|
-
# The file cache. The key is a name as would be given by Ruby for
|
79
|
-
# __FILE__. The value is a LineCacheInfo object.
|
80
|
-
@@file_cache = {}
|
81
|
-
|
75
|
+
|
76
|
+
# The file cache. The key is a name as would be given by Ruby for
|
77
|
+
# __FILE__. The value is a LineCacheInfo object.
|
78
|
+
@@file_cache = {}
|
79
|
+
|
82
80
|
# Maps a string filename (a String) to a key in @@file_cache (a
|
83
81
|
# String).
|
84
82
|
#
|
@@ -91,9 +89,9 @@ module LineCache
|
|
91
89
|
# Another related use is when a template system is used. Here we'll
|
92
90
|
# probably want to remap not only the file name but also line
|
93
91
|
# ranges. Will probably use this for that, but I'm not sure.
|
94
|
-
@@file2file_remap = {}
|
92
|
+
@@file2file_remap = {}
|
95
93
|
@@file2file_remap_lines = {}
|
96
|
-
|
94
|
+
|
97
95
|
# Clear the file cache entirely.
|
98
96
|
def clear_file_cache()
|
99
97
|
@@file_cache = {}
|
@@ -115,7 +113,7 @@ module LineCache
|
|
115
113
|
# is found, it will be kept. Return a list of invalidated filenames.
|
116
114
|
# nil is returned if a filename was given but not found cached.
|
117
115
|
def checkcache(filename=nil, use_script_lines=false)
|
118
|
-
|
116
|
+
|
119
117
|
if !filename
|
120
118
|
filenames = @@file_cache.keys()
|
121
119
|
elsif @@file_cache.member?(filename)
|
@@ -131,7 +129,7 @@ module LineCache
|
|
131
129
|
if File.exist?(path)
|
132
130
|
cache_info = @@file_cache[filename].stat
|
133
131
|
stat = File.stat(path)
|
134
|
-
if stat &&
|
132
|
+
if stat &&
|
135
133
|
(cache_info.size != stat.size or cache_info.mtime != stat.mtime)
|
136
134
|
result << filename
|
137
135
|
update_cache(filename, use_script_lines)
|
@@ -158,7 +156,7 @@ module LineCache
|
|
158
156
|
end
|
159
157
|
end
|
160
158
|
module_function :cache
|
161
|
-
|
159
|
+
|
162
160
|
# Return true if filename is cached
|
163
161
|
def cached?(filename)
|
164
162
|
@@file_cache.member?(unmap_file(filename))
|
@@ -175,7 +173,7 @@ module LineCache
|
|
175
173
|
end
|
176
174
|
end
|
177
175
|
module_function :cached_script?
|
178
|
-
|
176
|
+
|
179
177
|
def empty?(filename)
|
180
178
|
filename=unmap_file(filename)
|
181
179
|
@@file_cache[filename].lines.empty?
|
@@ -185,9 +183,9 @@ module LineCache
|
|
185
183
|
# Get line +line_number+ from file named +filename+. Return nil if
|
186
184
|
# there was a problem. If a file named filename is not found, the
|
187
185
|
# function will look for it in the $: array.
|
188
|
-
#
|
186
|
+
#
|
189
187
|
# Examples:
|
190
|
-
#
|
188
|
+
#
|
191
189
|
# lines = LineCache::getline('/tmp/myfile.rb')
|
192
190
|
# # Same as above
|
193
191
|
# $: << '/tmp'
|
@@ -236,7 +234,7 @@ module LineCache
|
|
236
234
|
def remap_file_lines(from_file, to_file, range, start)
|
237
235
|
range = (range..range) if range.is_a?(Fixnum)
|
238
236
|
to_file = from_file unless to_file
|
239
|
-
if @@file2file_remap_lines[to_file]
|
237
|
+
if @@file2file_remap_lines[to_file]
|
240
238
|
# FIXME: need to check for overwriting ranges: whether
|
241
239
|
# they intersect or one encompasses another.
|
242
240
|
@@file2file_remap_lines[to_file] << [from_file, range, start]
|
@@ -245,12 +243,12 @@ module LineCache
|
|
245
243
|
end
|
246
244
|
end
|
247
245
|
module_function :remap_file_lines
|
248
|
-
|
246
|
+
|
249
247
|
# Return SHA1 of filename.
|
250
248
|
def sha1(filename)
|
251
249
|
filename = unmap_file(filename)
|
252
250
|
return nil unless @@file_cache.member?(filename)
|
253
|
-
return @@file_cache[filename].sha1.hexdigest if
|
251
|
+
return @@file_cache[filename].sha1.hexdigest if
|
254
252
|
@@file_cache[filename].sha1
|
255
253
|
sha1 = Digest::SHA1.new
|
256
254
|
@@file_cache[filename].lines.each do |line|
|
@@ -260,7 +258,7 @@ module LineCache
|
|
260
258
|
sha1.hexdigest
|
261
259
|
end
|
262
260
|
module_function :sha1
|
263
|
-
|
261
|
+
|
264
262
|
# Return the number of lines in filename
|
265
263
|
def size(filename)
|
266
264
|
filename = unmap_file(filename)
|
@@ -285,14 +283,14 @@ module LineCache
|
|
285
283
|
return nil unless fullname
|
286
284
|
e = @@file_cache[filename]
|
287
285
|
unless e.line_numbers
|
288
|
-
e.line_numbers =
|
286
|
+
e.line_numbers =
|
289
287
|
TraceLineNumbers.lnums_for_str_array(e.lines)
|
290
288
|
e.line_numbers = false unless e.line_numbers
|
291
289
|
end
|
292
290
|
e.line_numbers
|
293
291
|
end
|
294
292
|
module_function :trace_line_numbers
|
295
|
-
|
293
|
+
|
296
294
|
def unmap_file(file)
|
297
295
|
@@file2file_remap[file] ? @@file2file_remap[file] : file
|
298
296
|
end
|
@@ -302,8 +300,8 @@ module LineCache
|
|
302
300
|
if @@file2file_remap_lines[file]
|
303
301
|
@@file2file_remap_lines[file].each do |from_file, range, start|
|
304
302
|
if range === line
|
305
|
-
from_file = from_file || file
|
306
|
-
return [from_file, start+line-range.begin]
|
303
|
+
from_file = from_file || file
|
304
|
+
return [from_file, start+line-range.begin]
|
307
305
|
end
|
308
306
|
end
|
309
307
|
end
|
@@ -321,13 +319,13 @@ module LineCache
|
|
321
319
|
|
322
320
|
@@file_cache.delete(filename)
|
323
321
|
path = File.expand_path(filename)
|
324
|
-
|
322
|
+
|
325
323
|
if use_script_lines
|
326
324
|
list = [filename]
|
327
325
|
list << @@file2file_remap[path] if @@file2file_remap[path]
|
328
|
-
list.each do |name|
|
326
|
+
list.each do |name|
|
329
327
|
if !SCRIPT_LINES__[name].nil? && SCRIPT_LINES__[name] != true
|
330
|
-
begin
|
328
|
+
begin
|
331
329
|
stat = File.stat(name)
|
332
330
|
rescue
|
333
331
|
stat = nil
|
@@ -342,7 +340,7 @@ module LineCache
|
|
342
340
|
end
|
343
341
|
end
|
344
342
|
end
|
345
|
-
|
343
|
+
|
346
344
|
if File.exist?(path)
|
347
345
|
stat = File.stat(path)
|
348
346
|
elsif File.basename(filename) == filename
|
@@ -361,7 +359,7 @@ module LineCache
|
|
361
359
|
fp = File.open(path, 'r')
|
362
360
|
lines = fp.readlines()
|
363
361
|
fp.close()
|
364
|
-
rescue
|
362
|
+
rescue
|
365
363
|
## print '*** cannot open', path, ':', msg
|
366
364
|
return nil
|
367
365
|
end
|
@@ -376,15 +374,15 @@ module LineCache
|
|
376
374
|
end
|
377
375
|
|
378
376
|
# example usage
|
379
|
-
if __FILE__ == $0
|
380
|
-
def yes_no(var)
|
377
|
+
if __FILE__ == $0
|
378
|
+
def yes_no(var)
|
381
379
|
return var ? "" : "not "
|
382
380
|
end
|
383
381
|
|
384
382
|
lines = LineCache::getlines(__FILE__)
|
385
383
|
puts "#{__FILE__} has #{LineCache.size(__FILE__)} lines"
|
386
384
|
line = LineCache::getline(__FILE__, 6)
|
387
|
-
puts "The 6th line is\n#{line}"
|
385
|
+
puts "The 6th line is\n#{line}"
|
388
386
|
line = LineCache::remap_file(__FILE__, 'another_name')
|
389
387
|
puts LineCache::getline('another_name', 7)
|
390
388
|
|
@@ -392,21 +390,21 @@ if __FILE__ == $0
|
|
392
390
|
LineCache::update_cache(__FILE__)
|
393
391
|
LineCache::checkcache(__FILE__)
|
394
392
|
puts "#{__FILE__} has #{LineCache::size(__FILE__)} lines"
|
395
|
-
puts "#{__FILE__} trace line numbers:\n" +
|
393
|
+
puts "#{__FILE__} trace line numbers:\n" +
|
396
394
|
"#{LineCache::trace_line_numbers(__FILE__).to_a.sort.inspect}"
|
397
|
-
puts("#{__FILE__} is %scached." %
|
395
|
+
puts("#{__FILE__} is %scached." %
|
398
396
|
yes_no(LineCache::cached?(__FILE__)))
|
399
397
|
puts LineCache::stat(__FILE__).inspect
|
400
398
|
puts "Full path: #{LineCache::path(__FILE__)}"
|
401
399
|
LineCache::checkcache # Check all files in the cache
|
402
|
-
LineCache::clear_file_cache
|
403
|
-
puts("#{__FILE__} is now %scached." %
|
400
|
+
LineCache::clear_file_cache
|
401
|
+
puts("#{__FILE__} is now %scached." %
|
404
402
|
yes_no(LineCache::cached?(__FILE__)))
|
405
403
|
digest = SCRIPT_LINES__.select{|k,v| k =~ /digest.rb$/}
|
406
404
|
puts digest.first[0] if digest
|
407
405
|
line = LineCache::getline(__FILE__, 7)
|
408
|
-
puts "The 7th line is\n#{line}"
|
406
|
+
puts "The 7th line is\n#{line}"
|
409
407
|
LineCache::remap_file_lines(__FILE__, 'test2', (10..20), 6)
|
410
408
|
puts LineCache::getline('test2', 10)
|
411
|
-
puts "Remapped 10th line of test2 is\n#{line}"
|
409
|
+
puts "Remapped 10th line of test2 is\n#{line}"
|
412
410
|
end
|
data/lib/tracelines19.rb
CHANGED
@@ -1,27 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# $Id$
|
3
|
-
|
4
|
-
# require 'ruby-debug' ; Debugger.start(:post-mortem => true)
|
3
|
+
require 'trace_nums'
|
5
4
|
|
6
5
|
module TraceLineNumbers
|
7
|
-
|
8
|
-
begin
|
9
|
-
require File.join(@@SRC_DIR, '..', 'ext\trace_nums', 'trace_nums19')
|
10
|
-
rescue LoadError
|
11
|
-
# MSWindows seems to put this in lib rather than ext.
|
12
|
-
require File.join(@@SRC_DIR, '..', 'lib', 'trace_nums19')
|
13
|
-
end
|
14
|
-
|
15
|
-
# Return an array of lines numbers that could be
|
6
|
+
# Return an array of lines numbers that could be
|
16
7
|
# stopped at given a file name of a Ruby program.
|
17
8
|
def lnums_for_file(file)
|
18
9
|
lnums_for_str(File.read(file))
|
19
10
|
end
|
20
11
|
module_function :lnums_for_file
|
21
12
|
|
22
|
-
# Return an array of lines numbers that could be
|
13
|
+
# Return an array of lines numbers that could be
|
23
14
|
# stopped at given a file name of a Ruby program.
|
24
|
-
# We assume the each line has \n at the end. If not
|
15
|
+
# We assume the each line has \n at the end. If not
|
25
16
|
# set the newline parameters to \n.
|
26
17
|
def lnums_for_str_array(string_array, newline='')
|
27
18
|
lnums_for_str(string_array.join(newline))
|
@@ -34,7 +25,7 @@ if __FILE__ == $0
|
|
34
25
|
# test_file = '../test/rcov-bug.rb'
|
35
26
|
test_file = '../test/lnum-data/begin1.rb'
|
36
27
|
if File.exists?(test_file)
|
37
|
-
puts TraceLineNumbers.lnums_for_file(test_file).inspect
|
28
|
+
puts TraceLineNumbers.lnums_for_file(test_file).inspect
|
38
29
|
load(test_file, 0) # for later
|
39
30
|
end
|
40
31
|
puts TraceLineNumbers.lnums_for_file(__FILE__).inspect
|
data/test/lnum-diag.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# begin require 'rubygems' rescue LoadError end
|
4
|
-
# require 'ruby-debug' ; Debugger.start
|
5
|
-
|
6
3
|
TEST_DIR = File.expand_path(File.dirname(__FILE__))
|
7
4
|
TOP_SRC_DIR = File.join(TEST_DIR, '..')
|
8
5
|
require File.join(TOP_SRC_DIR, 'lib', 'tracelines19.rb')
|
@@ -51,7 +48,7 @@ def dump_file(file, opts)
|
|
51
48
|
if expected_lnums
|
52
49
|
puts "expecting: #{expected_lnums.inspect}"
|
53
50
|
puts '-' * 80
|
54
|
-
if expected_lnums
|
51
|
+
if expected_lnums
|
55
52
|
if got_lnums != expected_lnums
|
56
53
|
puts "mismatch: #{got_lnums.inspect}"
|
57
54
|
else
|
@@ -68,8 +65,8 @@ end
|
|
68
65
|
require 'getoptlong'
|
69
66
|
program = File.basename($0)
|
70
67
|
opts = {
|
71
|
-
:print_source => true, # Print source file?
|
72
|
-
:print_trace => true, # Run Tracer over file?
|
68
|
+
:print_source => true, # Print source file?
|
69
|
+
:print_trace => true, # Run Tracer over file?
|
73
70
|
:expect_line => true, # Source file has expected (correct) list of lines?
|
74
71
|
:print_parse => true, # Show ParseTree output?
|
75
72
|
}
|
@@ -88,7 +85,7 @@ getopts = GetoptLong.new(
|
|
88
85
|
getopts.each do |opt, arg|
|
89
86
|
case opt
|
90
87
|
when '--help'
|
91
|
-
puts "usage
|
88
|
+
puts "usage
|
92
89
|
Usage: #{$program} [options] file1 file2 ...
|
93
90
|
|
94
91
|
Diagnostic program to make see what TraceLineNumbers does and compare
|
@@ -125,6 +122,6 @@ options:
|
|
125
122
|
end
|
126
123
|
end
|
127
124
|
|
128
|
-
ARGV.each do |file|
|
125
|
+
ARGV.each do |file|
|
129
126
|
dump_file(file, opts)
|
130
127
|
end
|
data/test/parse-show.rb
CHANGED
data/test/test-linecache.rb
CHANGED
@@ -4,38 +4,35 @@ require 'fileutils'
|
|
4
4
|
require 'tempfile'
|
5
5
|
require 'set'
|
6
6
|
|
7
|
-
# require 'rubygems'
|
8
|
-
# require 'ruby-debug'; Debugger.start
|
9
|
-
|
10
7
|
# Test LineCache module
|
11
8
|
class TestLineCache < Test::Unit::TestCase
|
12
9
|
@@TEST_DIR = File.expand_path(File.dirname(__FILE__))
|
13
10
|
@@TOP_SRC_DIR = File.join(@@TEST_DIR, '..', 'lib')
|
14
11
|
require File.join(@@TOP_SRC_DIR, 'linecache19.rb')
|
15
|
-
|
12
|
+
|
16
13
|
def setup
|
17
14
|
LineCache::clear_file_cache
|
18
15
|
end
|
19
|
-
|
16
|
+
|
20
17
|
def test_basic
|
21
18
|
fp = File.open(__FILE__, 'r')
|
22
19
|
compare_lines = fp.readlines()
|
23
20
|
fp.close
|
24
|
-
|
21
|
+
|
25
22
|
# Test getlines to read this file.
|
26
23
|
lines = LineCache::getlines(__FILE__)
|
27
24
|
assert_equal(compare_lines, lines,
|
28
25
|
'We should get exactly the same lines as reading this file.')
|
29
|
-
|
26
|
+
|
30
27
|
# Test getline to read this file. The file should now be cached,
|
31
28
|
# so internally a different set of routines are used.
|
32
29
|
test_line = 1
|
33
30
|
line = LineCache::getline(__FILE__, test_line)
|
34
31
|
assert_equal(compare_lines[test_line-1], line,
|
35
32
|
'We should get exactly the same line as reading this file.')
|
36
|
-
|
33
|
+
|
37
34
|
# Test getting the line via a relative file name
|
38
|
-
Dir.chdir(File.dirname(__FILE__)) do
|
35
|
+
Dir.chdir(File.dirname(__FILE__)) do
|
39
36
|
short_file = File.basename(__FILE__)
|
40
37
|
test_line = 10
|
41
38
|
line = LineCache::getline(short_file, test_line)
|
@@ -76,7 +73,7 @@ class TestLineCache < Test::Unit::TestCase
|
|
76
73
|
assert_equal(false, LineCache::cached_script?('./short-file'),
|
77
74
|
"Should not find './short-file' in SCRIPT_LINES__")
|
78
75
|
assert_equal(true, 78 < LineCache.size(__FILE__))
|
79
|
-
Dir.chdir(File.dirname(__FILE__)) do
|
76
|
+
Dir.chdir(File.dirname(__FILE__)) do
|
80
77
|
load('./short-file', 0)
|
81
78
|
assert_equal(true, LineCache::cached_script?('./short-file'),
|
82
79
|
"Should be able to find './short-file' in SCRIPT_LINES__")
|
@@ -96,23 +93,23 @@ class TestLineCache < Test::Unit::TestCase
|
|
96
93
|
line5 = LineCache::getline(__FILE__, 5)
|
97
94
|
LineCache::remap_file_lines(__FILE__, 'test2', 9, 5)
|
98
95
|
rline9 = LineCache::getline('test2', 9)
|
99
|
-
assert_equal(line5, rline9,
|
96
|
+
assert_equal(line5, rline9,
|
100
97
|
'lines should be the same via remap_file_line - remap integer')
|
101
98
|
|
102
99
|
line6 = LineCache::getline(__FILE__, 6)
|
103
100
|
rline10 = LineCache::getline('test2', 10)
|
104
|
-
assert_equal(line6, rline10,
|
101
|
+
assert_equal(line6, rline10,
|
105
102
|
'lines should be the same via remap_file_line - range')
|
106
103
|
|
107
104
|
line7 = LineCache::getline(__FILE__, 7)
|
108
105
|
rline11 = LineCache::getline('test2', 11)
|
109
|
-
assert_equal(line7, rline11,
|
106
|
+
assert_equal(line7, rline11,
|
110
107
|
'lines should be the same via remap_file_line - range')
|
111
108
|
|
112
109
|
line8 = LineCache::getline(__FILE__, 8)
|
113
110
|
LineCache::remap_file_lines(__FILE__, nil, 20, 8)
|
114
111
|
rline20 = LineCache::getline(__FILE__, 20)
|
115
|
-
assert_equal(line8, rline20,
|
112
|
+
assert_equal(line8, rline20,
|
116
113
|
'lines should be the same via remap_file_line - nil file')
|
117
114
|
end
|
118
115
|
|
@@ -142,7 +139,7 @@ class TestLineCache < Test::Unit::TestCase
|
|
142
139
|
end
|
143
140
|
|
144
141
|
def test_sha1
|
145
|
-
test_file = File.join(@@TEST_DIR, 'short-file')
|
142
|
+
test_file = File.join(@@TEST_DIR, 'short-file')
|
146
143
|
LineCache::cache(test_file)
|
147
144
|
assert_equal('1134f95ea84a3dcc67d7d1bf41390ee1a03af6d2',
|
148
145
|
LineCache::sha1(test_file))
|
data/test/test-lnum.rb
CHANGED
@@ -2,18 +2,15 @@
|
|
2
2
|
# $Id$
|
3
3
|
require 'test/unit'
|
4
4
|
|
5
|
-
# require 'rubygems'
|
6
|
-
# require 'ruby-debug'; Debugger.init
|
7
|
-
|
8
5
|
# Test TraceLineNumbers module
|
9
6
|
class TestLineNumbers2 < Test::Unit::TestCase
|
10
7
|
@@TEST_DIR = File.expand_path(File.dirname(__FILE__))
|
11
8
|
@@TOP_SRC_DIR = File.join(@@TEST_DIR, '..')
|
12
9
|
require File.join(@@TOP_SRC_DIR, 'lib', 'tracelines19.rb')
|
13
|
-
|
10
|
+
|
14
11
|
def test_all_lnum_data
|
15
12
|
test_dir = File.join(@@TEST_DIR, 'data')
|
16
|
-
Dir.chdir(test_dir) do
|
13
|
+
Dir.chdir(test_dir) do
|
17
14
|
Dir.glob('*.rb').sort.each do |f|
|
18
15
|
puts f
|
19
16
|
fp = File.open(f, 'r')
|
data/test/test-tracelines.rb
CHANGED
@@ -4,9 +4,6 @@ require 'test/unit'
|
|
4
4
|
require 'fileutils'
|
5
5
|
require 'tempfile'
|
6
6
|
|
7
|
-
# require 'rubygems'
|
8
|
-
# require 'ruby-debug'; Debugger.init
|
9
|
-
|
10
7
|
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
|
11
8
|
# Test TestLineNumbers module
|
12
9
|
class TestLineNumbers1 < Test::Unit::TestCase
|
@@ -20,7 +17,7 @@ class TestLineNumbers1 < Test::Unit::TestCase
|
|
20
17
|
first_line = fp.readline[1..-2]
|
21
18
|
@@rcov_lnums = eval(first_line, binding, __FILE__, __LINE__)
|
22
19
|
}
|
23
|
-
|
20
|
+
|
24
21
|
def test_for_file
|
25
22
|
rcov_lines = TraceLineNumbers.lnums_for_file(@@rcov_file)
|
26
23
|
assert_equal(@@rcov_lnums, rcov_lines)
|
@@ -33,8 +30,8 @@ class TestLineNumbers1 < Test::Unit::TestCase
|
|
33
30
|
end
|
34
31
|
|
35
32
|
def test_for_string_array
|
36
|
-
load(@@rcov_file, 0)
|
37
|
-
rcov_lines =
|
33
|
+
load(@@rcov_file, 0)
|
34
|
+
rcov_lines =
|
38
35
|
TraceLineNumbers.lnums_for_str_array(SCRIPT_LINES__[@@rcov_file])
|
39
36
|
assert_equal(@@rcov_lnums, rcov_lines)
|
40
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debugger-linecache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-04-
|
14
|
+
date: 2012-04-06 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: debugger-ruby_core_source
|
@@ -29,6 +29,38 @@ dependencies:
|
|
29
29
|
- - ! '>='
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: '0'
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: rake
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.9.2.2
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.9.2.2
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake-compiler
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.8.0
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ~>
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 0.8.0
|
32
64
|
description: ! 'Linecache is a module for reading and caching lines. This may be useful
|
33
65
|
for
|
34
66
|
|
@@ -42,14 +74,13 @@ extensions:
|
|
42
74
|
extra_rdoc_files:
|
43
75
|
- README.md
|
44
76
|
files:
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
77
|
+
- .travis.yml
|
78
|
+
- CHANGELOG.md
|
79
|
+
- LICENSE.txt
|
80
|
+
- OLD_CHANGELOG
|
49
81
|
- OLD_README
|
50
82
|
- README.md
|
51
83
|
- Rakefile
|
52
|
-
- VERSION
|
53
84
|
- debugger-linecache.gemspec
|
54
85
|
- ext/trace_nums/extconf.rb
|
55
86
|
- ext/trace_nums/trace_nums.c
|
@@ -57,7 +88,6 @@ files:
|
|
57
88
|
- lib/debugger/linecache.rb
|
58
89
|
- lib/linecache19.rb
|
59
90
|
- lib/tracelines19.rb
|
60
|
-
- svn2cl_usermap
|
61
91
|
- test/data/begin1.rb
|
62
92
|
- test/data/begin2.rb
|
63
93
|
- test/data/begin3.rb
|
@@ -112,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
142
|
version: 1.3.6
|
113
143
|
requirements: []
|
114
144
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.8.
|
145
|
+
rubygems_version: 1.8.19
|
116
146
|
signing_key:
|
117
147
|
specification_version: 3
|
118
148
|
summary: Read file with caching
|
data/AUTHORS
DELETED
data/COPYING
DELETED
@@ -1,340 +0,0 @@
|
|
1
|
-
GNU GENERAL PUBLIC LICENSE
|
2
|
-
Version 2, June 1991
|
3
|
-
|
4
|
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6
|
-
Everyone is permitted to copy and distribute verbatim copies
|
7
|
-
of this license document, but changing it is not allowed.
|
8
|
-
|
9
|
-
Preamble
|
10
|
-
|
11
|
-
The licenses for most software are designed to take away your
|
12
|
-
freedom to share and change it. By contrast, the GNU General Public
|
13
|
-
License is intended to guarantee your freedom to share and change free
|
14
|
-
software--to make sure the software is free for all its users. This
|
15
|
-
General Public License applies to most of the Free Software
|
16
|
-
Foundation's software and to any other program whose authors commit to
|
17
|
-
using it. (Some other Free Software Foundation software is covered by
|
18
|
-
the GNU Library General Public License instead.) You can apply it to
|
19
|
-
your programs, too.
|
20
|
-
|
21
|
-
When we speak of free software, we are referring to freedom, not
|
22
|
-
price. Our General Public Licenses are designed to make sure that you
|
23
|
-
have the freedom to distribute copies of free software (and charge for
|
24
|
-
this service if you wish), that you receive source code or can get it
|
25
|
-
if you want it, that you can change the software or use pieces of it
|
26
|
-
in new free programs; and that you know you can do these things.
|
27
|
-
|
28
|
-
To protect your rights, we need to make restrictions that forbid
|
29
|
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30
|
-
These restrictions translate to certain responsibilities for you if you
|
31
|
-
distribute copies of the software, or if you modify it.
|
32
|
-
|
33
|
-
For example, if you distribute copies of such a program, whether
|
34
|
-
gratis or for a fee, you must give the recipients all the rights that
|
35
|
-
you have. You must make sure that they, too, receive or can get the
|
36
|
-
source code. And you must show them these terms so they know their
|
37
|
-
rights.
|
38
|
-
|
39
|
-
We protect your rights with two steps: (1) copyright the software, and
|
40
|
-
(2) offer you this license which gives you legal permission to copy,
|
41
|
-
distribute and/or modify the software.
|
42
|
-
|
43
|
-
Also, for each author's protection and ours, we want to make certain
|
44
|
-
that everyone understands that there is no warranty for this free
|
45
|
-
software. If the software is modified by someone else and passed on, we
|
46
|
-
want its recipients to know that what they have is not the original, so
|
47
|
-
that any problems introduced by others will not reflect on the original
|
48
|
-
authors' reputations.
|
49
|
-
|
50
|
-
Finally, any free program is threatened constantly by software
|
51
|
-
patents. We wish to avoid the danger that redistributors of a free
|
52
|
-
program will individually obtain patent licenses, in effect making the
|
53
|
-
program proprietary. To prevent this, we have made it clear that any
|
54
|
-
patent must be licensed for everyone's free use or not licensed at all.
|
55
|
-
|
56
|
-
The precise terms and conditions for copying, distribution and
|
57
|
-
modification follow.
|
58
|
-
|
59
|
-
GNU GENERAL PUBLIC LICENSE
|
60
|
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61
|
-
|
62
|
-
0. This License applies to any program or other work which contains
|
63
|
-
a notice placed by the copyright holder saying it may be distributed
|
64
|
-
under the terms of this General Public License. The "Program", below,
|
65
|
-
refers to any such program or work, and a "work based on the Program"
|
66
|
-
means either the Program or any derivative work under copyright law:
|
67
|
-
that is to say, a work containing the Program or a portion of it,
|
68
|
-
either verbatim or with modifications and/or translated into another
|
69
|
-
language. (Hereinafter, translation is included without limitation in
|
70
|
-
the term "modification".) Each licensee is addressed as "you".
|
71
|
-
|
72
|
-
Activities other than copying, distribution and modification are not
|
73
|
-
covered by this License; they are outside its scope. The act of
|
74
|
-
running the Program is not restricted, and the output from the Program
|
75
|
-
is covered only if its contents constitute a work based on the
|
76
|
-
Program (independent of having been made by running the Program).
|
77
|
-
Whether that is true depends on what the Program does.
|
78
|
-
|
79
|
-
1. You may copy and distribute verbatim copies of the Program's
|
80
|
-
source code as you receive it, in any medium, provided that you
|
81
|
-
conspicuously and appropriately publish on each copy an appropriate
|
82
|
-
copyright notice and disclaimer of warranty; keep intact all the
|
83
|
-
notices that refer to this License and to the absence of any warranty;
|
84
|
-
and give any other recipients of the Program a copy of this License
|
85
|
-
along with the Program.
|
86
|
-
|
87
|
-
You may charge a fee for the physical act of transferring a copy, and
|
88
|
-
you may at your option offer warranty protection in exchange for a fee.
|
89
|
-
|
90
|
-
2. You may modify your copy or copies of the Program or any portion
|
91
|
-
of it, thus forming a work based on the Program, and copy and
|
92
|
-
distribute such modifications or work under the terms of Section 1
|
93
|
-
above, provided that you also meet all of these conditions:
|
94
|
-
|
95
|
-
a) You must cause the modified files to carry prominent notices
|
96
|
-
stating that you changed the files and the date of any change.
|
97
|
-
|
98
|
-
b) You must cause any work that you distribute or publish, that in
|
99
|
-
whole or in part contains or is derived from the Program or any
|
100
|
-
part thereof, to be licensed as a whole at no charge to all third
|
101
|
-
parties under the terms of this License.
|
102
|
-
|
103
|
-
c) If the modified program normally reads commands interactively
|
104
|
-
when run, you must cause it, when started running for such
|
105
|
-
interactive use in the most ordinary way, to print or display an
|
106
|
-
announcement including an appropriate copyright notice and a
|
107
|
-
notice that there is no warranty (or else, saying that you provide
|
108
|
-
a warranty) and that users may redistribute the program under
|
109
|
-
these conditions, and telling the user how to view a copy of this
|
110
|
-
License. (Exception: if the Program itself is interactive but
|
111
|
-
does not normally print such an announcement, your work based on
|
112
|
-
the Program is not required to print an announcement.)
|
113
|
-
|
114
|
-
These requirements apply to the modified work as a whole. If
|
115
|
-
identifiable sections of that work are not derived from the Program,
|
116
|
-
and can be reasonably considered independent and separate works in
|
117
|
-
themselves, then this License, and its terms, do not apply to those
|
118
|
-
sections when you distribute them as separate works. But when you
|
119
|
-
distribute the same sections as part of a whole which is a work based
|
120
|
-
on the Program, the distribution of the whole must be on the terms of
|
121
|
-
this License, whose permissions for other licensees extend to the
|
122
|
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123
|
-
|
124
|
-
Thus, it is not the intent of this section to claim rights or contest
|
125
|
-
your rights to work written entirely by you; rather, the intent is to
|
126
|
-
exercise the right to control the distribution of derivative or
|
127
|
-
collective works based on the Program.
|
128
|
-
|
129
|
-
In addition, mere aggregation of another work not based on the Program
|
130
|
-
with the Program (or with a work based on the Program) on a volume of
|
131
|
-
a storage or distribution medium does not bring the other work under
|
132
|
-
the scope of this License.
|
133
|
-
|
134
|
-
3. You may copy and distribute the Program (or a work based on it,
|
135
|
-
under Section 2) in object code or executable form under the terms of
|
136
|
-
Sections 1 and 2 above provided that you also do one of the following:
|
137
|
-
|
138
|
-
a) Accompany it with the complete corresponding machine-readable
|
139
|
-
source code, which must be distributed under the terms of Sections
|
140
|
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141
|
-
|
142
|
-
b) Accompany it with a written offer, valid for at least three
|
143
|
-
years, to give any third party, for a charge no more than your
|
144
|
-
cost of physically performing source distribution, a complete
|
145
|
-
machine-readable copy of the corresponding source code, to be
|
146
|
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147
|
-
customarily used for software interchange; or,
|
148
|
-
|
149
|
-
c) Accompany it with the information you received as to the offer
|
150
|
-
to distribute corresponding source code. (This alternative is
|
151
|
-
allowed only for noncommercial distribution and only if you
|
152
|
-
received the program in object code or executable form with such
|
153
|
-
an offer, in accord with Subsection b above.)
|
154
|
-
|
155
|
-
The source code for a work means the preferred form of the work for
|
156
|
-
making modifications to it. For an executable work, complete source
|
157
|
-
code means all the source code for all modules it contains, plus any
|
158
|
-
associated interface definition files, plus the scripts used to
|
159
|
-
control compilation and installation of the executable. However, as a
|
160
|
-
special exception, the source code distributed need not include
|
161
|
-
anything that is normally distributed (in either source or binary
|
162
|
-
form) with the major components (compiler, kernel, and so on) of the
|
163
|
-
operating system on which the executable runs, unless that component
|
164
|
-
itself accompanies the executable.
|
165
|
-
|
166
|
-
If distribution of executable or object code is made by offering
|
167
|
-
access to copy from a designated place, then offering equivalent
|
168
|
-
access to copy the source code from the same place counts as
|
169
|
-
distribution of the source code, even though third parties are not
|
170
|
-
compelled to copy the source along with the object code.
|
171
|
-
|
172
|
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173
|
-
except as expressly provided under this License. Any attempt
|
174
|
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175
|
-
void, and will automatically terminate your rights under this License.
|
176
|
-
However, parties who have received copies, or rights, from you under
|
177
|
-
this License will not have their licenses terminated so long as such
|
178
|
-
parties remain in full compliance.
|
179
|
-
|
180
|
-
5. You are not required to accept this License, since you have not
|
181
|
-
signed it. However, nothing else grants you permission to modify or
|
182
|
-
distribute the Program or its derivative works. These actions are
|
183
|
-
prohibited by law if you do not accept this License. Therefore, by
|
184
|
-
modifying or distributing the Program (or any work based on the
|
185
|
-
Program), you indicate your acceptance of this License to do so, and
|
186
|
-
all its terms and conditions for copying, distributing or modifying
|
187
|
-
the Program or works based on it.
|
188
|
-
|
189
|
-
6. Each time you redistribute the Program (or any work based on the
|
190
|
-
Program), the recipient automatically receives a license from the
|
191
|
-
original licensor to copy, distribute or modify the Program subject to
|
192
|
-
these terms and conditions. You may not impose any further
|
193
|
-
restrictions on the recipients' exercise of the rights granted herein.
|
194
|
-
You are not responsible for enforcing compliance by third parties to
|
195
|
-
this License.
|
196
|
-
|
197
|
-
7. If, as a consequence of a court judgment or allegation of patent
|
198
|
-
infringement or for any other reason (not limited to patent issues),
|
199
|
-
conditions are imposed on you (whether by court order, agreement or
|
200
|
-
otherwise) that contradict the conditions of this License, they do not
|
201
|
-
excuse you from the conditions of this License. If you cannot
|
202
|
-
distribute so as to satisfy simultaneously your obligations under this
|
203
|
-
License and any other pertinent obligations, then as a consequence you
|
204
|
-
may not distribute the Program at all. For example, if a patent
|
205
|
-
license would not permit royalty-free redistribution of the Program by
|
206
|
-
all those who receive copies directly or indirectly through you, then
|
207
|
-
the only way you could satisfy both it and this License would be to
|
208
|
-
refrain entirely from distribution of the Program.
|
209
|
-
|
210
|
-
If any portion of this section is held invalid or unenforceable under
|
211
|
-
any particular circumstance, the balance of the section is intended to
|
212
|
-
apply and the section as a whole is intended to apply in other
|
213
|
-
circumstances.
|
214
|
-
|
215
|
-
It is not the purpose of this section to induce you to infringe any
|
216
|
-
patents or other property right claims or to contest validity of any
|
217
|
-
such claims; this section has the sole purpose of protecting the
|
218
|
-
integrity of the free software distribution system, which is
|
219
|
-
implemented by public license practices. Many people have made
|
220
|
-
generous contributions to the wide range of software distributed
|
221
|
-
through that system in reliance on consistent application of that
|
222
|
-
system; it is up to the author/donor to decide if he or she is willing
|
223
|
-
to distribute software through any other system and a licensee cannot
|
224
|
-
impose that choice.
|
225
|
-
|
226
|
-
This section is intended to make thoroughly clear what is believed to
|
227
|
-
be a consequence of the rest of this License.
|
228
|
-
|
229
|
-
8. If the distribution and/or use of the Program is restricted in
|
230
|
-
certain countries either by patents or by copyrighted interfaces, the
|
231
|
-
original copyright holder who places the Program under this License
|
232
|
-
may add an explicit geographical distribution limitation excluding
|
233
|
-
those countries, so that distribution is permitted only in or among
|
234
|
-
countries not thus excluded. In such case, this License incorporates
|
235
|
-
the limitation as if written in the body of this License.
|
236
|
-
|
237
|
-
9. The Free Software Foundation may publish revised and/or new versions
|
238
|
-
of the General Public License from time to time. Such new versions will
|
239
|
-
be similar in spirit to the present version, but may differ in detail to
|
240
|
-
address new problems or concerns.
|
241
|
-
|
242
|
-
Each version is given a distinguishing version number. If the Program
|
243
|
-
specifies a version number of this License which applies to it and "any
|
244
|
-
later version", you have the option of following the terms and conditions
|
245
|
-
either of that version or of any later version published by the Free
|
246
|
-
Software Foundation. If the Program does not specify a version number of
|
247
|
-
this License, you may choose any version ever published by the Free Software
|
248
|
-
Foundation.
|
249
|
-
|
250
|
-
10. If you wish to incorporate parts of the Program into other free
|
251
|
-
programs whose distribution conditions are different, write to the author
|
252
|
-
to ask for permission. For software which is copyrighted by the Free
|
253
|
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254
|
-
make exceptions for this. Our decision will be guided by the two goals
|
255
|
-
of preserving the free status of all derivatives of our free software and
|
256
|
-
of promoting the sharing and reuse of software generally.
|
257
|
-
|
258
|
-
NO WARRANTY
|
259
|
-
|
260
|
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261
|
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262
|
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263
|
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264
|
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265
|
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266
|
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267
|
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268
|
-
REPAIR OR CORRECTION.
|
269
|
-
|
270
|
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271
|
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272
|
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273
|
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274
|
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275
|
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276
|
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277
|
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278
|
-
POSSIBILITY OF SUCH DAMAGES.
|
279
|
-
|
280
|
-
END OF TERMS AND CONDITIONS
|
281
|
-
|
282
|
-
How to Apply These Terms to Your New Programs
|
283
|
-
|
284
|
-
If you develop a new program, and you want it to be of the greatest
|
285
|
-
possible use to the public, the best way to achieve this is to make it
|
286
|
-
free software which everyone can redistribute and change under these terms.
|
287
|
-
|
288
|
-
To do so, attach the following notices to the program. It is safest
|
289
|
-
to attach them to the start of each source file to most effectively
|
290
|
-
convey the exclusion of warranty; and each file should have at least
|
291
|
-
the "copyright" line and a pointer to where the full notice is found.
|
292
|
-
|
293
|
-
<one line to give the program's name and a brief idea of what it does.>
|
294
|
-
Copyright (C) <year> <name of author>
|
295
|
-
|
296
|
-
This program is free software; you can redistribute it and/or modify
|
297
|
-
it under the terms of the GNU General Public License as published by
|
298
|
-
the Free Software Foundation; either version 2 of the License, or
|
299
|
-
(at your option) any later version.
|
300
|
-
|
301
|
-
This program is distributed in the hope that it will be useful,
|
302
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304
|
-
GNU General Public License for more details.
|
305
|
-
|
306
|
-
You should have received a copy of the GNU General Public License
|
307
|
-
along with this program; if not, write to the Free Software
|
308
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
309
|
-
|
310
|
-
|
311
|
-
Also add information on how to contact you by electronic and paper mail.
|
312
|
-
|
313
|
-
If the program is interactive, make it output a short notice like this
|
314
|
-
when it starts in an interactive mode:
|
315
|
-
|
316
|
-
Gnomovision version 69, Copyright (C) year name of author
|
317
|
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
318
|
-
This is free software, and you are welcome to redistribute it
|
319
|
-
under certain conditions; type `show c' for details.
|
320
|
-
|
321
|
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
322
|
-
parts of the General Public License. Of course, the commands you use may
|
323
|
-
be called something other than `show w' and `show c'; they could even be
|
324
|
-
mouse-clicks or menu items--whatever suits your program.
|
325
|
-
|
326
|
-
You should also get your employer (if you work as a programmer) or your
|
327
|
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
328
|
-
necessary. Here is a sample; alter the names:
|
329
|
-
|
330
|
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
331
|
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
332
|
-
|
333
|
-
<signature of Ty Coon>, 1 April 1989
|
334
|
-
Ty Coon, President of Vice
|
335
|
-
|
336
|
-
This General Public License does not permit incorporating your program into
|
337
|
-
proprietary programs. If your program is a subroutine library, you may
|
338
|
-
consider it more useful to permit linking proprietary applications with the
|
339
|
-
library. If this is what you want to do, use the GNU Library General
|
340
|
-
Public License instead of this License.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.5.1
|
data/svn2cl_usermap
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rockyb:Rocky Bernstein
|