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.
-
#path ⇒ Object
Returns the value of attribute path.
-
#stylesheets_directory ⇒ Object
Returns the value of attribute stylesheets_directory.
-
#templates_directory ⇒ Object
Returns the value of attribute templates_directory.
-
#version ⇒ Object
Returns the value of attribute version.
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.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/compass/frameworks.rb', line 12 def initialize(name, *arguments) = arguments.last.is_a?(Hash) ? arguments.pop : {} self.path = path = [:path] || arguments.shift @name = name @templates_directory = [:templates_directory] @templates_directory ||= File.join(path, 'templates') if path @stylesheets_directory = [:stylesheets_directory] @stylesheets_directory ||= File.join(path, 'stylesheets') if path @version = [:version] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/compass/frameworks.rb', line 8 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/compass/frameworks.rb', line 9 def path @path end |
#stylesheets_directory ⇒ Object
Returns the value of attribute stylesheets_directory.
11 12 13 |
# File 'lib/compass/frameworks.rb', line 11 def stylesheets_directory @stylesheets_directory end |
#templates_directory ⇒ Object
Returns the value of attribute templates_directory.
11 12 13 |
# File 'lib/compass/frameworks.rb', line 11 def templates_directory @templates_directory end |
#version ⇒ Object
Returns the value of attribute version.
10 11 12 |
# File 'lib/compass/frameworks.rb', line 10 def version @version end |
Instance Method Details
#manifest(pattern, options = {}) ⇒ Object
35 36 37 38 |
# File 'lib/compass/frameworks.rb', line 35 def manifest(pattern, = {}) [:pattern_name] ||= pattern Compass::Installers::Manifest.new(manifest_file(pattern), ) end |
#manifest_file(pattern) ⇒ Object
31 32 33 |
# File 'lib/compass/frameworks.rb', line 31 def manifest_file(pattern) File.join(templates_directory, pattern.to_s, "manifest.rb") end |
#template_directories ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/compass/frameworks.rb', line 23 def template_directories if templates_directory Dir.glob(File.join(templates_directory, "*")).map{|f| File.basename(f)} else [] end end |