Class: Component::Framework::DirectiveProcessor
- Inherits:
-
Sprockets::DirectiveProcessor
- Object
- Sprockets::DirectiveProcessor
- Component::Framework::DirectiveProcessor
- Defined in:
- lib/component/framework/directive_processor.rb
Instance Method Summary collapse
-
#process_require_components_directive(manifest_subpath = "assets/javascripts/app.js") ⇒ Object
‘require_components` requires all the components manifest files in project.
Instance Method Details
#process_require_components_directive(manifest_subpath = "assets/javascripts/app.js") ⇒ Object
‘require_components` requires all the components manifest files in project.
//= require_components assets/javascripts/app.js
will be resolved to {COMPONENT_BASE_DIR}/{COMPONENT_NAME}/assets/javascripts/app.js
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/component/framework/directive_processor.rb', line 9 def process_require_components_directive(manifest_subpath = "assets/javascripts/app.js") # gather component manifests with absolute paths. manifests_paths = Component::Framework.get_component_names .map {|name| Component::Framework.components_base_dir.join(name, manifest_subpath).to_s} .select { |path| File.exist?(path) } .sort # add predictability to require order manifests_paths.each { |path| @required << _resolve_absolute(path, accept: @content_type, pipeline: :self) } end |