Sha256: a10fb449f64890788ece8aacdda723f78dfb81ba66e7a47c8bcda3ed4772d6e4

Contents?: true

Size: 1002 Bytes

Versions: 12

Compression:

Stored size: 1002 Bytes

Contents

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

module Rack
  module DevMark
    class InstallGenerator < ::Rails::Generators::Base
      namespace 'rack:dev-mark:install'

      desc "Install rack-dev-mark."
      def insert_enable
        insert_into_file target_path, after: "< Rails::Application\n" do <<-EOS
    # Enable rack-dev-mark
    config.rack_dev_mark.enable = !Rails.env.production?
    #
    # Customize the env string (default Rails.env)
    # config.rack_dev_mark.env = 'foo'
    #
    # Customize themes if you want to do so
    # config.rack_dev_mark.theme = [:title, :github_fork_ribbon]
    #
    # Customize inserted place of the middleware if necessary.
    # You can use either `insert_before` or `insert_after`
    # config.rack_dev_mark.insert_before SomeOtherMiddleware
    # config.rack_dev_mark.insert_after SomeOtherMiddleware

        EOS
        end
      end

      private

      def target_path
        'config/application.rb'
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rack-dev-mark-0.8.0 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.11 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.10 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.9 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.8 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.7 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.6 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.5 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.4 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.3 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.1 lib/generators/rack/dev-mark/install_generator.rb
rack-dev-mark-0.7.0 lib/generators/rack/dev-mark/install_generator.rb