Class: Middleman::Presentation::AssetComponent

Inherits:
Component
  • Object
show all
Defined in:
lib/middleman-presentation-core/asset_component.rb

Overview

A asset component

It represents a asset component. A asset component can contain JavaScript-files, stylesheets, images, fonts, … . A asset component knows where to get a the files from in filesystem, which version of the component is required and which JavaScript-files and stylesheets should be includes in “javascripts/application.js” and “stylesheets”application.scss“.

Instance Attribute Summary collapse

Attributes inherited from Component

#ignorable_files, #importable_files, #loadable_files, #name, #output_paths, #resource_locator, #version

Instance Method Summary collapse

Methods inherited from Component

#<=>, #fetchable?

Constructor Details

#initialize(path:, base_path: path, name: path, **args) ⇒ AssetComponent

An asset component

Parameters:

  • path (String)

    The directory where all assets files can be found which belong to this component

See Also:

  • For all other params


21
22
23
24
25
26
27
# File 'lib/middleman-presentation-core/asset_component.rb', line 21

def initialize(path:, base_path: path, name: path, **args)
  super(**args)

  @path = Pathname.new(path)
  @name = name
  @base_path = Pathname.new(base_path)
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



13
14
15
# File 'lib/middleman-presentation-core/asset_component.rb', line 13

def base_path
  @base_path
end

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/middleman-presentation-core/asset_component.rb', line 13

def path
  @path
end

Instance Method Details

#root_directoryObject



29
# File 'lib/middleman-presentation-core/asset_component.rb', line 29

def root_directory; end

#root_directory=Object



31
# File 'lib/middleman-presentation-core/asset_component.rb', line 31

def root_directory=(*); end