Sha256: e680cf10074eb5a4f40d7cb406748e308e8ca718ab760d8d806d1ffd3e783783

Contents?: true

Size: 899 Bytes

Versions: 14

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

module BaseEditingBootstrap
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      source_root File.expand_path("templates", __dir__)

      def create_initializer
        initializer_file_name = "initializer.rb"
        destination = File.join('config', 'initializers', "base_editing_bootstrap.rb")
        template initializer_file_name, destination
      end

      def install_and_configure_pundit
        generate "pundit:install"
        inject_into_class "app/controllers/application_controller.rb", "ApplicationController", "  include Pundit::Authorization\n"
      end

      def prepare_test_environment
        gem "factory_bot_rails", group: :test, version: '~> 6.4', comment: "Necessary for spec"
        gem 'rails-controller-testing', group: :test, comment: "Required if used with controllers spec"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
base_editing_bootstrap-1.0.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.16.1 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.16.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.15.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.14.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.13.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.12.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.11.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.10.2 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.10.1 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.10.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.9.1 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.9.0 lib/generators/base_editing_bootstrap/install/install_generator.rb
base_editing_bootstrap-0.8.0 lib/generators/base_editing_bootstrap/install/install_generator.rb