### Home Classes Methods

### In Files

- lib/compass/configuration/data.rb

### Parent

Object

### Methods

- ::new
- #add_import_path
- #asset_cache_buster
- #asset_host
- #discover
- #load
- #relative_assets?
- #require
- #set_all
- #watch
- #watches

### Included Modules

- Compass::Configuration::Inheritance
- Compass::Configuration::Serialization
- Compass::Configuration::Adapters

### Class/Module Index

Quicksearch

- Compass
- Compass::Actions
- Compass::AppIntegration
- Compass::AppIntegration::Helpers
- Compass::AppIntegration::Rails
- Compass::AppIntegration::StandAlone
- Compass::AppIntegration::StandAlone::ConfigurationDefaults
- Compass::AppIntegration::StandAlone::Installer
- Compass::BrowserSupport
- Compass::Commands
- Compass::Commands::Base
- Compass::Commands::CleanProject
- Compass::Commands::CleanProjectOptionsParser
- Compass::Commands::CompileProjectOptionsParser
- Compass::Commands::ConfigurationOptionsParser
- Compass::Commands::CreateProject
- Compass::Commands::CreateProjectOptionsParser
- Compass::Commands::Default
- Compass::Commands::DefaultOptionsParser
- Compass::Commands::ExtensionCommand
- Compass::Commands::ExtensionOptionsParser
- Compass::Commands::ExtensionsOptionParser
- Compass::Commands::GenerateGridBackground
- Compass::Commands::GridBackgroundOptionsParser
- Compass::Commands::Help
- Compass::Commands::HelpOptionsParser
- Compass::Commands::Imports
- Compass::Commands::InstallerCommand
- Compass::Commands::Interactive
- Compass::Commands::InteractiveOptionsParser
- Compass::Commands::ListFrameworks
- Compass::Commands::MemoryDebugger
- Compass::Commands::PrintVersion
- Compass::Commands::ProjectBase
- Compass::Commands::ProjectStats
- Compass::Commands::Registry
- Compass::Commands::Sprite
- Compass::Commands::SpriteOptionsParser
- Compass::Commands::StampPattern
- Compass::Commands::StampPatternOptionsParser
- Compass::Commands::StatsOptionsParser
- Compass::Commands::StructureOptionsParser
- Compass::Commands::UnpackExtension
- Compass::Commands::UpdateProject
- Compass::Commands::ValidateProject
- Compass::Commands::ValidationOptionsParser
- Compass::Commands::VersionOptionsParser
- Compass::Commands::WatchProject
- Compass::Commands::WatchProjectOptionsParser
- Compass::Commands::WriteConfiguration
- Compass::Compiler
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Comments
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::FileData
- Compass::Configuration::Helpers
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Serialization
- Compass::Error
- Compass::Exec
- Compass::Exec::CommandOptionParser
- Compass::Exec::GlobalOptionsParser
- Compass::Exec::Helpers
- Compass::Exec::ProjectOptionsParser
- Compass::Exec::SubCommandUI
- Compass::Exec::SwitchUI
- Compass::FilesystemConflict
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::GridBuilder
- Compass::Installers
- Compass::Installers::BareInstaller
- Compass::Installers::Base
- Compass::Installers::Manifest
- Compass::Installers::Manifest::Entry
- Compass::Installers::ManifestInstaller
- Compass::Installers::TemplateContext
- Compass::Logger
- Compass::MissingDependency
- Compass::NullLogger
- Compass::PNG
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::SassExtensions::Functions::Colors
- Compass::SassExtensions::Functions::Constants
- Compass::SassExtensions::Functions::CrossBrowserSupport
- Compass::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::SassExtensions::Functions::Display
- Compass::SassExtensions::Functions::Enumerate
- Compass::SassExtensions::Functions::Env
- Compass::SassExtensions::Functions::FontFiles
- Compass::SassExtensions::Functions::GradientSupport
- Compass::SassExtensions::Functions::GradientSupport::Assertions
- Compass::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::SassExtensions::Functions::GradientSupport::Functions
- Compass::SassExtensions::Functions::GradientSupport::Gradient
- Compass::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::SassExtensions::Functions::ImageSize
- Compass::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::SassExtensions::Functions::ImageSize::JPEG
- Compass::SassExtensions::Functions::InlineImage
- Compass::SassExtensions::Functions::Lists
- Compass::SassExtensions::Functions::Math
- Compass::SassExtensions::Functions::Selectors
- Compass::SassExtensions::Functions::Sprites
- Compass::SassExtensions::Functions::Sprites::VariableReader
- Compass::SassExtensions::Functions::Urls
- Compass::SassExtensions::Functions::Urls::FontUrl
- Compass::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::SassExtensions::Functions::Urls::ImageUrl
- Compass::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::SassExtensions::Sprites
- Compass::SassExtensions::Sprites::ChunkyPngEngine
- Compass::SassExtensions::Sprites::Engine
- Compass::SassExtensions::Sprites::Image
- Compass::SassExtensions::Sprites::ImageMethods
- Compass::SassExtensions::Sprites::ImageRow
- Compass::SassExtensions::Sprites::LayoutMethods
- Compass::SassExtensions::Sprites::RowFitter
- Compass::SassExtensions::Sprites::SpriteMap
- Compass::SassExtensions::Sprites::SpriteMethods
- Compass::SpriteException
- Compass::SpriteImporter
- Compass::Sprites
- Compass::Sprites::Binding
- Compass::Stats
- Compass::Stats::CssFile
- Compass::Stats::SassFile
- Compass::Stats::StatsVisitor
- Compass::TestCase
- Compass::Util
- Compass::Version
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Tree
- Sass::Tree::Node
- QuickCache

No matching classes.

# Compass::Configuration::Data

The Compass configuration data storage class manages configuration data that comes from a variety of different sources and aggregates them together into a consistent API Some of the possible sources of configuration data:

    * Compass default project structure for stand alone projects
    * App framework specific project structures for rails, etc.
    * User supplied explicit configuration
    * Configuration data provided via the command line interface

There are two kinds of configuration data that doesn’t come from the user:

1. Configuration data that is defaulted as if the user had provided it themselves. This is useful for providing defaults that the user is likely to want to edit but shouldn't have to provide explicitly when getting started

2. Configuration data that is defaulted behind the scenes because some value is required.

### Attributes

name[R]

### Public Class Methods

new(name, attr_hash = nil) click to toggle source

    # File lib/compass/configuration/data.rb, line 65
    def initialize(name, attr_hash = nil)
      raise "I need a name!" unless name
      @name = name
      set_all(attr_hash) if attr_hash
      self.top_level = self
    end

### Public Instance Methods

add_import_path(*paths) click to toggle source

    # File lib/compass/configuration/data.rb, line 81
    def add_import_path(*paths)
      paths.map!{|p| defined?(Pathname) && Pathname === p ? p.to_s : p}
      # The @added_import_paths variable works around an issue where
      # the additional_import_paths gets overwritten during parse
      @added_import_paths ||= []
      @added_import_paths += paths
      self.additional_import_paths ||= []
      self.additional_import_paths += paths
    end

asset_cache_buster(simple = nil, &block) click to toggle source

When called with a block, defines the cache buster strategy to be used. If the block returns nil or a string, then it is appended to the url as a query parameter. In this case, the returned string must not include the starting ‘?’. The block may also return a hash with :path and/or :query values and it will replace the original path and query string with the busted values returned. The block will be passed the root-relative url of the asset. If the block accepts two arguments, it will also be passed a File object that points to the asset on disk – which may or may not exist. When called without a block, returns the block that was previously set.

To disable the asset cache buster:

    asset_cache_buster :none

    # File lib/compass/configuration/data.rb, line 122
    def asset_cache_buster(simple = nil, &block)
      @set_attributes ||= {}
      if block_given?
        @set_attributes[:asset_cache_buster] = true
        @asset_cache_buster = block
      elsif !simple.nil?
        if simple == :none
          @set_attributes[:asset_cache_buster] = true
          @asset_cache_buster = Proc.new {|_,_| nil}
        else
          raise ArgumentError, "Unexpected argument: #{simple.inspect}"
        end
      else
        if set?(:asset_cache_buster)
          @asset_cache_buster
        elsif inherited_data.respond_to?(:asset_cache_buster)
          inherited_data.asset_cache_buster
        end
      end
    end

asset_host(&block) click to toggle source

When called with a block, defines the asset host url to be used. The block must return a string that starts with a protocol (E.g. http). The block will be passed the root-relative url of the asset. When called without a block, returns the block that was previously set.

    # File lib/compass/configuration/data.rb, line 95
    def asset_host(&block)
      @set_attributes ||= {}
      if block_given?
        @set_attributes[:asset_host] = true
        @asset_host = block
      else
        if @asset_host
          @asset_host
        elsif inherited_data.respond_to?(:asset_host)
          inherited_data.asset_host
        end
      end
    end

discover(frameworks_dir) click to toggle source

Finds all extensions within a directory and registers them.

    # File lib/compass/configuration/data.rb, line 170
    def discover(frameworks_dir)
      (self.framework_path ||= []) << frameworks_dir
      Compass::Frameworks.discover frameworks_dir
    end

load(framework_dir) click to toggle source

    # File lib/compass/configuration/data.rb, line 164
    def load(framework_dir)
      (self.loaded_frameworks ||= []) << framework_dir
      Compass::Frameworks.register_directory framework_dir
    end

relative_assets?() click to toggle source

    # File lib/compass/configuration/data.rb, line 175
    def relative_assets?
      # the http_images_path is deprecated, but here for backwards compatibility.
      relative_assets || http_images_path == :relative
    end

require(lib) click to toggle source

Require a compass plugin and capture that it occured so that the configuration serialization works next time.

    # File lib/compass/configuration/data.rb, line 159
    def require(lib)
      (self.required_libraries ||= []) << lib
      super
    end

set_all(attr_hash) click to toggle source

    # File lib/compass/configuration/data.rb, line 72
    def set_all(attr_hash)
      # assert_valid_keys!(attr_hash)
      attr_hash.each do |a, v|
        if self.respond_to?("#{a}=")
          self.send("#{a}=", v)
        end
      end
    end

watch(glob, &block) click to toggle source

    # File lib/compass/configuration/data.rb, line 143
    def watch(glob, &block)
      @watches ||= []
      @watches << [glob, block]
    end

watches() click to toggle source

    # File lib/compass/configuration/data.rb, line 148
    def watches
      if defined?(@watches)
        @watches
      elsif inherited_data.respond_to?(:watches)
        inherited_data.watches
      else
        []
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.