Class: RailzLite::Generators::Project

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.destination_rootObject



13
14
15
# File 'lib/railz_lite/generators/project.rb', line 13

def self.destination_root
  Dir.pwd
end

.source_rootObject



9
10
11
# File 'lib/railz_lite/generators/project.rb', line 9

def self.source_root
  File.dirname(__FILE__) + "/templates"
end

Instance Method Details

#add_assetsObject



34
35
36
# File 'lib/railz_lite/generators/project.rb', line 34

def add_assets
  create_file("#{project_name}/assets/application.css")
end

#add_controllersObject



17
18
19
# File 'lib/railz_lite/generators/project.rb', line 17

def add_controllers
  empty_directory("#{project_name}/controllers")
end

#add_modelsObject



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

def add_models
  empty_directory("#{project_name}/models")
end

#add_publicObject



38
39
40
# File 'lib/railz_lite/generators/project.rb', line 38

def add_public
  copy_file('winter_fox_large.jpg', "#{project_name}/public/winter_fox_large.jpg")
end

#add_serverObject



25
26
27
# File 'lib/railz_lite/generators/project.rb', line 25

def add_server
  template('server.rb', "#{project_name}/config/server.rb")
end

#create_sql_fileObject



42
43
44
# File 'lib/railz_lite/generators/project.rb', line 42

def create_sql_file
  create_file("#{project_name}/db/app.sql")
end

#setup_viewsObject



29
30
31
32
# File 'lib/railz_lite/generators/project.rb', line 29

def setup_views
  template('welcome_view.index.html.erb', "#{project_name}/views/welcome/index.html.erb")
  template('application.html.erb', "#{project_name}/views/application/application.html.erb")
end