class Beaker::Options::OptionsHash

A hash that treats Symbol and String keys interchangeably and recursively merges hashes

Public Instance Methods

dump_to_file(output_file) click to toggle source
# File lib/beaker/options/options_hash.rb, line 37
def dump_to_file(output_file)
  dirname = File.dirname(output_file)
  FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
  File.write(output_file, dump)
end
get_type() click to toggle source

Determine the puppet type of the ObjectHash

Default is FOSS

@example Use this method to test if the :type setting is pe

a['type'] = 'pe'
a.get_type == :pe

@return [Symbol] the type given in the options

# File lib/beaker/options/options_hash.rb, line 28
def get_type
  case self[:type]
  when /pe/
    :pe
  else
    :foss
  end
end
is_pe?() click to toggle source

Determine if type of ObjectHash is pe, defaults to true

@example Use this method to test if the :type setting is pe

a['type'] = 'pe'
a.is_pe? == true

@return [Boolean]

# File lib/beaker/options/options_hash.rb, line 15
def is_pe?
  self[:type] ? self[:type].include?('pe') : true
end