lib/nanoc/base/plugin_registry.rb
# Returns a list of all plugins. The returned list of plugins is an array
# with array elements in the following format:
#
#   { :class => ..., :superclass => ..., :identifiers => ... }
#
# @return [Array<Hash>] A list of all plugins in the format described
Returns a list of all plugins. The returned list of plugins is an array
with array elements in the following format.


Returns a list of all plugins . The returned list of plugins is an array with array elements in the following format .
def all
      plugins = []
      @identifiers_to_classes.each_pair do |superclass, submap|
        submap.each_pair do |identifier, klass|
          existing_plugin = plugins.find do |p|
            p[:class] == klass && p[:superclass] == superclass
          end
          if existing_plugin
            existing_plugin[:identifiers] << identifier
            existing_plugin[:identifiers] = existing_plugin[:identifiers].sort_by { |s| s.to_s }
          else
            plugins << {
              :class       => klass,
              :superclass  => superclass,
              :identifiers => [ identifier ]
            }
          end
        end
      end
      plugins
    end
def all plugins = [ ] @identifiers_to_classes . each_pair do | superclass , submap | submap . each_pair do | identifier , klass | existing_plugin = plugins . find do | p | p [ :class ] == klass && p [ :superclass ] == superclass end if existing_plugin existing_plugin [ :identifiers ] << identifier existing_plugin [ :identifiers ] = existing_plugin [ :identifiers ] . sort_by { | s | s . to_s } else plugins << { :class => klass , :superclass => superclass , :identifiers => [ identifier ] } end end end plugins end
Returns a list of all plugins.
Returns a list of all plugins .
# Find existing plugin # Add identifier to existing plugin # Create new plugin
A list of all plugins in the format described
A list of all plugins in the format described
Array<Hash>