class Object

Public Instance Methods

eval_mib_data(mib_hash) click to toggle source
# File lib/import-mibs.rb, line 4
def eval_mib_data(mib_hash)
  ruby_hash = mib_hash
              .gsub(':', '=>')                  # fix hash syntax
              .tr('(', '[').tr(')', ']')        # fix tuple syntax
              .sub('FILENAME =', 'filename =')  # get rid of constants
              .sub('MIB =', 'mib =')
  mib = nil
  eval(ruby_hash)
  mib
end
module_file_name(module_name, mib_dir) click to toggle source
# File lib/import-mibs.rb, line 15
def module_file_name(module_name, mib_dir)
  File.join(mib_dir, module_name + '.yaml')
end