From b021b778943ebbd2022dfccf80fd92804ce68552 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 1 Jan 2009 18:06:37 -0800 Subject: [PATCH] Allow frameworks more control over specifying where the templates and stylesheets are located. --- lib/compass/frameworks.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/compass/frameworks.rb b/lib/compass/frameworks.rb index 58582891..27b50224 100644 --- a/lib/compass/frameworks.rb +++ b/lib/compass/frameworks.rb @@ -3,16 +3,13 @@ module Compass ALL = [] class Framework attr_accessor :name - attr_accessor :path - def initialize(name, path) - self.name = name - self.path = path - end - def template_directory - File.join(self.path, 'templates') - end - def stylesheets_directory - File.join(self.path, 'stylesheets') + attr_accessor :templates_directory, :stylesheets_directory + def initialize(name, *arguments) + options = arguments.last.is_a?(Hash) ? arguments.pop : {} + path = options[:path] || arguments.shift + @name = name + @templates_directory = options[:templates_directory] || File.join(path, 'templates') + @stylesheets_directory = options[:stylesheets_directory] || File.join(self.path, 'stylesheets') end end def register(name, path)