Module: Compass::Configuration::Adapters

### Home Classes Methods

### In Files

- lib/compass/configuration/adapters.rb

### Methods

- #absolute_path?
- #resolve_additional_import_paths
- #sass_load_paths
- #to_compiler_arguments
- #to_sass_engine_options
- #to_sass_plugin_options

### 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::Adapters

The adapters module provides methods that make configuration data from a compass project adapt to various consumers of configuration data

### Public Instance Methods

absolute_path?(path) click to toggle source

    # File lib/compass/configuration/adapters.rb, line 46
    def absolute_path?(path)
      # Pretty basic implementation
      path.index(File::SEPARATOR) == 0 || path.index(':') == 1
    end

resolve_additional_import_paths() click to toggle source

    # File lib/compass/configuration/adapters.rb, line 36
    def resolve_additional_import_paths
      (additional_import_paths || []).map do |path|
        if path.is_a?(String) && project_path && !absolute_path?(path)
          File.join(project_path, path)
        else
          path
        end
      end
    end

sass_load_paths() click to toggle source

    # File lib/compass/configuration/adapters.rb, line 61
    def sass_load_paths
      load_paths = []
      load_paths << sass_path if sass_path
      Compass::Frameworks::ALL.each do |f|
        load_paths << f.stylesheets_directory if File.directory?(f.stylesheets_directory)
      end
      load_paths += resolve_additional_import_paths
      load_paths.map! do |p|
        next p if p.respond_to?(:find_relative)
        Sass::Importers::Filesystem.new(p.to_s)
      end
      load_paths << Compass::SpriteImporter.new
      load_paths
    end

to_compiler_arguments(additional_options = {}) click to toggle source

    # File lib/compass/configuration/adapters.rb, line 6
    def to_compiler_arguments(additional_options = {})
      [project_path, sass_path, css_path, to_sass_engine_options.merge(additional_options)]
    end

to_sass_engine_options() click to toggle source

    # File lib/compass/configuration/adapters.rb, line 51
    def to_sass_engine_options
      engine_opts = {:load_paths => sass_load_paths}
      engine_opts[:style] = output_style if output_style
      engine_opts[:line_comments] = line_comments
      engine_opts[:cache] = cache
      engine_opts[:cache_location] = cache_path
      engine_opts[:quiet] = disable_warnings if disable_warnings
      engine_opts.merge!(sass_options || {})
    end

to_sass_plugin_options() click to toggle source

    # File lib/compass/configuration/adapters.rb, line 10
    def to_sass_plugin_options
      locations = []
      locations << [sass_path, css_path] if sass_path && css_path
      Compass::Frameworks::ALL.each do |framework|
        locations << [framework.stylesheets_directory, File.join(css_path || css_dir || ".", framework.name)]
      end
      load_paths = []
      resolve_additional_import_paths.each do |additional_path|
        if additional_path.is_a?(String)
          locations << [additional_path, File.join(css_path || css_dir || ".", File.basename(additional_path))]
        else
          load_paths << additional_path
        end
      end
      plugin_opts = {:template_location => locations}
      plugin_opts[:style] = output_style if output_style
      plugin_opts[:line_comments] = line_comments
      plugin_opts[:cache] = cache unless cache.nil?
      plugin_opts[:cache_location] = cache_path unless cache_path.nil?
      plugin_opts.merge!(sass_options || {})
      plugin_opts[:load_paths] ||= []
      plugin_opts[:load_paths] += load_paths
      plugin_opts[:load_paths] << Compass::SpriteImporter.new
      plugin_opts
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.