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.2.25 lib/tasks/muck_users.rake
muck-users-3.2.24 lib/tasks/muck_users.rake
muck-users-3.2.23 lib/tasks/muck_users.rake
muck-users-3.2.22 lib/tasks/muck_users.rake
muck-users-3.2.21 lib/tasks/muck_users.rake
muck-users-3.2.20 lib/tasks/muck_users.rake
muck-users-3.2.19 lib/tasks/muck_users.rake
muck-users-3.2.18 lib/tasks/muck_users.rake
muck-users-3.2.17 lib/tasks/muck_users.rake
muck-users-3.2.16 lib/tasks/muck_users.rake
muck-users-3.2.15 lib/tasks/muck_users.rake
muck-users-3.2.14 lib/tasks/muck_users.rake
muck-users-3.2.13 lib/tasks/muck_users.rake
muck-users-3.2.12 lib/tasks/muck_users.rake
muck-users-3.2.11 lib/tasks/muck_users.rake
muck-users-3.2.10 lib/tasks/muck_users.rake
muck-users-3.2.9 lib/tasks/muck_users.rake
muck-users-3.2.8 lib/tasks/muck_users.rake
muck-users-3.2.7 lib/tasks/muck_users.rake
muck-users-3.2.6 lib/tasks/muck_users.rake