Sha256: 3a8d5e55e80d409e6eb74c5b55c3fd69a1fe5aa5b04c62197fe8a7e745902108
Contents?: true
Size: 741 Bytes
Versions: 3
Compression:
Stored size: 741 Bytes
Contents
# # predefined methods: update_state, apply, reset, resolve # 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 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sfpagent-0.1.4 | lib/sfpagent/module.rb |
sfpagent-0.1.3 | lib/sfpagent/module.rb |
sfpagent-0.1.2 | lib/sfpagent/module.rb |