Sha256: 0bb4162c8e21e2fcd1a71a99eb8ab2cbfa9fc07578015cebb7fb4870b44050e6

Contents?: true

Size: 854 Bytes

Versions: 62

Compression:

Stored size: 854 Bytes

Contents

namespace :muck do
  
  namespace :sync do
    desc "Sync files from muck users."
    task :users do
      path = File.join(File.dirname(__FILE__), *%w[.. ..])
      system "rsync -ruv #{path}/db ."
      system "rsync -ruv #{path}/public ."
    end
  end
  
  namespace :users do
    desc "Setup default admin user"
    task :create_admin => :environment do
      ['administrator', 'manager', 'editor', 'contributor'].each {|r| Role.create(:rolename => r) }
      user = User.new
      user.login = "admin"
      user.email = MuckEngine.configuration.admin_email
      user.password = "asdfasdf"
      user.password_confirmation = "asdfasdf"
      user.first_name = "Administrator"
      user.last_name = "Administrator"
      user.save
      user.activate!

      user.add_to_role('administrator')

      puts 'created admin user'
    end
  end
  
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
muck-users-3.1.12 lib/tasks/muck_users.rake
muck-users-3.1.11 lib/tasks/muck_users.rake
muck-users-3.1.10 lib/tasks/muck_users.rake
muck-users-3.1.9 lib/tasks/muck_users.rake
muck-users-3.1.8 lib/tasks/muck_users.rake
muck-users-3.1.7 lib/tasks/muck_users.rake
muck-users-3.1.6 lib/tasks/muck_users.rake
muck-users-3.1.5 lib/tasks/muck_users.rake
muck-users-3.1.4 lib/tasks/muck_users.rake
muck-users-3.1.3 lib/tasks/muck_users.rake
muck-users-3.1.2 lib/tasks/muck_users.rake
muck-users-3.1.1 lib/tasks/muck_users.rake
muck-users-3.1.0 lib/tasks/muck_users.rake
muck-users-3.0.9 lib/tasks/muck_users.rake
muck-users-3.0.8 lib/tasks/muck_users.rake
muck-users-3.0.7 lib/tasks/muck_users.rake
muck-users-3.0.6 lib/tasks/muck_users.rake
muck-users-3.0.5 lib/tasks/muck_users.rake
muck-users-3.0.4 lib/tasks/muck_users.rake
muck-users-3.0.2 lib/tasks/muck_users.rake