diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/method_source/source_location.rb | 6 | ||||
-rw-r--r-- | lib/method_source/version.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/method_source/source_location.rb b/lib/method_source/source_location.rb index 1878b18..f1929e1 100644 --- a/lib/method_source/source_location.rb +++ b/lib/method_source/source_location.rb @@ -1,6 +1,7 @@ module MethodSource module SourceLocation module MethodExtensions + def trace_func(event, file, line, id, binding, classname) return unless event == 'call' set_trace_func nil @@ -8,6 +9,8 @@ module MethodSource @file, @line = file, line raise :found end + + private :trace_func # Return the source location of a method for Ruby 1.8. # @return [Array] A two element array. First element is the @@ -37,7 +40,8 @@ module MethodSource when Class owner when Module - Class.new.tap { |v| v.send(:include, owner) } + method_owner = owner + Class.new { include(method_owner) } end begin diff --git a/lib/method_source/version.rb b/lib/method_source/version.rb index 6a830a9..73cdbab 100644 --- a/lib/method_source/version.rb +++ b/lib/method_source/version.rb @@ -1,3 +1,3 @@ module MethodSource - VERSION = "0.3.0" + VERSION = "0.3.2" end |