Sha256: b9676d18231c554bd1ff032147f79e2b4598f48d81dfa182f5890be08dc30f5d

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

namespace :challah do
  desc "Setup the challah gem within this rails app."
  task :setup => [ "challah:setup:migrations", "db:migrate", "challah:setup:seeds", "challah:banner" ]
  
  task :banner do
    banner = <<-str

  ==========================================================================
  Challah has been set up successfully!

  Your app now as a few new models:

    - User
    - Role
    - Permission

  And some new routes set up for /login and /logout. You can use these 
  for the built-in log in page or roll your own if you'd prefer.

  A default user with administrator permissions has been created with the 
  following credentials:

    Username: admin
    Password: abc123

  ==========================================================================
  
    str
    
    puts banner
  end
  
  desc "Insert the default users, roles and permissions."
  task :seeds => [ "challah:setup:seeds" ]
  
  namespace :setup do
    task :migrations do
      puts "Copying migrations..."    
      ENV['FROM'] = 'challah_engine'
      Rake::Task['railties:install:migrations'].invoke
    end
    
    task :seeds => :environment do
      puts "Populating seed data..." 
      Challah::Engine.load_seed
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
challah-0.2.1 lib/tasks/setup.rake
challah-0.2.0 lib/tasks/setup.rake