Class: Emenu::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Emenu::InstallGenerator
- Defined in:
- lib/generators/emenu/install_generator.rb
Instance Method Summary collapse
- #add_route ⇒ Object
- #copy_default_menu ⇒ Object
- #copy_images ⇒ Object
- #copy_javscript ⇒ Object
- #copy_stylesheets ⇒ Object
- #explain ⇒ Object
- #include_emenu_into_application_controller ⇒ Object
Instance Method Details
#add_route ⇒ Object
32 33 34 |
# File 'lib/generators/emenu/install_generator.rb', line 32 def add_route route "match 'emenu_state' => 'application#emenu_state'\n" end |
#copy_default_menu ⇒ Object
22 23 24 |
# File 'lib/generators/emenu/install_generator.rb', line 22 def copy_file 'default_menu/navigation.rb', 'app/navigation/navigation.rb' end |
#copy_images ⇒ Object
8 9 10 |
# File 'lib/generators/emenu/install_generator.rb', line 8 def copy_images directory 'images', 'public/images/emenu' end |
#copy_javscript ⇒ Object
12 13 14 15 |
# File 'lib/generators/emenu/install_generator.rb', line 12 def copy_javscript copy_file 'javascripts/jquery-1.4.2.min.js', 'public/javascripts/jquery-1.4.2.min.js' copy_file 'javascripts/emenu.js', 'public/javascripts/emenu.js' end |
#copy_stylesheets ⇒ Object
17 18 19 20 |
# File 'lib/generators/emenu/install_generator.rb', line 17 def copy_stylesheets copy_file 'stylesheets/emenu.css', 'public/stylesheets/emenu.css' copy_file 'stylesheets/reset.css', 'public/stylesheets/reset.css' end |
#explain ⇒ Object
36 37 38 39 40 |
# File 'lib/generators/emenu/install_generator.rb', line 36 def explain puts "" puts " You need to link 'reset.css' and 'emenu.css' from layout file" puts " You need to link 'jquery-1.4.2.min.js' and 'emenu.js' from layot file" end |
#include_emenu_into_application_controller ⇒ Object
26 27 28 29 30 |
# File 'lib/generators/emenu/install_generator.rb', line 26 def $install = true inject_into_class "app/controllers/application_controller.rb", ApplicationController, " include Emenu\n" $install = false end |