class Commands::Init::UserModel
Attributes
login[RW]
password[RW]
Public Class Methods
abstract()
click to toggle source
new()
click to toggle source
# File lib/commands/init/user_model.rb, line 34 def initialize @login = self.class.login @full_name = self.class.full_name @password = self.class.password @email = self.class.email @super = self.class.super end
Public Instance Methods
email()
click to toggle source
# File lib/commands/init/user_model.rb, line 42 def email @email || "#{login}@example.com" end
execute(p4, models=nil, super_user=nil)
click to toggle source
# File lib/commands/init/user_model.rb, line 67 def execute(p4, models=nil, super_user=nil) return if self.class.skip puts "user: #{to_spec} as #{p4.user}" p4.save_user(to_spec, '-f') p4.user = login p4.password = '' if password p4.run_password('', password) if password if super_user p4.user = super_user.login p4.password = super_user.password if super_user.password end end
full_name()
click to toggle source
# File lib/commands/init/user_model.rb, line 46 def full_name @full_name || login end
super?()
click to toggle source
# File lib/commands/init/user_model.rb, line 50 def super? @super end
to_s()
click to toggle source
# File lib/commands/init/user_model.rb, line 54 def to_s "UserModel: login=#{login} email=#{email} full_name=#{full_name} password=#{password}" end
to_spec()
click to toggle source
# File lib/commands/init/user_model.rb, line 58 def to_spec spec = { 'User' => login, 'Email' => email, 'FullName' => full_name } spec end