Class: Compass::Frameworks::Framework
- Inherits:
-
Object
- Object
- Compass::Frameworks::Framework
- Defined in:
- lib/compass/frameworks.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#stylesheets_directory ⇒ Object
Returns the value of attribute stylesheets_directory.
-
#templates_directory ⇒ Object
Returns the value of attribute templates_directory.
Instance Method Summary collapse
-
#initialize(name, *arguments) ⇒ Framework
constructor
A new instance of Framework.
- #manifest(pattern, options = {}) ⇒ Object
- #manifest_file(pattern) ⇒ Object
- #template_directories ⇒ Object
Constructor Details
#initialize(name, *arguments) ⇒ Framework
Returns a new instance of Framework.
11 12 13 14 15 16 17 |
# File 'lib/compass/frameworks.rb', line 11 def initialize(name, *arguments) = arguments.last.is_a?(Hash) ? arguments.pop : {} path = [:path] || arguments.shift @name = name @templates_directory = [:templates_directory] || File.join(path, 'templates') @stylesheets_directory = [:stylesheets_directory] || File.join(path, 'stylesheets') end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/compass/frameworks.rb', line 9 def name @name end |
#stylesheets_directory ⇒ Object
Returns the value of attribute stylesheets_directory.
10 11 12 |
# File 'lib/compass/frameworks.rb', line 10 def stylesheets_directory @stylesheets_directory end |
#templates_directory ⇒ Object
Returns the value of attribute templates_directory.
10 11 12 |
# File 'lib/compass/frameworks.rb', line 10 def templates_directory @templates_directory end |
Instance Method Details
#manifest(pattern, options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/compass/frameworks.rb', line 24 def manifest(pattern, = {}) [:pattern_name] ||= pattern Compass::Installers::Manifest.new(manifest_file(pattern), ) end |
#manifest_file(pattern) ⇒ Object
21 22 23 |
# File 'lib/compass/frameworks.rb', line 21 def manifest_file(pattern) File.join(templates_directory, pattern.to_s, "manifest.rb") end |
#template_directories ⇒ Object
18 19 20 |
# File 'lib/compass/frameworks.rb', line 18 def template_directories Dir.glob(File.join(templates_directory, "*")).map{|f| File.basename(f)} end |