Module: Compass::Configuration

### Home Classes Methods

### In Files

- lib/compass/configuration.rb
- lib/compass/configuration/adapters.rb
- lib/compass/configuration/data.rb
- lib/compass/configuration/defaults.rb
- lib/compass/configuration/inheritance.rb
- lib/compass/configuration/watch.rb

### Namespace

- MODULE Compass::Configuration::Adapters
- MODULE Compass::Configuration::Defaults
- MODULE Compass::Configuration::Inheritance
- MODULE Compass::Configuration::Paths
- CLASS Compass::Configuration::Data
- CLASS Compass::Configuration::Watch

### Methods

- ::add_configuration_property
- ::attributes_for_directory
- ::remove_configuration_property

### Class/Module Index

Quicksearch

- Compass
- Compass::BrowserSupport
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Watch
- Compass::Core
- Compass::Core::CanIUse
- Compass::Core::SassExtensions
- Compass::Core::SassExtensions::Functions
- Compass::Core::SassExtensions::Functions::Colors
- Compass::Core::SassExtensions::Functions::Configuration
- Compass::Core::SassExtensions::Functions::Constants
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::Core::SassExtensions::Functions::Display
- Compass::Core::SassExtensions::Functions::Enumerate
- Compass::Core::SassExtensions::Functions::Env
- Compass::Core::SassExtensions::Functions::Files
- Compass::Core::SassExtensions::Functions::FontFiles
- Compass::Core::SassExtensions::Functions::GradientSupport
- Compass::Core::SassExtensions::Functions::GradientSupport::Assertions
- Compass::Core::SassExtensions::Functions::GradientSupport::CSS3AngleToSVGConverter
- Compass::Core::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::Core::SassExtensions::Functions::GradientSupport::Functions
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::Core::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::Core::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::Core::SassExtensions::Functions::ImageSize
- Compass::Core::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::Core::SassExtensions::Functions::ImageSize::JPEG
- Compass::Core::SassExtensions::Functions::InlineImage
- Compass::Core::SassExtensions::Functions::Lists
- Compass::Core::SassExtensions::Functions::Math
- Compass::Core::SassExtensions::Functions::SassDeclarationHelper
- Compass::Core::SassExtensions::Functions::Selectors
- Compass::Core::SassExtensions::Functions::Urls
- Compass::Core::SassExtensions::Functions::Urls::FontUrl
- Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::Core::SassExtensions::Functions::Urls::ImageUrl
- Compass::Core::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::Error
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::HasDeprecatedConstantsFromCore
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::Util
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Script::Value
- Sass::Script::Value::ArgList
- Sass::Script::Value::Base
- Sass::Script::Value::List
- Sass::Script::Value::Map
- Sass::Tree
- Sass::Tree::Node

No matching classes.

# Compass::Configuration

### Constants

ARRAY_ATTRIBUTES
ARRAY_ATTRIBUTE_OPTIONS
ATTRIBUTES
RUNTIME_READONLY_ATTRIBUTES

### Public Class Methods

add_configuration_property(name, comment = nil, &default) click to toggle source

Registers a new configuration property. Extensions can use this to add new configuration options to compass.

@param [Symbol] name The name of the property. @param [String] comment A comment for the property. @param [Proc] default A method to calculate the default value for the property.

    The proc is executed in the context of the project's configuration data.

    # File lib/compass/configuration.rb, line 21
    def add_configuration_property(name, comment = nil, &default)
      ATTRIBUTES << name
      if comment.is_a?(String)
        unless comment[0..0] == "#"
          comment = "# #{comment}"
        end
        unless comment[-1..-1] == "\n"
          comment = comment + "\n"
        end
        Data.class_eval           def comment_for_#{name}          #{comment.inspect}          end
      end
      Data.send(:define_method, :"default_#{name}", &default) if default
      Data.inherited_accessor(name)
      if name.to_s =~ /dir|path/
        Data.strip_trailing_separator(name)
      end
    end

attributes_for_directory(dir_name, http_dir_name = dir_name) click to toggle source

    # File lib/compass/configuration.rb, line 5
    def attributes_for_directory(dir_name, http_dir_name = dir_name)
      [
        "#{dir_name}_dir",
        "#{dir_name}_path",
        ("http_#{http_dir_name}_dir" if http_dir_name),
        ("http_#{http_dir_name}_path" if http_dir_name)
      ].compact.map{|a| a.to_sym}
    end

remove_configuration_property(name) click to toggle source

For testing purposes

    # File lib/compass/configuration.rb, line 44
    def remove_configuration_property(name)
      ATTRIBUTES.delete(name)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.