Class: Ixtlan::Generators::SetupGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ixtlan::Generators::SetupGenerator
- Defined in:
- lib/generators/ixtlan/setup/setup_generator.rb
Instance Method Summary collapse
- #create_application_layout_file ⇒ Object
- #create_preinitializer_files ⇒ Object
-
#error_templates ⇒ Object
TODO make only if template-engine is ERB.
Instance Method Details
#create_application_layout_file ⇒ Object
34 35 36 37 38 39 |
# File 'lib/generators/ixtlan/setup/setup_generator.rb', line 34 def create_application_layout_file if defined? Ixtlan::Sessions layout = File.join('app', 'views', 'layouts', 'application.html.erb') template 'application_layout.html.erb', layout end end |
#create_preinitializer_files ⇒ Object
16 17 18 19 20 21 |
# File 'lib/generators/ixtlan/setup/setup_generator.rb', line 16 def create_preinitializer_files template 'preinitializer.rb', File.join('config', "preinitializer.rb") template 'gitignore', File.join('config', ".gitignore") template 'passwords.yml.example', File.join('config', "passwords.yml.example") template 'database.yml.example', File.join('config', "database.yml.example") end |
#error_templates ⇒ Object
TODO make only if template-engine is ERB
24 25 26 27 28 29 30 31 32 |
# File 'lib/generators/ixtlan/setup/setup_generator.rb', line 24 def error_templates if defined? Ixtlan::Errors views_dir = File.join('app', 'views', 'errors') ['error', 'error_with_session', 'stale'].each do |f| file = "#{f}.html.erb" template file, File.join(views_dir, file) end end end |