Sha256: 107350d32b1f294b450e2a81770f2fcc1a9c2f0a59e9cb13c4fd00b561d362ba

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 KB

Contents

require 'rails/generators'

module Theme
  module Generators
    class BusinessCasualGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      desc "A Bootstrap HTML starter template (from startbootstrap.com)"

      def create_page
        copy_file 'application.html.erb', 'app/views/layouts/application.html.erb'
        copy_file 'footer.html', 'app/views/layouts/_footer.html.erb'
        copy_file '_navigation.html.erb', 'app/views/layouts/_navigation.html.erb'
        copy_file '_navigation_links.html.erb', 'app/views/layouts/_navigation_links.html.erb'
        copy_file 'index.html', 'app/views/visitors/index.html.erb'
        copy_file 'about.html', 'app/views/pages/about.html.erb'
        copy_file 'blog.html', 'app/views/pages/blog.html.erb'
        copy_file 'contact.html', 'app/views/pages/contact.html.erb'
        copy_file 'business-casual.css', 'app/assets/stylesheets/business-casual.css'
      end

      def modify_layout_for_auth_links
        return unless File.exists?('app/views/layouts/_nav_links_for_auth.html.erb')
        partial = "<%= render 'layouts/navigation_links' %>\n        <%= render 'layouts/nav_links_for_auth' %>"
        gsub_file "app/views/layouts/_navigation.html.erb", /<%= render 'layouts\/navigation_links' %>/, partial
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_apps_pages-0.6.7 lib/generators/theme/business_casual/business_casual_generator.rb
rails_apps_pages-0.6.6 lib/generators/theme/business_casual/business_casual_generator.rb
rails_apps_pages-0.6.5 lib/generators/theme/business_casual/business_casual_generator.rb
rails_apps_pages-0.6.4 lib/generators/theme/business_casual/business_casual_generator.rb
rails_apps_pages-0.6.3 lib/generators/theme/business_casual/business_casual_generator.rb