Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add prefixes to component names based on NPM module, refs #49

  • Loading branch information...
commit 01da0bc76180c3157792c95cd5f0e92e707ad03e 1 parent 892f1a6
@bergie bergie authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/lib/ComponentLoader.coffee
View
7 src/lib/ComponentLoader.coffee
@@ -16,10 +16,15 @@ class ComponentLoader
constructor: (@baseDir) ->
+ getModulePrefix: (name) ->
+ name.replace 'noflo-', ''
+
getModuleComponents: (moduleDef) ->
components = {}
checked.push moduleDef.name
+ prefix = @getModulePrefix moduleDef.name
+
# Handle sub-modules
_.each moduleDef.dependencies, (def) =>
return unless checked.indexOf(def.name) is -1
@@ -32,7 +37,7 @@ class ComponentLoader
return components unless moduleDef.noflo
return components unless moduleDef.noflo.components
_.each moduleDef.noflo.components, (cPath, name) ->
- components[name] = path.resolve moduleDef.realPath, cPath
+ components["#{prefix}/#{name}"] = path.resolve moduleDef.realPath, cPath
components
listComponents: (callback) ->
Please sign in to comment.
Something went wrong with that request. Please try again.