# File lib/proc_source.rb, line 13 def get_lines(filename, start_line = 0) case filename # special "(irb)" descriptor? when "(irb)" IRB.conf[:MAIN_CONTEXT].io.line(start_line .. -1) # special "(eval...)" descriptor? when /^\(eval.+\)$/ EVAL_LINES__[filename][start_line .. -1] # regular file else # Ruby already parsed this file? (see disclaimer above) if lines = SCRIPT_LINES__[filename] lines[(start_line - 1) .. -1] # If the file exists we're going to try reading it in elsif File.exist?(filename) begin File.readlines(filename)[(start_line - 1) .. -1] rescue nil end end end end