Class: Commands::Init::SystemSettingsModel

Inherits:
InitModel
  • Object
show all
Defined in:
lib/commands/init/system_settings_model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from InitModel

inheritable_attributes, inherited, run

Constructor Details

#initializeSystemSettingsModel

Returns a new instance of SystemSettingsModel.



39
40
41
42
43
# File 'lib/commands/init/system_settings_model.rb', line 39

def initialize
  @unicode = self.class.unicode
  @security_level = self.class.security_level
  @configure_settings = self.class.configure_settings
end

Instance Attribute Details

#configure_settingsObject (readonly)

Returns the value of attribute configure_settings.



37
38
39
# File 'lib/commands/init/system_settings_model.rb', line 37

def configure_settings
  @configure_settings
end

#security_levelObject (readonly)

Returns the value of attribute security_level.



37
38
39
# File 'lib/commands/init/system_settings_model.rb', line 37

def security_level
  @security_level
end

#unicodeObject (readonly)

Returns the value of attribute unicode.



37
38
39
# File 'lib/commands/init/system_settings_model.rb', line 37

def unicode
  @unicode
end

Class Method Details

.abstractObject



33
34
35
# File 'lib/commands/init/system_settings_model.rb', line 33

def self.abstract
  true
end

Instance Method Details

#execute(p4, super_user) ⇒ Object

If the security level is > 0, we generate the super_user first, change security, then reset the super’s password. The p4 connection is established here with whatever credentials we end up with the super user as.



49
50
51
52
53
54
# File 'lib/commands/init/system_settings_model.rb', line 49

def execute(p4, super_user)
  puts 'initializing system settings'
  set_unicode_mode(p4)
  set_security_and_super_user(p4, super_user)
  create_default_protections(p4)
end

#rankObject

Internal implementation - don’t mess with this



29
30
31
# File 'lib/commands/init/system_settings_model.rb', line 29

def rank
  0
end