summaryrefslogtreecommitdiff
path: root/lib/method_source
diff options
context:
space:
mode:
authorJohn Mair <jrmair@gmail.com>2011-02-28 04:04:48 +1300
committerJohn Mair <jrmair@gmail.com>2011-02-28 04:04:48 +1300
commit0a4dec32fb31ddfc9c5f658c7eb9789580cc6741 (patch)
tree9ff06405bda9da045b42fe30ffb5dae5724a5aff /lib/method_source
parent52ef85631d136a4ff31c0f4c2587b19db3daf512 (diff)
downloadmethod_source-0a4dec32fb31ddfc9c5f658c7eb9789580cc6741.tar.gz
version 0.3.2, added more tests and improved some code
Diffstat (limited to 'lib/method_source')
-rw-r--r--lib/method_source/source_location.rb6
-rw-r--r--lib/method_source/version.rb2
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