Class: Middleman::WebComponents

Inherits:
Extension
  • Object
show all
Defined in:
lib/middleman-web_components.rb

Instance Method Summary collapse

Instance Method Details

#manipulate_resource_list(resources) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/middleman-web_components.rb', line 8

def manipulate_resource_list(resources)
  resources.collect do |resource|
    next resource if resource.ignored?
    next resource unless resource.path.start_with? options.directory
    content = `#{options.command} #{resource.source_file}`
    resource = Middleman::Sitemap::StringResource.new(app.sitemap, resource.path, content)
    resource.destination_path = Pathname(resource.path).sub_ext(options.suffix).to_path unless resource.ext == options.suffix
    resource
  end
end