Module: Defly::Whinable
- Defined in:
- lib/defly/whinable.rb
Instance Method Summary collapse
Instance Method Details
#to_s ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/defly/whinable.rb', line 3 def to_s = super position = backtrace[0] = "" missing_method = name.to_s unless /^\(.*\):.*/ =~ position # skipping irb file, line, other = position.split(':') code = IO.readlines(file)[line.to_i - 1].chomp code.gsub!(/(#{missing_method})/, '<<\1>>') = "#{file.split('/')[-1]}:#{line}> #{code}" end "#{}\n#{}" end |