Class: TSRails::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/create.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path) ⇒ Create

Returns a new instance of Create.



23
24
25
26
27
# File 'lib/create.rb', line 23

def initialize(project_path)
  self.project_path = project_path
  validate_project_path
  validate_project_name
end

Instance Attribute Details

#project_pathObject

Returns the value of attribute project_path.



16
17
18
# File 'lib/create.rb', line 16

def project_path
  @project_path
end

Class Method Details

.run!(project_path) ⇒ Object



18
19
20
21
# File 'lib/create.rb', line 18

def self.run!(project_path)
  creator = self.new(project_path)
  creator.create_project!
end

Instance Method Details

#create_project!Object



29
30
31
32
33
34
35
36
# File 'lib/create.rb', line 29

def create_project!
  exec(<<-COMMAND)
    rails new #{project_path} \
      --template=#{template} \
      --skip-prototype \
      --skip-test-unit
  COMMAND
end