Class: RailzLite::Generators::Project
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- RailzLite::Generators::Project
- Includes:
- Thor::Actions
- Defined in:
- lib/railz_lite/generators/project.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_assets ⇒ Object
- #add_controllers ⇒ Object
- #add_models ⇒ Object
- #add_public ⇒ Object
- #add_server ⇒ Object
- #create_sql_file ⇒ Object
- #setup_views ⇒ Object
Class Method Details
.destination_root ⇒ Object
13 14 15 |
# File 'lib/railz_lite/generators/project.rb', line 13 def self.destination_root Dir.pwd end |
.source_root ⇒ Object
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_assets ⇒ Object
34 35 36 |
# File 'lib/railz_lite/generators/project.rb', line 34 def add_assets create_file("#{project_name}/assets/application.css") end |
#add_controllers ⇒ Object
17 18 19 |
# File 'lib/railz_lite/generators/project.rb', line 17 def add_controllers empty_directory("#{project_name}/controllers") end |
#add_models ⇒ Object
21 22 23 |
# File 'lib/railz_lite/generators/project.rb', line 21 def add_models empty_directory("#{project_name}/models") end |
#add_public ⇒ Object
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_server ⇒ Object
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_file ⇒ Object
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_views ⇒ Object
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 |