Sha256: 5d43d86cf81be7061262cb31cda1fcefdcd8dbf6ad3c441e230c31ec579a2d78
Contents?: true
Size: 455 Bytes
Versions: 10
Compression:
Stored size: 455 Bytes
Contents
module Kernel # FIX ME!!! # Return a string representing the line at the given call level, # where level is the line desired, relative to the the method # that called call_line. def call_line(level=1) dir = File.dirname(File.expand_path($0, Dir.getwd)) file, lineno, method = call_stack(level) File.open(File.expand_path(file, dir)) do |input| (lineno.to_i - 1).times { input.gets } return input.gets end end end
Version data entries
10 entries across 10 versions & 1 rubygems