Last active
December 15, 2015 12:59
-
-
Save dirk/5264004 to your computer and use it in GitHub Desktop.
Fix for bug in Rails 2.3's vendored BlankSlate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.gem "toml", :version => "0.0.4" | |
class BlankSlate | |
class << self | |
# Hide the method named +name+ in the BlankSlate class. Don't | |
# hide +instance_eval+ or any method beginning with "__". | |
def hide(name) | |
# CHANGED: if instance_methods.include?(name.to_s) and | |
if instance_methods.include?(name.to_sym) and | |
name !~ /^(__|instance_eval)/ | |
@hidden_methods ||= {} | |
@hidden_methods[name.to_sym] = instance_method(name) | |
undef_method name | |
end | |
end | |
end | |
end | |
require "toml" | |
# Initializes the Context class so that all its `hide`s get called. | |
_ = Parslet::Transform::Context.new([]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment