Sha256: de9d5598deda3e32d752594c6038b606be598e2ea8a6fce0ee8c57ab2fa21b3e

Contents?: true

Size: 682 Bytes

Versions: 9

Compression:

Stored size: 682 Bytes

Contents

require 'rails/generators'

module RailsAmp
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    def inject_amp_mime_type_into_file
      inject_into_file 'config/initializers/mime_types.rb',
                            after: %Q(# Mime::Type.register "text/richtext", :rtf\n) do <<-'RUBY'
Mime::Type.register_alias 'text/html', RailsAmp.default_format
RUBY
      end
    end

    def create_config_file
      copy_file 'rails_amp.yml', 'config/rails_amp.yml'
    end

    def create_application_layout
      copy_file 'rails_amp_application.amp.erb', 'app/views/layouts/rails_amp_application.amp.erb'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_amp-0.2.2 lib/generators/rails_amp/install_generator.rb
rails_amp-0.2.1 lib/generators/rails_amp/install_generator.rb
rails_amp-0.2.0 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.9 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.8 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.7 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.6 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.5 lib/generators/rails_amp/install_generator.rb
rails_amp-0.1.4 lib/generators/rails_amp/install_generator.rb