summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Irwin <conrad.irwin@gmail.com>2011-10-01 18:52:32 -0700
committerConrad Irwin <conrad.irwin@gmail.com>2011-10-01 18:52:32 -0700
commitca9ac8ee73a1fc19f7f83c689c7ec975cdccaee9 (patch)
tree74c97f783963fcf650d4febe69dc254d2fde4a44
parent88d94d470dd5b6fba97e448d5f8205df2d6b448b (diff)
downloadmethod_source-ca9ac8ee73a1fc19f7f83c689c7ec975cdccaee9.tar.gz
Use syntactically nicer version
-rw-r--r--lib/method_source/source_location.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/method_source/source_location.rb b/lib/method_source/source_location.rb
index 6cd5e94..faa96c7 100644
--- a/lib/method_source/source_location.rb
+++ b/lib/method_source/source_location.rb
@@ -9,7 +9,7 @@ module MethodSource
module SourceLocation
module MethodExtensions
- if Proc.new {}.respond_to? :__file__
+ if Proc.method_defined? :__file__
include ReeSourceLocation
elsif defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
@@ -52,7 +52,7 @@ module MethodSource
end
module ProcExtensions
- if Proc.new {}.respond_to? :__file__
+ if Proc.method_defined? :__file__
include ReeSourceLocation
elsif defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /rbx/
@@ -79,7 +79,7 @@ module MethodSource
end
module UnboundMethodExtensions
- if Proc.new {}.respond_to? :__file__
+ if Proc.method_defined? :__file__
include ReeSourceLocation
elsif defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/