Sha256: 5e949c884fbcda811b991378fbee5661424b87b6a4504365e3e8fb00c47c6bf4

Contents?: true

Size: 939 Bytes

Versions: 12

Compression:

Stored size: 939 Bytes

Contents

require 'rails/generators/base'
require 'thor'

module AmpHtml
    module Generators

        class HelpersGenerator < Rails::Generators::Base

            source_root File.expand_path '../../templates/helpers', __FILE__
            desc 'Generate AMP Tag Helpers. Run with --split to keep a version without AMP.'


            class_option :split, desc: 'Keep an application layout without AMP', type: :boolean, default: false, aliases: '-s'



            def create_helpers
                template 'asset_tag_helper.rb.erb', 'app/helpers/asset_tag_helper.rb'
                template 'form_tag_helper.rb.erb', 'app/helpers/form_tag_helper.rb'

                directory 'amp', 'app/helpers/amp'
                template 'amp_tag_helper.rb.erb', 'app/helpers/amp/amp_tag_helper.rb'
            end

            def show_readme
                readme 'README.md'
            end

        end

    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
amp-html-0.7.18 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.17 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.16 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.15 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.14 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.13 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.12 lib/generators/amp_html/helpers_generator.rb
amp-html-0.7.11 lib/generators/amp-html/helpers_generator.rb
amp-html-0.7.10 lib/generators/amp-html/helpers_generator.rb
amp-html-0.7.9 lib/generators/amp-html/helpers_generator.rb
amp-html-0.7.8 lib/generators/amphtml/helpers_generator.rb
amp-html-0.7.7 lib/generators/amphtml/helpers_generator.rb