### Home Classes Methods

### In Files

- lib/compass/commands/update_project.rb

### Parent

Compass::Commands::ProjectBase

### Methods

- ::description
- ::new
- ::option_parser
- ::parse!
- ::parse_arguments!
- ::primary
- ::usage
- #check_for_sass_files!
- #determine_cache_location
- #dry_run?
- #explicit_sass_files
- #new_compiler_instance
- #perform

### 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::Commands::UpdateProject

### Public Class Methods

description(command) click to toggle source

    # File lib/compass/commands/update_project.rb, line 116
    def description(command)
      "Compile Sass stylesheets to CSS"
    end

new(working_path, options) click to toggle source

    # File lib/compass/commands/update_project.rb, line 36
    def initialize(working_path, options)
      super
      assert_project_directory_exists! unless dry_run?
    end

option_parser(arguments) click to toggle source

    # File lib/compass/commands/update_project.rb, line 103
    def option_parser(arguments)
      parser = Compass::Exec::CommandOptionParser.new(arguments)
      parser.extend(Compass::Exec::GlobalOptionsParser)
      parser.extend(Compass::Exec::ProjectOptionsParser)
      parser.extend(CompileProjectOptionsParser)
    end

parse!(arguments) click to toggle source

    # File lib/compass/commands/update_project.rb, line 120
    def parse!(arguments)
      parser = option_parser(arguments)
      parser.parse!
      parse_arguments!(parser, arguments)
      parser.options
    end

parse_arguments!(parser, arguments) click to toggle source

    # File lib/compass/commands/update_project.rb, line 127
    def parse_arguments!(parser, arguments)
      if arguments.size > 0
        parser.options[:project_name] = arguments.shift if File.directory?(arguments.first)
        unless arguments.empty?
          parser.options[:sass_files] = arguments.dup
          parser.options[:force] = true
        end
      end
    end

primary() click to toggle source

    # File lib/compass/commands/update_project.rb, line 114
    def primary; true; end

usage() click to toggle source

    # File lib/compass/commands/update_project.rb, line 110
    def usage
      option_parser([]).to_s
    end

### Public Instance Methods

check_for_sass_files!(compiler) click to toggle source

    # File lib/compass/commands/update_project.rb, line 49
    def check_for_sass_files!(compiler)
      if compiler.sass_files.empty? && !dry_run?
        message = "Nothing to compile. If you're trying to start a new project, you have left off the directory argument.\n"
        message << "Run \"compass -h\" to get help."
        raise Compass::Error, message
      end
    end

determine_cache_location() click to toggle source

    # File lib/compass/commands/update_project.rb, line 98
    def determine_cache_location
      Compass.configuration.cache_path || Sass::Plugin.options[:cache_location] || File.join(working_path, ".sass-cache")
    end

dry_run?() click to toggle source

    # File lib/compass/commands/update_project.rb, line 57
    def dry_run?
      options[:dry_run]
    end

explicit_sass_files() click to toggle source

    # File lib/compass/commands/update_project.rb, line 87
    def explicit_sass_files
      return unless options[:sass_files]
      options[:sass_files].map do |sass_file|
        if absolute_path? sass_file
          sass_file
        else
          File.join(Dir.pwd, sass_file)
        end
      end
    end

new_compiler_instance(additional_options = {}) click to toggle source

    # File lib/compass/commands/update_project.rb, line 61
    def new_compiler_instance(additional_options = {})
      @compiler_opts ||= begin
        compiler_opts = {:sass => Compass.sass_engine_options}
        compiler_opts.merge!(options)
        compiler_opts[:sass_files] = explicit_sass_files
        compiler_opts[:cache_location] = determine_cache_location
        if options.include?(:debug_info) && options[:debug_info]
          compiler_opts[:sass][:debug_info] = options.delete(:debug_info)
        end
        compiler_opts
      end

      @memory_store ||= Sass::CacheStores::Memory.new
      @backing_store ||= compiler_opts[:cache_store]
      @backing_store ||= Sass::CacheStores::Filesystem.new(determine_cache_location)
      @cache_store ||= Sass::CacheStores::Chain.new(@memory_store, @backing_store)
      @memory_store.reset!

      Compass::Compiler.new(
        working_path,
        Compass.configuration.sass_path,
        Compass.configuration.css_path,
        @compiler_opts.merge(:cache_store => @cache_store).merge(additional_options)
      )
    end

perform() click to toggle source

    # File lib/compass/commands/update_project.rb, line 41
    def perform
      compiler = new_compiler_instance
      check_for_sass_files!(compiler)
      compiler.clean! if compiler.new_config?
      error_count = compiler.run
      failed! if error_count > 0
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.