class CapUtil::FakeCap
Attributes
cmds_run[R]
roles[R]
Public Class Methods
new(*args)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 9 def initialize(*args) @struct = OpenStruct.new @roles = [] @cmds_run = [] end
Public Instance Methods
fetch(var_name)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 31 def fetch(var_name) self.send("fetch_#{var_name}") end
method_missing(method, *args, &block)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 15 def method_missing(method, *args, &block) @struct.send(method, *args, &block) end
respond_to?(method)
click to toggle source
Calls superclass method
# File lib/cap-util/fake_cap.rb, line 19 def respond_to?(method) @struct.respond_to?(method) ? true : super end
role(name, hostname, opts)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 35 def role(name, hostname, opts) @roles << [name, hostname, opts] end
run(cmd, *args)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 23 def run(cmd, *args) @cmds_run << cmd end
sudo(cmd, *args)
click to toggle source
# File lib/cap-util/fake_cap.rb, line 27 def sudo(cmd, *args) run("sudo #{cmd}", *args) end