Module: Rbcli::Configurate

Defined in:
lib/rbcli/configuration/configurate.rb

Overview

Configurate

This plugin class allows declaring configuration blocks dynamically

Defined Under Namespace

Modules: Hooks, Me, Storage

Class Method Summary collapse

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

If a non-existant method is called, we attempt to load the plugin. If the plugin fails to load we display a message to the developer



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rbcli/configuration/configurate.rb', line 31

def self.method_missing(method, *args, &block)
  filename = "#{File.dirname(__FILE__)}/configurate_blocks/#{method.to_s.downcase}.rb"
  if File.exists? filename
    require filename
    self.send method, *args, &block
  else
    msg = "Invalid Configurate plugin called: `#{method}` in file #{File.expand_path caller[0]}"
    Rbcli::log.fatal {msg}
    raise Exception.new msg
  end
end