Class: RQR::ConfigTable::MetaConfigEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/rqr.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, installer) ⇒ MetaConfigEnvironment

Returns a new instance of MetaConfigEnvironment.



476
477
478
479
# File 'lib/rqr.rb', line 476

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

Instance Method Details

#add_bool_config(name, default, desc) ⇒ Object



505
506
507
# File 'lib/rqr.rb', line 505

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

#add_config(item) ⇒ Object



501
502
503
# File 'lib/rqr.rb', line 501

def add_config(item)
  @config.add item
end

#add_path_config(name, default, desc) ⇒ Object



509
510
511
# File 'lib/rqr.rb', line 509

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

#bool_config?(name) ⇒ Boolean

Returns:

  • (Boolean)


489
490
491
# File 'lib/rqr.rb', line 489

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

#config?(name) ⇒ Boolean

Returns:

  • (Boolean)


485
486
487
# File 'lib/rqr.rb', line 485

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

#config_namesObject



481
482
483
# File 'lib/rqr.rb', line 481

def config_names
  @config.names
end

#declare_packages(list) ⇒ Object

For only multipackage



528
529
530
531
# File 'lib/rqr.rb', line 528

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



522
523
524
525
# File 'lib/rqr.rb', line 522

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)


493
494
495
# File 'lib/rqr.rb', line 493

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

#remove_config(name) ⇒ Object



517
518
519
# File 'lib/rqr.rb', line 517

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

#set_config_default(name, default) ⇒ Object



513
514
515
# File 'lib/rqr.rb', line 513

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

#value_config?(name) ⇒ Boolean

Returns:

  • (Boolean)


497
498
499
# File 'lib/rqr.rb', line 497

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