From ca9ac8ee73a1fc19f7f83c689c7ec975cdccaee9 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sat, 1 Oct 2011 18:52:32 -0700 Subject: Use syntactically nicer version --- lib/method_source/source_location.rb | 6 +++--- 1 file 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/ -- cgit v1.2.1