Skip to content

Instantly share code, notes, and snippets.

@dirk
Last active December 15, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dirk/5264004 to your computer and use it in GitHub Desktop.
Save dirk/5264004 to your computer and use it in GitHub Desktop.
Fix for bug in Rails 2.3's vendored BlankSlate.
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