Sha256: 4261f82881663668947496e717e8404173258a0e94e319fa7aa1856a4ad0e825

Contents?: true

Size: 1001 Bytes

Versions: 60

Compression:

Stored size: 1001 Bytes

Contents

module Compass
  module Frameworks
    ALL = []
    class Framework
      attr_accessor :name
      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(path, 'stylesheets')
      end
    end
    def register(name, *arguments)
      ALL << Framework.new(name, *arguments)
    end
    def [](name)
      ALL.detect{|f| f.name.to_s == name.to_s}
    end
    module_function :register, :[]
  end
end

# Import all of the default frameworks.
default_frameworks_directory = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'frameworks'))
Dir.glob(File.join(default_frameworks_directory, "*.rb")).each do |framework|
  require framework
end

Version data entries

60 entries across 60 versions & 8 rubygems

Version Path
alphasights-compass-0.8.12 lib/compass/frameworks.rb
bsherman-compass-0.5.2 lib/compass/frameworks.rb
chriseppstein-compass-0.3.8 lib/compass/frameworks.rb
chriseppstein-compass-0.3.9 lib/compass/frameworks.rb
chriseppstein-compass-0.4.0 lib/compass/frameworks.rb
chriseppstein-compass-0.4.1 lib/compass/frameworks.rb
chriseppstein-compass-0.4.2 lib/compass/frameworks.rb
chriseppstein-compass-0.5.0 lib/compass/frameworks.rb
chriseppstein-compass-0.5.1 lib/compass/frameworks.rb
chriseppstein-compass-0.5.2 lib/compass/frameworks.rb
chriseppstein-compass-0.5.3 lib/compass/frameworks.rb
chriseppstein-compass-0.5.4 lib/compass/frameworks.rb
chriseppstein-compass-0.5.5 lib/compass/frameworks.rb
chriseppstein-compass-0.5.9 lib/compass/frameworks.rb
chriseppstein-compass-0.6.0 lib/compass/frameworks.rb
chriseppstein-compass-0.6.1 lib/compass/frameworks.rb
chriseppstein-compass-0.6.10 lib/compass/frameworks.rb
chriseppstein-compass-0.6.11 lib/compass/frameworks.rb
chriseppstein-compass-0.6.12 lib/compass/frameworks.rb
chriseppstein-compass-0.6.13 lib/compass/frameworks.rb