Sha256: 52d41727b14308bcea28782fdda8325374572522bfea554ca39c7867ae409041

Contents?: true

Size: 789 Bytes

Versions: 12

Compression:

Stored size: 789 Bytes

Contents

require 'rails/generators'

module Groundworkcss
  module Generators
    class LayoutGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)
      desc "This generator generates layout file with navigation."
      argument :layout_name, :type => :string, :default => "application"
      attr_reader :app_name, :container_class

      def generate_layout
        app = ::Rails.application
        @app_name = app.class.to_s.split("::").first
        ext = :erb
        template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
        copy_file "_sidebar.html.#{ext}", "app/views/layouts/_sidebar.html.#{ext}"
        copy_file "_header.html.#{ext}", "app/views/layouts/_header.html.#{ext}"        
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
groundworkcss-rails-0.2.12 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.11 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.10 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.9 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.8 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.7 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.6 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.5 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.4 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.3 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.2 lib/generators/groundworkcss/layout/layout_generator.rb
groundworkcss-rails-0.2.1 lib/generators/groundworkcss/layout/layout_generator.rb