Sha256: 95801ededa49f456c2b4aa7b345ae59126ef4b8410fb52570a459656600a8b67

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

# -*- coding: utf-8 -*-
module CallerInfo
  #
  # return stack trace info if defined?($debug).
  #
  def caller_info
    caller(3).collect { |info|
      file = File.expand_path(info.sub(/:(\d+)[^\d`]*(`([^']+)')?/, ''))
      { :file => file, :line => $1, :method => $3 }
    }.select { |info| info[:method] }  # delete if info[:method] == nil
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
writeexcel-0.5.0 lib/writeexcel/caller_info.rb
writeexcel-0.4.3 lib/writeexcel/caller_info.rb
writeexcel-0.4.2 lib/writeexcel/caller_info.rb
writeexcel-0.4.1 lib/writeexcel/caller_info.rb