Sha256: 27887019341c1f3ac88a06455688d15a0b7aaaa33a9e648b87b932b05b4814ee
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require 'rails' module Asyncomni module Generators class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path('../../../../../config', __FILE__) desc "This generator copies omniture.yml to the application" def copy_omniture_config copy_file "omniture.yml", "config/omniture.yml" end desc "This generator adds routes to routes.rb" def add_routes route "resources :omniture, :only => [:index]" end desc "This Generator is to create omniture partial" def create_omniture_partial create_file "app/views/omniture/_omniture.html.erb", <<-FILE <%= asyncomni_content_tag %> FILE end desc "Append the render partial in the application layout" 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 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
asyncomni-1.0.0 | lib/generators/asyncomni/install/install_generator.rb |
asyncomni-0.0.4 | lib/generators/asyncomni/install/install_generator.rb |