Class: Compass::Commands::UpdateProject

Inherits:
ProjectBase show all
Defined in:
lib/compass/commands/update_project.rb

Direct Known Subclasses

WatchProject

Instance Attribute Summary

Attributes inherited from ProjectBase

#options, #project_name

Attributes inherited from Base

#options, #working_path

Attributes included from Actions

#logger

Instance Method Summary collapse

Methods inherited from ProjectBase

#execute

Methods inherited from Base

#execute

Methods included from Actions

#basename, #compile, #copy, #directory, #relativize, #remove, #separate, #strip_trailing_separator, #write_file

Constructor Details

#initialize(working_path, options) ⇒ UpdateProject

Returns a new instance of UpdateProject.



8
9
10
11
# File 'lib/compass/commands/update_project.rb', line 8

def initialize(working_path, options)
  super
  assert_project_directory_exists!
end

Instance Method Details

#new_compiler_instance(additional_options = {}) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/compass/commands/update_project.rb', line 24

def new_compiler_instance(additional_options = {})
  Compass::Compiler.new(working_path,
    projectize(Compass.configuration.sass_dir),
    projectize(Compass.configuration.css_dir),
    Compass.sass_engine_options.merge(:quiet => options[:quiet],
                                      :force => options[:force]).merge(additional_options))
end

#performObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/compass/commands/update_project.rb', line 13

def perform
  compiler = new_compiler_instance
  if compiler.sass_files.empty?
    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
  else
    compiler.run
  end
end