Class: Compass::Commands::UpdateProject
Instance Attribute Summary
Attributes inherited from ProjectBase
#options, #project_name
Attributes inherited from Base
#options, #working_path
Attributes included from Actions
#logger
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from ProjectBase
#execute
Methods inherited from Base
#execute, register
Methods included from Actions
#basename, #compile, #copy, #directory, #process_erb, #relativize, #remove, #separate, #strip_trailing_separator, #write_file
Constructor Details
#initialize(working_path, options) ⇒ UpdateProject
Returns a new instance of UpdateProject.
25
26
27
28
|
# File 'lib/compass/commands/update_project.rb', line 25
def initialize(working_path, options)
super
assert_project_directory_exists! unless dry_run?
end
|
Class Method Details
.description(command) ⇒ Object
67
68
69
|
# File 'lib/compass/commands/update_project.rb', line 67
def description(command)
"Compile Sass stylesheets to CSS"
end
|
.option_parser(arguments) ⇒ Object
.parse!(arguments) ⇒ Object
71
72
73
74
75
76
|
# File 'lib/compass/commands/update_project.rb', line 71
def parse!(arguments)
parser = option_parser(arguments)
parser.parse!
parse_arguments!(parser, arguments)
parser.options
end
|
.parse_arguments!(parser, arguments) ⇒ Object
78
79
80
81
82
83
84
|
# File 'lib/compass/commands/update_project.rb', line 78
def parse_arguments!(parser, arguments)
if arguments.size == 1
parser.options[:project_name] = arguments.shift
elsif arguments.size > 1
raise Compass::Error, "Too many arguments were specified."
end
end
|
.primary ⇒ Object
65
|
# File 'lib/compass/commands/update_project.rb', line 65
def primary; true; end
|
.usage ⇒ Object
61
62
63
|
# File 'lib/compass/commands/update_project.rb', line 61
def usage
option_parser([]).to_s
end
|
Instance Method Details
#dry_run? ⇒ Boolean
41
42
43
|
# File 'lib/compass/commands/update_project.rb', line 41
def dry_run?
options[:dry_run]
end
|
#new_compiler_instance(additional_options = {}) ⇒ Object
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/compass/commands/update_project.rb', line 30
def perform
compiler = new_compiler_instance
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
else
compiler.run
end
end
|