Sha256: 33b6ef47a11bacce3da9a3eaf5d9ab1f1ed159d331fae937afba35d71a272422

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
auther-5.0.1 lib/generators/auther/install/install_generator.rb
auther-5.0.0 lib/generators/auther/install/install_generator.rb