Sha256: e523ced439a00a1ea2232cb3e19e7babe1073a6772ee525d02a88d4b8d86c8fe

Contents?: true

Size: 1.91 KB

Versions: 3

Compression:

Stored size: 1.91 KB

Contents

namespace :inkling do

  desc "Boostraps (calls generators, creates databases, runs migrations, seeds the database) Inkling"
  task :bootstrap => ["environment", "inkling:generate", "inkling:run_bootstrap_tasks", "db:create", "db:migrate", "inkling:init", "inkling:welcome_msg"]

  desc "Wipes migrations dir Hard reset (caveat raker), then bootstrap. Destroys db, recreates it, regenerates all migrations, migrates, and initializes with inkling data"
  task :rebuild => ["environment", "inkling:destroy_migrations", "db:drop", "inkling:bootstrap"]


  desc "Runs system('rm -rf db/migrate/*')"
  task :destroy_migrations do 
    system("rm -rf db/migrate/*")
  end
  
  
  desc "Runs system('rails generate inkling')"
  task :generate do
    system("rails generate inkling")    
  end
  
  desc "Iterates through array Inkling::REBUILD_TASKS and executes each task it finds (useful to add your bootstrap sequence to inkling:rebuild)"
  task :run_bootstrap_tasks do
    for task in Inkling::BOOTSTRAP_TASKS
      Rake::Task[task].execute
    end
  end

  desc "Create a default user with login 'admin' and password 'admin'"
  task :default_admin => [:environment] do
    user = Inkling::User.create!(:email => "admin@localhost.com", :password => "test123", :password_confirmation => "test123")
    Inkling::RoleMembership.create!(:user => user, :role => Inkling::Role.find_by_name(Inkling::Role::ADMIN))
    puts "Inkling> Created default administrator: login - 'admin@localhost.com', password - 'test123'."
  end

  desc "Initializes inkling data."
  task :init => [:environment] do
    Inkling::Role.create!(:name => Inkling::Role::ADMIN)
    Rake::Task["inkling:default_admin"].execute
    puts "Inkling> Created administrator role."
    Inkling::Log.create!(:text => "System was installed.")
  end
  
  task :welcome_msg do
    puts Inkling::WELCOME_MSG
  end
  
  desc "Runs specs and cukes."
  task :megatest => [:environment, :spec, :cucumber]
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inkling-0.1.0 lib/tasks/inkling.rake
inkling-0.0.9 lib/tasks/inkling.rake
inkling-0.0.8 lib/tasks/inkling.rake