Sha256: b92a93faa4c5908a320e5ed6780ba51ba08ab160d5efe81d593d9d406cb32c74

Contents?: true

Size: 684 Bytes

Versions: 1

Compression:

Stored size: 684 Bytes

Contents

require 'etc'
require 'fileutils'

module Sfp::Resource
	attr_accessor :parent
	attr_reader :state, :model

	def init(model, default)
		@model = {}
		model.each { |k,v| @model[k] = v }
		@state = {}
		@default = {}
		#default.each { |k,v| @state[k] = @default[k] = v }
	end

	def update_state
		@state = {}
	end

	def to_model
		@state = {}
		@model.each { |k,v| @state[k] = v }
	end

	alias_method :reset, :to_model

	def resolve(path)
		Sfp::Agent.resolve(path.simplify)
	end

	protected
	def exec_seq(*commands)
		commands = [commands.to_s] if not commands.is_a?(Array)
		commands.each { |c| raise Exception, "Cannot execute: #{c}" if !system(c) }
	end
end

module Sfp::Module
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sfpagent-0.1.1 lib/sfpagent/module.rb