def parse_plugin_info(namespace, plugin_type, base_path, file)
    dir_components   = base_path.split(File::SEPARATOR)
    file_components  = file.split(File::SEPARATOR)

    file_name        = file_components.pop.sub(/\.rb/, '')
    directory        = file_components.join(File::SEPARATOR)

    file_class       = sanitize_class(file_name)
    group_components = directory.sub(/^#{base_path}#{File::SEPARATOR}?/, '').split(File::SEPARATOR)

    class_components = [ sanitize_class(namespace), sanitize_class(plugin_type) ]

    if ! group_components.empty?
      group_name       = group_components.collect {|elem| elem.downcase  }.join('_')
      provider         = [ group_name, file_name ].join('_')

      group_components = group_components.collect {|elem| sanitize_class(elem) }
      class_components = [ class_components, group_components, file_class ].flatten
    else
      provider         = file_name
      class_components = [ class_components, file_class ].flatten
    end

    {
      :directory        => directory,
      :provider         => sanitize_id(provider),
      :class_components => class_components
    }
  end
def parse_plugin_info(namespace, plugin_type, base_path, file)
    dir_components   = base_path.split(File::SEPARATOR)
    file_components  = file.split(File::SEPARATOR)

    file_name        = file_components.pop.sub(/\.rb/, '')
    directory        = file_components.join(File::SEPARATOR)

    file_class       = sanitize_class(file_name)
    group_components = directory.sub(/^#{base_path}#{File::SEPARATOR}?/, '').split(File::SEPARATOR)

    class_components = [ sanitize_class(namespace), sanitize_class(plugin_type) ]

    if ! group_components.empty?
      group_name       = group_components.collect {|elem| elem.downcase  }.join('_')
      provider         = [ group_name, file_name ].join('_')

      group_components = group_components.collect {|elem| sanitize_class(elem) }
      class_components = [ class_components, group_components, file_class ].flatten
    else
      provider         = file_name
      class_components = [ class_components, file_class ].flatten
    end

    {
      :directory        => directory,
      :provider         => sanitize_id(provider),
      :class_components => class_components
    }
  end
Parse plugin information for a specified namespace and 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*
   - [Hash<Symbol|ANY>]  Returns a hash of the parsed plugin information

 * *Errors*

 See also:
 - #sanitize_id
 - #sanitize_class