Method: PostyClient::Command::UserCommand#add
- Defined in:
- lib/posty_client/command/user_command.rb
#add(name, password = nil, quota = 0) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/posty_client/command/user_command.rb', line 17 def add(name, password=nil, quota=0) user = find_user_by_email(name) if quota.present? user.quota = quota end if password.blank? password = ask('Password?') end unless password.blank? user.attributes['password'] = password end unless user.save say("#{name} save failed: #{user.errors}", :red) exit 1 end end |