Sha256: fce454c6edd223ac14feda63cd18f7c4c21c8f824167bd7723c6620bf9e1b4dd

Contents?: true

Size: 624 Bytes

Versions: 3

Compression:

Stored size: 624 Bytes

Contents

namespace :flms do

  desc 'Creates a user account'
  task :create_user, [:email] => :environment do |t, args|

    # Check params.
    unless args.email
      puts "Error: parameter 'email' not provided."
      exit
    end

    # Read the password from the command line.
    print "Please enter the password for the new user: "
    password = STDIN.gets.chomp

    # Get user.
    unless Flms::User.create email: args.email, password: password, password_confirmation: password
      puts "Error: user with email '#{args.email}' could not be created."
      exit
    end

    puts "User #{args.email} created."
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flms-0.0.3 lib/tasks/flms_tasks.rake
flms-0.0.2 lib/tasks/flms_tasks.rake
flms-0.0.1 lib/tasks/flms_tasks.rake