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

Version Path
facets-0.6.3 lib/facet-dev/kernel/call_line.rb
facets-1.4.1 forge/core/kernel/call_line.rb
facets-1.4.2 forge/core/kernel/call_line.rb
facets-1.4.3 forge/core/kernel/call_line.rb
facets-1.4.4 forge/core/kernel/call_line.rb
facets-1.4.5 snip/core/kernel/call_line.rb
facets-1.8.49 work/core/kernel/call_line.rb
facets-1.8.0 work/core/kernel/call_line.rb
facets-1.8.20 work/core/kernel/call_line.rb
facets-1.8.8 work/core/kernel/call_line.rb