Sha256: 1cc401f4661507680c54eea16ca0cff2114eb38d0dc3e133094b40f970d36cf5

Contents?: true

Size: 606 Bytes

Versions: 4

Compression:

Stored size: 606 Bytes

Contents

# Generate navigation.

require 'katapult/generator'

module Katapult
  module Generators
    class NavigationGenerator < Katapult::Generator

      MENU_BAR = 'app/views/layouts/_menu_bar.html.haml'

      desc 'Generate the navigation'
      source_root File.expand_path('../templates', __FILE__)


      def create_navigation
        template 'app/views/layouts/_navigation.html.haml'

        inject_into_file MENU_BAR, <<-CONTENT, after: /^\s+#navbar.*\n/
      = render 'layouts/navigation'
        CONTENT
      end

      private

      def navigation
        @element
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katapult-0.5.0 lib/generators/katapult/navigation/navigation_generator.rb
katapult-0.4.1 lib/generators/katapult/navigation/navigation_generator.rb
katapult-0.4.0 lib/generators/katapult/navigation/navigation_generator.rb
katapult-0.3.0 lib/generators/katapult/navigation/navigation_generator.rb