Skip to content
Browse files

Expose loaded plugins

  • Loading branch information...
1 parent f69dc03 commit 9e0cf881250cf6ea7774060ad3f4eb258d4a803c @jnordberg committed Mar 21, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/environment.coffee
View
6 src/core/environment.coffee
@@ -25,6 +25,7 @@ class Environment
constructor: (@config, @workDir, @logger) ->
@views = {}
@generators = []
+ @plugins = {}
@templatePlugins = []
@contentPlugins = []
@@ -70,7 +71,8 @@ class Environment
factory method. The *group* argument is used to group the loaded instances under
each directory. I.e. plugin instances with the group 'textFiles' can be found
in `contents.somedir._.textFiles`. ###
- @logger.verbose "registering template plugin that handles: #{ pattern }"
+ @logger.verbose "registering content plugin #{ plugin.name } that handles: #{ pattern }"
+ @plugins[plugin.name] = plugin
@contentPlugins.push
group: group
pattern: pattern
@@ -79,6 +81,8 @@ class Environment
registerTemplatePlugin: (pattern, plugin) ->
### Add a template *plugin* to the environment. All files in the template directory
matching the glob *pattern* will be passed to the plugin's `fromFile` classmethod. ###
+ @logger.verbose "registering template plugin #{ plugin.name } that handles: #{ pattern }"
+ @plugins[plugin.name] = plugin
@templatePlugins.push
pattern: pattern
class: plugin

0 comments on commit 9e0cf88

Please sign in to comment.
Something went wrong with that request. Please try again.