Module: Gaudi::ConfigurationOperations

Overview

Methods to do with configuration entries and data

Instance Method Summary collapse

Instance Method Details

#interpret_library_tokens(tokens, config, base_dir) ⇒ Object

Given a list of tokens it will look them up in the config Hash and map them to 'base_dir/config' if it exists or 'config' if not


110
111
112
113
114
115
116
# File 'lib/gaudi/helpers/operations.rb', line 110

def interpret_library_tokens tokens,config,base_dir
  tokens.map do |o| 
    raise GaudiConfigurationError,"Library token #{o} not found in the external libraries configuration" unless config[o]
    lib_path=File.expand_path(File.join(base_dir,config[o]))
    File.exists?(lib_path) ? lib_path : config[o]
  end
end