Class: Module

Inherits:
Object show all
Defined in:
lib/directory_template/blank_slate.rb

Overview

Extensions to Module for DirectoryTemplate::BlankSlate. Modules included into Object need to be scanned and have their instance methods removed from DirectoryTemplate::BlankSlate. In theory, modules included into Kernel would have to be removed as well, but a "feature" of Ruby prevents late includes into modules from being exposed in the first place.

Instance Method Summary collapse

Instance Method Details

#append_features(mod) ⇒ Object

Monkey patch to the append_features callback of Module, used to update the BlankSlate.



145
146
147
148
149
150
151
152
# File 'lib/directory_template/blank_slate.rb', line 145

def append_features(mod)
  result = template_directory_blank_slate_method_added(mod)
  return result if mod != Object
  instance_methods.each do |name|
    DirectoryTemplate::BlankSlate.hide(name)
  end
  result
end

#template_directory_blank_slate_method_addedObject

Preserve the original method



141
# File 'lib/directory_template/blank_slate.rb', line 141

alias template_directory_blank_slate_method_added append_features