module Spit

Public Class Methods

extract_label(h) click to toggle source
# File lib/spit.rb, line 43
def self.extract_label h
  "#{h[:clazz]}.#{h[:method]}(#{h[:line]})"
end
parse_line(path) click to toggle source
# File lib/spit.rb, line 35
def self.parse_line path
  method = path[/`(.+)'/, 1]   # `
  path, l = path.match(/(.+):(\d+)/)[1..2]
  path = File.expand_path path
  clazz = path[/.+\/(.+)\.rb/, 1]
  {:path=>path, :line=>l, :method=>method, :clazz=>clazz}
end
print(txt, line, options={}) click to toggle source
s(txt) click to toggle source
# File lib/spit.rb, line 6
def self.s txt
  self.print txt, caller[0], :source=>true
end