Sha256: 4ac525ee344030627a6d489de228cdc3b0ab323fb08a073873dbea5029907935
Contents?: true
Size: 688 Bytes
Versions: 2
Compression:
Stored size: 688 Bytes
Contents
# encoding: UTF-8 module Vines module Command class Register def run(opts) raise 'vines register <login> <password> <domain>' unless opts[:args].size == 3 require opts[:config] login, password, domain = opts[:args] create_user(domain, login, password) end def create_user(domain, jid, password) user = User.new(jid: [jid, domain].join('@'), password: BCrypt::Password.create(password).to_s) storage = Storage::Local.new { dir(Config.instance.storage(domain).dir) } storage.save_user(user) puts "Created user #{user.jid} with password #{password}" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vinesmod-0.4.5.2 | lib/vines/command/register.rb |
vinesmod-0.4.5 | lib/vines/command/register.rb |