lib/octopress-ink.rb in octopress-ink-1.0.0.alpha.43 vs lib/octopress-ink.rb in octopress-ink-1.0.0.alpha.44

- old
+ new

@@ -25,14 +25,26 @@ if defined? Octopress::Command require 'octopress-ink/commands/helpers' require 'octopress-ink/commands' end + # Register a new plugin + # + # plugin - A subclass of Plugin + # def self.register_plugin(plugin) Plugins.register_plugin(plugin) end + # Create a new plugin from a configuration hash + # + # options - A hash of configuration options. + # + def self.new_plugin(options) + Plugins.register_plugin Plugin, options + end + def self.version version = "Jekyll v#{Jekyll::VERSION}, " if defined? Octopress::VERSION version << "Octopress v#{Octopress::VERSION} " end @@ -63,18 +75,18 @@ end end # Prints a list of plugins and details # - # options - a Hash of options from the Info command + # options - a Hash of options from the `list` command # # Note: if options are empty, this will display a - # list of plugin names, versions, and descriptions, + # list of plugin names, slugs, versions, and descriptions, # but no assets, i.e. 'minimal' info. # # - def self.info(options={}) + def self.list(options={}) Plugins.register site(options) options = {'minimal'=>true} if options.empty? message = "Octopress Ink - v#{VERSION}\n" if plugins.size > 0 @@ -95,12 +107,12 @@ else not_found(name) end end - def self.copy_plugin_assets(name, path, options) + def self.copy_plugin_assets(name, options) Plugins.register site(options) - if path + if path = options.delete('path') full_path = File.join(Plugins.site.source, path) if !Dir["#{full_path}/*"].empty? && options['force'].nil? abort "Error: directory #{path} is not empty. Use --force to overwrite files." end else