Class: Compass::Commands::CreateProject

Inherits:
Base
  • Object
show all
Defined in:
lib/compass/commands/create_project.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options, #working_directory

Instance Method Summary collapse

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, options)
  super(working_directory, options)
  self.project_name = options[:project_name]
  self.project_directory = File.expand_path File.join(working_directory, project_name)
end

Instance Attribute Details

#project_directoryObject

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_nameObject

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

#performObject

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, options
  src_dir = options[:src_dir] || "src"
  css_dir = options[:css_dir] || "stylesheets"
  directory src_dir, options.merge(:force => true)
  directory css_dir, options.merge(:force => true)
  template 'project/screen.sass', "#{src_dir}/screen.sass", options
  template 'project/print.sass',  "#{src_dir}/print.sass", options
  template 'project/ie.sass',     "#{src_dir}/ie.sass", options
  UpdateProject.new(working_directory, options).perform
end