Sha256: 300a0c1ab8ca4f6ccd2b3a2aa9c79da00b6b353b315e10eaf6ea89d4d742dad6

Contents?: true

Size: 428 Bytes

Versions: 6

Compression:

Stored size: 428 Bytes

Contents

module JazzFingers
  module Commands
    CALLER_METHOD = Pry::CommandSet.new do
      command "caller_method" do |depth|
        depth = depth.to_i || 1
        if /^(.+?):(\d+)(?::in `(.*)')?/ =~ caller(depth+1).first
          file   = Regexp.last_match[1]
          line   = Regexp.last_match[2].to_i
          method = Regexp.last_match[3]
          output.puts [file, line, method]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jazz_fingers-6.2.0 lib/jazz_fingers/commands/caller_method.rb
jazz_fingers-6.1.0 lib/jazz_fingers/commands/caller_method.rb
jazz_fingers-6.0.0.pre.rc1 lib/jazz_fingers/commands/caller_method.rb
jazz_fingers-5.2.2 lib/jazz_fingers/commands/caller_method.rb
jazz_fingers-5.2.1 lib/jazz_fingers/commands/caller_method.rb
jazz_fingers-5.2.0 lib/jazz_fingers/commands/caller_method.rb