Module | LineCache |
In: |
lib/linecache.rb
lib/linecache.rb |
Module caching lines of a file
LineCacheInfo | = | Struct.new(:stat, :line_numbers, :lines, :path, :sha1) unless defined?(LineCacheInfo) |
LineCacheInfo | = | Struct.new(:stat, :line_numbers, :lines, :path, :sha1) unless defined?(LineCacheInfo) |
Cache filename if it‘s not already cached. Return the expanded filename for it in the cache or nil if we can‘t find the file.
Cache filename if it‘s not already cached. Return the expanded filename for it in the cache or nil if we can‘t find the file.
Discard cache entries that are out of date. If filename is nil all entries in the file cache +@@file_cache+ are checked. If we don‘t have stat information about a file which can happen if the file was read from __SCRIPT_LINES but no corresponding file is found, it will be kept. Return a list of invalidated filenames. nil is returned if a filename was given but not found cached.
Discard cache entries that are out of date. If filename is nil all entries in the file cache +@@file_cache+ are checked. If we don‘t have stat information about a file which can happen if the file was read from __SCRIPT_LINES but no corresponding file is found, it will be kept. Return a list of invalidated filenames. nil is returned if a filename was given but not found cached.
Get line line_number from file named filename. Return nil if there was a problem. If a file named filename is not found, the function will look for it in the $: path array.
Examples:
lines = LineCache::getline('/tmp/myfile.rb) # Same as above $: << '/tmp' lines = Dir.chdir('/tmp') do lines = LineCache::getlines ('myfile.rb') end
Get line line_number from file named filename. Return nil if there was a problem. If a file named filename is not found, the function will look for it in the $: path array.
Examples:
lines = LineCache::getline('/tmp/myfile.rb) # Same as above $: << '/tmp' lines = Dir.chdir('/tmp') do lines = LineCache::getlines ('myfile.rb') end
Return an Array of breakpoints in filename. The list will contain an entry for each distinct line event call so it is possible (and possibly useful) for a line number appear more than once.
Return an Array of breakpoints in filename. The list will contain an entry for each distinct line event call so it is possible (and possibly useful) for a line number appear more than once.