Class: Asyncomni::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Asyncomni::Generators::InstallGenerator
- Defined in:
- lib/generators/asyncomni/install/install_generator.rb
Instance Method Summary collapse
- #add_routes ⇒ Object
- #append_omniture_partial_to_application_layout ⇒ Object
- #copy_omniture_config ⇒ Object
- #create_omniture_partial ⇒ Object
Instance Method Details
#add_routes ⇒ Object
14 15 16 |
# File 'lib/generators/asyncomni/install/install_generator.rb', line 14 def add_routes route "resources :omniture, :only => [:index]" end |
#append_omniture_partial_to_application_layout ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/asyncomni/install/install_generator.rb', line 27 def append_omniture_partial_to_application_layout if File.exists?('app/views/layouts/application.html.erb') append_to_file 'app/views/layouts/application.html.erb' do "<%= render 'omniture/omniture' %>" end else File.exists?('app/views/layouts/application.html.haml') append_to_file 'app/views/layouts/application.html.haml' do "= render 'omniture/omniture'" end end end |
#copy_omniture_config ⇒ Object
9 10 11 |
# File 'lib/generators/asyncomni/install/install_generator.rb', line 9 def copy_omniture_config copy_file "omniture.yml", "config/omniture.yml" end |
#create_omniture_partial ⇒ Object
20 21 22 23 24 |
# File 'lib/generators/asyncomni/install/install_generator.rb', line 20 def create_omniture_partial create_file "app/views/omniture/_omniture.html.erb", <<-FILE <%= asyncomni_content_tag %> FILE end |