Sha256: 30a019fbc39ad1c1b837fc4e41854e35cdf194937343c45995cef63834a1e4ac

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

require "yaml"
require 'iniparse'

module Necro
  class Config
    attr_accessor :processes
    def initialize(filename)
      @ini_content = File.read(filename)
      @processes = process_ini(@ini_content)
    end

    def process_ini(ini_content)
      document = IniParse.parse(ini_content)
      document.map do |section|
        OpenStruct.new(label: section.key, dir: section["directory"], cmd: section["command"])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
necro-0.0.2 lib/necro/config.rb