Sha256: 4157920a649212ec9e1e92021f59564df4b5bc7031547fc6fed9643b0e8bac06

Contents?: true

Size: 370 Bytes

Versions: 27

Compression:

Stored size: 370 Bytes

Contents

require 'trace_tree/gem_paths'

class TraceTree
  module ShortGemPath

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

    private

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

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
trace_tree-0.3.6 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.5 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.4 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.3 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.2 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.1 lib/trace_tree/short_gem_path.rb
trace_tree-0.3.0 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.23 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.22 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.21 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.20 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.19 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.18 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.17 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.16 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.15 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.14 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.13 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.12 lib/trace_tree/short_gem_path.rb
trace_tree-0.2.11 lib/trace_tree/short_gem_path.rb