Sha256: 8861ac97a5f6296a0336952ff26a1a29a7421922ef2108e594120c01501f0372

Contents?: true

Size: 934 Bytes

Versions: 28

Compression:

Stored size: 934 Bytes

Contents

require 'active_support'
require 'active_support/core_ext'
require 'thor'
require 'eucalypt/helpers'

module Eucalypt
  module Generators
    class AuthController < Thor::Group
      include Thor::Actions
      include Eucalypt::Helpers
      using String::Builder

      def self.source_root
        File.join File.dirname(__dir__), 'templates'
      end

      def generate
        template 'auth_controller.tt', File.join('app', 'controllers', 'authentication_controller.rb')

        config = {}
        config[:data] = String.build do |s|
          s << "<%=\n"
          s << "  form_for :user, '/auth/login' do\n"
          s << "    text_field :username\n"
          s << "    password_field :password\n"
          s << "    submit 'Login'\n"
          s << "  end\n"
          s << "%>"
        end
        template 'auth_login.tt', File.join('app', 'views', 'authentication', 'login.erb'), config
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
eucalypt-0.8.0 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.7.2 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.7.1 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.7.0 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.6.2 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.6.1 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.6.0 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.5.4 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.5.3 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.5.2 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.5.1 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.5.0 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.4.2 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.4.1 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.4.0 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.3.5 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.3.4 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.3.3 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.3.2 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb
eucalypt-0.3.1 lib/eucalypt/security/namespaces/security-warden/generators/auth_controller.rb