Module: Kernel

Defined in:
lib/gem/commands/new_command/blank_slate.rb

Overview

Since Ruby is very dynamic, methods added to the ancestors of BlankSlate after BlankSlate is defined will show up in the list of available BlankSlate methods. We handle this by defining a hook in the Object and Kernel classes that will hide any method defined after BlankSlate has been loaded.

Class Method Summary collapse

Class Method Details

.gemnew_blank_slate_method_addedObject



72
# File 'lib/gem/commands/new_command/blank_slate.rb', line 72

alias gemnew_blank_slate_method_added method_added

.method_added(name) ⇒ Object

Detect method additions to Kernel and remove them in the BlankSlate class.



76
77
78
79
80
81
# File 'lib/gem/commands/new_command/blank_slate.rb', line 76

def method_added(name)
  result = gemnew_blank_slate_method_added(name)
  return result if self != Kernel
  Gem::Commands::NewCommand::BlankSlate.hide(name)
  result
end