Class: Jazz::Generators::Project

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jazz/generators/project/project.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/jazz/generators/project/project.rb', line 6

def name
  @name
end

Class Method Details

.source_rootObject



8
9
10
# File 'lib/jazz/generators/project/project.rb', line 8

def self.source_root
  File.join(File.dirname(__FILE__))
end

Instance Method Details

#createObject



12
13
14
15
16
17
18
# File 'lib/jazz/generators/project/project.rb', line 12

def create
  unless !File.directory?(self.name) 
    say "#{name} already exists"
    exit 0
  end
  create_project
end

#create_projectObject



20
21
22
23
# File 'lib/jazz/generators/project/project.rb', line 20

def create_project
  directory "templates/app_root", name
  template  "templates/application.js", "#{name}/config/application.js"
end