Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions lib/method_source/source_location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ module MethodExtensions
include ReeSourceLocation

elsif defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
require 'java'

# JRuby version source_location hack
# @return [Array] A two element array containing the source location of the method
def source_location
to_java.source_location(Thread.current.to_java.getContext())
end
# noop - source_location provided natively
else


def trace_func(event, file, line, id, binding, classname)
return unless event == 'call'
set_trace_func nil
Expand Down Expand Up @@ -83,17 +76,9 @@ module UnboundMethodExtensions
include ReeSourceLocation

elsif defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
require 'java'

# JRuby version source_location hack
# @return [Array] A two element array containing the source location of the method
def source_location
to_java.source_location(Thread.current.to_java.getContext())
end

# noop - source_location provided natively
else


# Return the source location of an instance method for Ruby 1.8.
# @return [Array] A two element array. First element is the
# file, second element is the line in the file where the
Expand Down