Skip to content
Browse files

Fix Mapping#constant_defined? in Ruby 2.1.0:

Ruby 2.1.0 changed the behavior of Module#const_defined?. Previously it
would always return true if the constant was autoloaded, now it will
attempt to the load the constant.
  • Loading branch information...
1 parent 0aef4b3 commit 9589652c569760298f2647f7a0f9ed4f85129f20 @judofyr judofyr committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tilt/mapping.rb
2 lib/tilt/mapping.rb
@@ -256,8 +256,8 @@ def lazy_load(pattern)
def constant_defined?(name)
name.split('::').inject(Object) do |scope, n|
- return false unless scope.const_defined?(n)
return false if scope.autoload?(n) # skip autload
+ return false unless scope.const_defined?(n)

0 comments on commit 9589652

Please sign in to comment.
Something went wrong with that request. Please try again.