From 0a4dec32fb31ddfc9c5f658c7eb9789580cc6741 Mon Sep 17 00:00:00 2001 From: John Mair Date: Mon, 28 Feb 2011 04:04:48 +1300 Subject: version 0.3.2, added more tests and improved some code --- lib/method_source/source_location.rb | 6 +++++- lib/method_source/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/method_source') 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 -- cgit v1.2.1