Sha256: 73fac662b37d48904f238c2620c6c7df676077670ff1e275efa479b45a1d8732
Contents?: true
Size: 755 Bytes
Versions: 5
Compression:
Stored size: 755 Bytes
Contents
# # predefined methods: update_state, apply, reset, resolve # module Sfp::Resource attr_accessor :parent, :synchronized attr_reader :state, :model def init(model={}) @model = {} @state = {} @synchronized = [] update_model(model) end def update_state @state = {} end def update_model(model) model.each { |k,v| @model[k] = v } end def apply(p={}) true 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
5 entries across 5 versions & 1 rubygems