Devise without routes

I work with Ruby at my freelance Job, and of course using "rails" Ruby on Rails aka RoR that is an web framework based on the language Ruby.

Here at work we have awesome opensource product :
inline_forms (fork)

You can make complete backend forms Dashboard quick and easy with validations, pagination , users authentication etc.

I'm modyfing the installer and it's turn for the Devise.

I don't need all that things that devise generate for me so I decided(Well I received a task to do it ) to add it manual

This is the finished Job :

In the generator :

say "- Devise install..."  
run "bundle exec rails g devise:install"  
say "- Create Devise route and add path_prefix..."  
insert_into_file "config/routes.rb", <<-ROUTE.strip_heredoc, :after => "Application.routes.draw do\n"  
devise_for :users, :path_prefix => 'auth'  
  resources :users do
    post 'revert', :on => :member
end  
ROUTE  

`

say "- Create devise migration file"

sleep 1 # to get unique migration number  
create_file "db/migrate/" +  
  Time.now.utc.strftime("%Y%m%d%H%M%S") +
  "_" +
  "devise_create_users.rb", <<-DEVISE_MIGRATION.strip_heredoc
class DeviseCreateUsers < ActiveRecord::Migration

  def change
    create_table(:users) do |t|
      ## Database authenticatable
      t.string :email,              null: false, default: ""
      t.string :encrypted_password, null: false, default: ""

      ## Recoverable
      t.string   :reset_password_token
      t.datetime :reset_password_sent_at

      ## Rememberable
      t.datetime :remember_created_at

      ## Trackable
      t.integer  :sign_in_count, default: 0, null: false
      t.datetime :current_sign_in_at
      t.datetime :last_sign_in_at
      t.string   :current_sign_in_ip
      t.string   :last_sign_in_ip

      ## Confirmable
      # t.string   :confirmation_token
      # t.datetime :confirmed_at
      # t.datetime :confirmation_sent_at
      # t.string   :unconfirmed_email # Only if using reconfirmable

      ## Lockable
      # t.integer  :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
      # t.string   :unlock_token # Only if unlock strategy is :email or :both
      # t.datetime :locked_at

      t.string :name
      t.integer :locale_id

      t.timestamps
    end

    add_index :users, :email,                unique: true
    add_index :users, :reset_password_token, unique: true
    # add_index :users, :confirmation_token,   unique: true
    # add_index :users, :unlock_token,         unique: true
  end
end  
DEVISE_MIGRATION  
say "- Create User Controller..."  
create_file "app/controllers/users_controller.rb", <<-USERS_CONTROLLER.strip_heredoc  
  class UsersController < InlineFormsController
    set_tab :user
  end
USERS_CONTROLLER  
say "- Create User Model..."  
create_file "app/models/user.rb", <<-USER_MODEL.strip_heredoc  
  class User < ActiveRecord::Base

    # devise options
    devise :database_authenticatable
    # devise :registerable # uncomment this if you want people to be able to register
    devise :recoverable
    devise :rememberable
    devise :trackable
    devise :validatable
    # devise :token_authenticatable
    # devise :confirmable,
    # devise :lockable
    # devise :timeoutable
    # devise :omniauthable

    # Setup accessible (or protected) attributes for your model
    attr_writer :inline_forms_attribute_list
    attr_accessible :email, :password, :locale, :remember_me

    belongs_to :locale
    has_and_belongs_to_many :roles

    # validations
    validates :name, :presence => true

    default_scope order :name

    # pagination
    attr_reader :per_page
    @per_page = 7

    has_paper_trail

    def _presentation
      "\#{name}"
    end

    def role?(role)
      return !!self.roles.find_by_name(role)
    end

    def inline_forms_attribute_list
      @inline_forms_attribute_list ||= [
        [ :header_user_login,         '', :header ],
        [ :name,                      '', :text_field ],
        [ :email,                     '', :text_field ],
        [ :locale ,                   '', :dropdown ],
        [ :password,                  '', :devise_password_field ],
        [ :header_user_roles,         '', :header ],
        [ :roles,                     '', :check_list ],
        [ :header_user_other_stuff,   '', :header ],
        [ :encrypted_password,        '', :info ],
        [ :reset_password_token,      '', :info ],
        [ :reset_password_sent_at,    '', :info],
        [ :remember_created_at,       '', :info ],
        [ :sign_in_count,             '', :info ],
        [ :current_sign_in_at,        '', :info ],
        [ :last_sign_in_at,           '', :info ],
        [ :current_sign_in_ip,        '', :info ],
        [ :last_sign_in_ip,           '', :info ],
        [ :created_at,                '', :info ],
        [ :updated_at,                '', :info ],
      ]
    end

    def self.not_accessible_through_html?
      false
    end

    def self.order_by_clause
      nil
    end

  end
USER_MODEL  
devise_for :users, :path_prefix => 'auth'  
  resources :users do
    post 'revert', :on => :member
end