Sha256: d3c39f5ea4c2cdd0e4c3a60bcfc9725430f195594f56d91687ea580fc2a3ab78

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

#! /usr/bin/env ruby
# coding: utf-8

require "yaml"

#
#
#
class MachineInfo

  class NoEntryError < Exception; end

  #
  def initialize(data)
    @data = data
  end

  def self.load_file(data_file)
    #pp data_file
    #pp ENV["PWD"]
    #pp File.open(DATA_FILE, "r").readlines
    data = YAML.load_file(data_file)
    MachineInfo.new data
    #pp @data
  end

  def get_host(host)
    raise NoEntryError unless @data.has_key?(host)
    @data[host]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comana-0.0.5 lib/comana/machineinfo.rb