Sha256: 4e7bcd5aba26572a8087de8186bbbb3aece9351d382e81bf4366b33d573e2907

Contents?: true

Size: 1.62 KB

Versions: 17

Compression:

Stored size: 1.62 KB

Contents

gem 'devise'

inject_into_file 'config/environments/development.rb', "\nconfig.action_mailer.default_url_options = { :host => 'localhost:3000' }\n", :after => "Application.configure do"
inject_into_file 'config/environments/test.rb',        "\nconfig.action_mailer.default_url_options = { :host => 'localhost:7000' }\n", :after => "Application.configure do"
inject_into_file 'config/environments/production.rb',  "\nconfig.action_mailer.default_url_options = { :host => '#{app_name}.com' }\n", :after => "Application.configure do"

inject_into_file 'config/routes.rb', "\nroot :to => 'home#index'\n", :after => "Testapp::Application.routes.draw do"

after_bundler do
  generate 'devise:install'

  if scrolls.include? 'mongo_mapper'
    gem 'mm-devise'
    gsub_file 'config/initializers/devise.rb', 'devise/orm/', 'devise/orm/mongo_mapper_active_model'
    generate 'mongo_mapper:devise User'
  elsif scrolls.include? 'mongoid'
    gsub_file 'config/initializers/devise.rb', 'devise/orm/active_record', 'devise/orm/mongoid'
  end      

  generate 'devise user'
  generate "devise:views"

  if config['add_app_helpers']
    new_helpers = <<-RB
module ApplicationHelper

  def current_user
    @current_user
  end

  def logged_in?
    @current_user != nil
  end
RB
    gsub_file 'app/helpers/application_helper.rb', 'module ApplicationHelper', new_helpers
  end
end

__END__

name: Devise
description: Utilize Devise for authentication, automatically configured for your selected ORM.
author: mbleigh

category: authentication
exclusive: authentication

config:
  - add_app_helpers:
      type: boolean
      prompt: "Add logged_in and current_user helpers?"

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
appscrolls-0.11.2 scrolls/untested/devise.rb
appscrolls-0.11.1 scrolls/untested/devise.rb
appscrolls-0.11.0 scrolls/untested/devise.rb
appscrolls-0.10.1 scrolls/untested/devise.rb
appscrolls-0.10.0 scrolls/untested/devise.rb
appscrolls-0.9.0 scrolls/untested/devise.rb
appscrolls-0.8.4 scrolls/zzz/devise.rb
appscrolls-0.8.3 scrolls/zzz/devise.rb
appscrolls-0.8.2 scrolls/zzz/devise.rb
appscrolls-0.8.1 scrolls/zzz/devise.rb
appscrolls-0.8.0 scrolls/zzz/devise.rb
appscrolls-0.7.1 scrolls/zzz/devise.rb
appscrolls-0.7.0 scrolls/zzz/devise.rb
eldarscrolls-0.7.0 scrolls/zzz/devise.rb
ey_rails_wizard-0.6.0 scrolls/zzz/devise.rb
ey_rails_wizard-0.5.0 scrolls/devise.rb
ey_rails_wizard-0.4.0 scrolls/devise.rb