Class: Compass::Commands::CreateProject
- Inherits:
-
ProjectBase
- Object
- Base
- ProjectBase
- Compass::Commands::CreateProject
- Includes:
- Installers
- Defined in:
- lib/compass/commands/create_project.rb
Instance Attribute Summary collapse
-
#installer ⇒ Object
Returns the value of attribute installer.
Attributes inherited from ProjectBase
Attributes inherited from Base
Attributes included from Actions
Instance Method Summary collapse
-
#initialize(working_path, options) ⇒ CreateProject
constructor
A new instance of CreateProject.
-
#perform ⇒ Object
all commands must implement perform.
- #project_template_directory ⇒ Object
Methods included from Actions
#basename, #compile, #copy, #directory, #relativize, #separate, #strip_trailing_separator, #write_file
Constructor Details
#initialize(working_path, options) ⇒ CreateProject
Returns a new instance of CreateProject.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/compass/commands/create_project.rb', line 14 def initialize(working_path, ) super(working_path, ) installer_args = [project_template_directory, project_directory, self.] @installer = case [:project_type] when :stand_alone StandAloneInstaller.new *installer_args when :rails RailsInstaller.new *installer_args else raise "Unknown project type: #{project_type}" end end |
Instance Attribute Details
#installer ⇒ Object
Returns the value of attribute installer.
12 13 14 |
# File 'lib/compass/commands/create_project.rb', line 12 def installer @installer end |
Instance Method Details
#perform ⇒ Object
all commands must implement perform
28 29 30 31 32 33 |
# File 'lib/compass/commands/create_project.rb', line 28 def perform installer.init installer.run(:skip_finalization => true) UpdateProject.new(working_path, ).perform if installer.compilation_required? installer.finalize(:create => true) end |
#project_template_directory ⇒ Object
35 36 37 |
# File 'lib/compass/commands/create_project.rb', line 35 def project_template_directory File.join(framework.templates_directory, "project") end |