Class: Compass::Commands::CreateProject
- Defined in:
- lib/compass/commands/create_project.rb
Instance Attribute Summary collapse
-
#project_directory ⇒ Object
Returns the value of attribute project_directory.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(working_directory, options) ⇒ CreateProject
constructor
A new instance of CreateProject.
-
#perform ⇒ Object
all commands must implement perform.
Constructor Details
#initialize(working_directory, options) ⇒ CreateProject
Returns a new instance of CreateProject.
11 12 13 14 15 |
# File 'lib/compass/commands/create_project.rb', line 11 def initialize(working_directory, ) super(working_directory, ) self.project_name = [:project_name] self.project_directory = File. File.join(working_directory, project_name) end |
Instance Attribute Details
#project_directory ⇒ Object
Returns the value of attribute project_directory.
9 10 11 |
# File 'lib/compass/commands/create_project.rb', line 9 def project_directory @project_directory end |
#project_name ⇒ Object
Returns the value of attribute project_name.
9 10 11 |
# File 'lib/compass/commands/create_project.rb', line 9 def project_name @project_name end |
Instance Method Details
#perform ⇒ Object
all commands must implement perform
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/compass/commands/create_project.rb', line 18 def perform directory nil, src_dir = [:src_dir] || "src" css_dir = [:css_dir] || "stylesheets" directory src_dir, .merge(:force => true) directory css_dir, .merge(:force => true) template 'project/screen.sass', "#{src_dir}/screen.sass", template 'project/print.sass', "#{src_dir}/print.sass", template 'project/ie.sass', "#{src_dir}/ie.sass", UpdateProject.new(working_directory, ).perform end |