Skip to content

Instantly share code, notes, and snippets.

@dirk dirk/environment.rb
Last active Dec 15, 2015

What would you like to do?
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
require "toml"
# Initializes the Context class so that all its `hide`s get called.
_ =[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.