Sha256: 8241800167e7b15a0728140ba9e477c34fb8a767a9fd26ebc581c280ff9dabc3

Contents?: true

Size: 817 Bytes

Versions: 6

Compression:

Stored size: 817 Bytes

Contents

# frozen_string_literal: true

module Boring
  module Bullet
    class InstallGenerator < Rails::Generators::Base
      desc "Adds Bullet gem to the application"
      source_root File.expand_path("templates", __dir__)

      class_option :skip_configuration, type: :boolean, aliases: "-s",
                                        desc: "Skips adding bullet development configuration"

      def add_bullet_gem
        say "Adding bullet gem", :green
        Bundler.with_unbundled_env do
          run "bundle add bullet --group development"
        end
      end

      def add_bullet_gem_configuration
        return if options[:skip_configuration]

        say "Copying bullet.rb configuration to the initializer", :green
        template("bullet.rb", "config/initializers/bullet.rb")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
boring_generators-0.15.0 lib/generators/boring/bullet/install/install_generator.rb
boring_generators-0.14.0 lib/generators/boring/bullet/install/install_generator.rb
boring_generators-0.13.0 lib/generators/boring/bullet/install/install_generator.rb
boring_generators-0.12.0 lib/generators/boring/bullet/install/install_generator.rb
boring_generators-0.11.0 lib/generators/boring/bullet/install/install_generator.rb
boring_generators-0.10.0 lib/generators/boring/bullet/install/install_generator.rb