Class: Jinda_adminlte::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Jinda_adminlte::InstallGenerator
- Defined in:
- lib/generators/jinda_adminlte/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
5 6 7 |
# File 'lib/generators/jinda_adminlte/install_generator.rb', line 5 def self.source_root File.dirname(__FILE__) + "/templates" end |
Instance Method Details
#copy_theme ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/generators/jinda_adminlte/install_generator.rb', line 24 def copy_theme copy_file "application.js","app/assets/javascripts/application.js" copy_file "application.scss","app/assets/stylesheets/application.scss" copy_file "jinda.scss","app/assets/stylesheets/jinda.scss" copy_file "application.haml","app/views/layouts/application.haml" copy_file "adminltes_controller.rb","app/controllers/adminltes_controller.rb" end |
#finish ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/generators/jinda_adminlte/install_generator.rb', line 32 def finish puts "------------------------------------------------\n" puts " \n" puts " Jinda Theme installation finished \n" puts " Note: last jinda_assets was move to tmp/cache \n" puts " To delte run the following command \n" puts " \n" puts "rake tmp:cache:clear \n" puts "------------------------------------------------\n" end |
#setup_app ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/jinda_adminlte/install_generator.rb', line 9 def setup_app inside("app/views/layouts") { run "mv application.haml application.haml.bak" } inside("app/views/layouts") { run "mv lte lte.bak" } inside("app/views/identities") { run "mv new.html.haml new-bak.html.haml" } inside("app/views/sessions") { run "mv new.html.haml new-bak.html.haml" } inside("app/assets") { run "mv jinda_assets ../../tmp/cache" } inside("app/assets") { run "mv javascripts ../../tmp/cache" } inside("app/assets") { run "mv stylesheets ../../tmp/cache" } directory "app/views/adminltes" directory "app/views/layouts/lte" directory "app/views/identities" directory "app/views/sessions" end |