Class: ConfigTable::MetaConfigEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/xmpp4r/setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, installer) ⇒ MetaConfigEnvironment

Returns a new instance of MetaConfigEnvironment.



475
476
477
478
# File 'lib/vendor/xmpp4r/setup.rb', line 475

def initialize(config, installer)
  @config = config
  @installer = installer
end

Instance Method Details

#add_bool_config(name, default, desc) ⇒ Object



504
505
506
# File 'lib/vendor/xmpp4r/setup.rb', line 504

def add_bool_config(name, default, desc)
  @config.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc)
end

#add_config(item) ⇒ Object



500
501
502
# File 'lib/vendor/xmpp4r/setup.rb', line 500

def add_config(item)
  @config.add item
end

#add_path_config(name, default, desc) ⇒ Object



508
509
510
# File 'lib/vendor/xmpp4r/setup.rb', line 508

def add_path_config(name, default, desc)
  @config.add PathItem.new(name, 'path', default, desc)
end

#bool_config?(name) ⇒ Boolean

Returns:

  • (Boolean)


488
489
490
# File 'lib/vendor/xmpp4r/setup.rb', line 488

def bool_config?(name)
  @config.lookup(name).config_type == 'bool'
end

#config?(name) ⇒ Boolean

Returns:

  • (Boolean)


484
485
486
# File 'lib/vendor/xmpp4r/setup.rb', line 484

def config?(name)
  @config.key?(name)
end

#config_namesObject



480
481
482
# File 'lib/vendor/xmpp4r/setup.rb', line 480

def config_names
  @config.names
end

#declare_packages(list) ⇒ Object

For only multipackage



527
528
529
530
# File 'lib/vendor/xmpp4r/setup.rb', line 527

def declare_packages(list)
  raise '[setup.rb fatal] multi-package metaconfig API declare_packages() called for single-package; contact application package vendor' unless @installer
  @installer.packages = list
end

#packagesObject

For only multipackage



521
522
523
524
# File 'lib/vendor/xmpp4r/setup.rb', line 521

def packages
  raise '[setup.rb fatal] multi-package metaconfig API packages() called for single-package; contact application package vendor' unless @installer
  @installer.packages
end

#path_config?(name) ⇒ Boolean

Returns:

  • (Boolean)


492
493
494
# File 'lib/vendor/xmpp4r/setup.rb', line 492

def path_config?(name)
  @config.lookup(name).config_type == 'path'
end

#remove_config(name) ⇒ Object



516
517
518
# File 'lib/vendor/xmpp4r/setup.rb', line 516

def remove_config(name)
  @config.remove(name)
end

#set_config_default(name, default) ⇒ Object



512
513
514
# File 'lib/vendor/xmpp4r/setup.rb', line 512

def set_config_default(name, default)
  @config.lookup(name).default = default
end

#value_config?(name) ⇒ Boolean

Returns:

  • (Boolean)


496
497
498
# File 'lib/vendor/xmpp4r/setup.rb', line 496

def value_config?(name)
  @config.lookup(name).config_type != 'exec'
end