Class: Asyncomni::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/asyncomni/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_routesObject



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_layoutObject



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_configObject



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_partialObject



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