Sha256: 48cf1181eb4798ea8bade04c046998fb02c8463663e6b19e70d0a097ca92a1ae

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

module ActiveApplication
  module Generators
    class InstallGenerator < Rails::Generators::Base
      class_option :user_model,             type: :string, default: "User"
      class_option :authentication_engine,  type: :string, default: "devise"
      class_option :authorization_engine,   type: :string, default: "cancan"

      def install_authentication
        if options[:authentication_engine] == "devise"
          generate "active_application:devise #{options[:user_model].classify}"
        end
      end

      def install_authorization
        if options[:authorization_engine] == "cancan"
          generate "active_application:cancan #{options[:user_model].classify}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_application-0.0.1 lib/generators/active_application/install/install_generator.rb