class Rubble::Server
Attributes
name[R]
targets[R]
tool[R]
Public Class Methods
new(tool, name)
click to toggle source
# File lib/rubble/server.rb, line 15 def initialize(tool, name) @tool = tool @name = name @log = Logging.logger[self] @targets = {} @rubble_dir = "/var/rubble" @user = 'root' @group = 'root' @deploy_dir = '#{env.name}/#{resource.type}/#{resource.name}' end
Public Instance Methods
configure_target(type, name, *params, &block)
click to toggle source
# File lib/rubble/server.rb, line 36 def configure_target(type, name, *params, &block) target = provide_target(type, name) do @tool.create_target(type, name, *params) end if not block.nil? then Docile.dsl_eval(target, &block) end end
method_missing(symbol, *arguments, &block)
click to toggle source
Calls superclass method
# File lib/rubble/server.rb, line 45 def method_missing(symbol, *arguments, &block) if not @tool.nil? and @tool.is_target?(symbol) then configure_target(symbol, *arguments, &block) else super end end
provide_target(type, name) { |: create_target| ... }
click to toggle source
# File lib/rubble/server.rb, line 27 def provide_target(type, name) group = @targets.fetch(type) do |k| @targets[type] = {} end group.fetch(name) do |k| group[name] = block_given? ? yield : @tool.create_target(type, name) end end
respond_to?(symbol, include_private = false)
click to toggle source
Calls superclass method
# File lib/rubble/server.rb, line 53 def respond_to?(symbol, include_private = false) if not @tool.nil? and @tool.is_target?(symbol) then true else super end end