Sha256: 80fa358d0e88606fbf43bac492f12afdcbbe1bd3df6646f208323589513dc95a

Contents?: true

Size: 765 Bytes

Versions: 56

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

module Auther
  # Install generator for adding Auther support to existing application.
  class InstallGenerator < ::Rails::Generators::Base
    source_root File.join(File.dirname(__FILE__), "..", "templates")

    desc "Installs Auther settings and routes."
    def install
      install_initializer
      add_routes
    end

    private

    def install_initializer
      template File.join("config", "initializers", "auther.rb"),
               File.join("config", "initializers", "auther.rb")
    end

    def add_routes
      route %(delete "/logout", to: "auther/session#destroy", as: "logout")
      route %(get "/login", to: "auther/session#new", as: "login")
      route %(mount Auther::Engine => "/auther")
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
auther-16.10.0 lib/generators/auther/install/install_generator.rb
auther-16.9.0 lib/generators/auther/install/install_generator.rb
auther-16.8.0 lib/generators/auther/install/install_generator.rb
auther-16.7.0 lib/generators/auther/install/install_generator.rb
auther-16.6.0 lib/generators/auther/install/install_generator.rb
auther-16.5.0 lib/generators/auther/install/install_generator.rb
auther-16.4.0 lib/generators/auther/install/install_generator.rb
auther-16.3.0 lib/generators/auther/install/install_generator.rb
auther-16.2.0 lib/generators/auther/install/install_generator.rb
auther-16.1.0 lib/generators/auther/install/install_generator.rb
auther-16.0.0 lib/generators/auther/install/install_generator.rb
auther-15.0.2 lib/generators/auther/install/install_generator.rb
auther-15.0.1 lib/generators/auther/install/install_generator.rb
auther-15.0.0 lib/generators/auther/install/install_generator.rb
auther-14.0.3 lib/generators/auther/install/install_generator.rb
auther-14.0.2 lib/generators/auther/install/install_generator.rb
auther-14.0.1 lib/generators/auther/install/install_generator.rb
auther-14.0.0 lib/generators/auther/install/install_generator.rb
auther-13.6.0 lib/generators/auther/install/install_generator.rb
auther-13.5.0 lib/generators/auther/install/install_generator.rb