Sha256: 6ea5043b328ace454f9aeac5356e8f1708257c905723aa3ee48a7f5ebe39a6c5

Contents?: true

Size: 298 Bytes

Versions: 6

Compression:

Stored size: 298 Bytes

Contents

require 'trace_tree/gem_paths'

class TraceTree
  module ShortGemPath

    def source_location
      "#{shorten_gem_path current.file}:#{current.line}"
    end

    private

    def shorten_gem_path loc
      GemPaths.each{|name, path| loc = loc.gsub(path, "$#{name}")}
      loc
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trace_tree-0.1.5 lib/trace_tree/short_gem_path.rb
trace_tree-0.1.4 lib/trace_tree/short_gem_path.rb
trace_tree-0.1.3 lib/trace_tree/short_gem_path.rb
trace_tree-0.1.2 lib/trace_tree/short_gem_path.rb
trace_tree-0.1.1 lib/trace_tree/short_gem_path.rb
trace_tree-0.1.0 lib/trace_tree/short_gem_path.rb