def define_plugin(namespace, plugin_type, base_path, file, &code) # :yields: data
    namespace   = namespace.to_sym
    plugin_type = sanitize_id(plugin_type)
    plugin_info = parse_plugin_info(namespace, plugin_type, base_path, file)

    unless get_hash([ :load_info, namespace, plugin_type ]).has_key?(plugin_info[:provider])
      data = {
        :namespace        => namespace,
        :type             => plugin_type,
        :base_path        => base_path,
        :file             => file,
        :provider         => plugin_info[:provider],
        :directory        => plugin_info[:directory],
        :class_components => plugin_info[:class_components]
      }
      code.call(data) if code

      set([ :load_info, namespace, plugin_type, plugin_info[:provider] ], data)
    end
    self
  end
def define_plugin(namespace, plugin_type, base_path, file, &code) # :yields: data
    namespace   = namespace.to_sym
    plugin_type = sanitize_id(plugin_type)
    plugin_info = parse_plugin_info(namespace, plugin_type, base_path, file)

    unless get_hash([ :load_info, namespace, plugin_type ]).has_key?(plugin_info[:provider])
      data = {
        :namespace        => namespace,
        :type             => plugin_type,
        :base_path        => base_path,
        :file             => file,
        :provider         => plugin_info[:provider],
        :directory        => plugin_info[:directory],
        :class_components => plugin_info[:class_components]
      }
      code.call(data) if code

      set([ :load_info, namespace, plugin_type, plugin_info[:provider] ], data)
    end
    self
  end
*****************************************************************************
 Loaded plugin accessor / modifiers
 Define a new plugin provider of a specified plugin type.

 * *Parameters*
   - [String, Symbol] *namespace*  Namespace that contains plugin types
   - [String, Symbol] *plugin_type*  Plugin type name to fetch default provider
   - [String] *base_path*  Base load path of the plugin provider
   - [String] *file*  File that contains the provider definition

 * *Returns*
   - [Nucleon::Environment]  Returns reference to self for compound operations

 * *Errors*

 * *Yields*
   - [Hash<Symbol|ANY>] *data*  Plugin load information

 See:
 - Nucleon::Config#get_hash
 - Nucleon::Config#set

 See also:
 - #sanitize_id
 - #parse_plugin_info