Module: Gaudi::Configuration::SystemModules::BaseConfiguration

Includes:
Gaudi::ConfigurationOperations
Defined in:
lib/gaudi/helpers/configuration.rb

Overview

The absolute basics for configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gaudi::ConfigurationOperations

#interpret_library_tokens

Class Method Details

.list_keysObject

:stopdoc:


346
347
348
# File 'lib/gaudi/helpers/configuration.rb', line 346

def self.list_keys
  ['platforms','sources','gaudi_modules']
end

.path_keysObject


349
350
351
# File 'lib/gaudi/helpers/configuration.rb', line 349

def self.path_keys
  ['base','out','sources']
end

Instance Method Details

#auto_rules?Boolean

Return the auto_rules flag.

This is false by default


400
401
402
# File 'lib/gaudi/helpers/configuration.rb', line 400

def auto_rules?
  @config.fetch("auto_rules",false)
end

#baseObject Also known as: base_dir

:startdoc: The root path. Every path in the system can be defined relative to this


355
356
357
# File 'lib/gaudi/helpers/configuration.rb', line 355

def base
  return @config["base"]
end

#extensions(platform) ⇒ Object

Returns the file extensions for the given platform


390
391
392
393
394
395
396
# File 'lib/gaudi/helpers/configuration.rb', line 390

def extensions platform
  if @config['platform_data'].keys.include?(platform)
    return @config['platform_data'][platform].extensions
  else
    raise GaudiConfigurationError,"Unknown platform #{platform}"
  end
end

#gaudi_modulesObject

A list of module names (directories) to automatically require next to core when loading Gaudi

For backward compatibility reasons “custom” is always added to the list of modules


373
374
375
376
377
# File 'lib/gaudi/helpers/configuration.rb', line 373

def gaudi_modules
  @config["gaudi_modules"]||=[]
  @config["gaudi_modules"]<<"custom" unless @config["gaudi_modules"].include?("custom")
  return @config["gaudi_modules"]
end

#outObject Also known as: out_dir

The output directory


359
360
361
# File 'lib/gaudi/helpers/configuration.rb', line 359

def out
  return @config["out"]
end

#platform_config(platform) ⇒ Object

returns the platform configuration hash


379
380
381
# File 'lib/gaudi/helpers/configuration.rb', line 379

def platform_config platform
  return @config['platform_data'][platform]
end

#platformsObject

List of available platforms


363
364
365
# File 'lib/gaudi/helpers/configuration.rb', line 363

def platforms
  return @config['platforms']
end

#set_platform_config(platform_data, platform) ⇒ Object

Sets the platform configuration hash

The standard platform specific configuration options are described in PlatformConfiguration


386
387
388
# File 'lib/gaudi/helpers/configuration.rb', line 386

def set_platform_config(platform_data,platform)
  @config['platform_data'][platform]=platform_data
end

#sourcesObject Also known as: source_directories

List of directories containing sources


367
368
369
# File 'lib/gaudi/helpers/configuration.rb', line 367

def sources
  @config["sources"].map{|d| File.expand_path(d)}
end