Module: Furnish::Provisioner::DummyInclude
Overview
:nodoc:
Instance Attribute Summary collapse
-
#id ⇒ Object
arbitrary identifier for Dummy#call_order.
-
#order ⇒ Object
readonly
order tracking via Palsy::List, delegation makes a breadcrumb here that’s ordered between all provisioners.
-
#store ⇒ Object
readonly
basic Palsy::Object store for stuffing random stuff.
Instance Method Summary collapse
-
#call_order ⇒ Object
call order is ordering on a per-provisioner group basis, and is used to validate that groups do indeed execute in the proper order.
-
#do_delegate(meth_name) ⇒ Object
Helper to trace calls to this provisioner.
-
#initialize ⇒ Object
Construct a Dummy.
-
#make_log ⇒ Object
Test the mixin functionality.
-
#report ⇒ Object
report shim.
-
#run_state ⇒ Object
used in state transitions to capture run information.
-
#shutdown(args = { }) ⇒ Object
shutdown shim.
-
#startup(args = { }) ⇒ Object
startup shim.
Instance Attribute Details
#id ⇒ Object
arbitrary identifier for Dummy#call_order
18 19 20 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 18 def id @id end |
#order ⇒ Object (readonly)
order tracking via Palsy::List, delegation makes a breadcrumb here that’s ordered between all provisioners.
15 16 17 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 15 def order @order end |
#store ⇒ Object (readonly)
basic Palsy::Object store for stuffing random stuff
11 12 13 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 11 def store @store end |
Instance Method Details
#call_order ⇒ Object
call order is ordering on a per-provisioner group basis, and is used to validate that groups do indeed execute in the proper order.
39 40 41 42 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 39 def call_order # respond_to? here is to assist with deprecation tests @call_order ||= Palsy::List.new('dummy_order', respond_to?(:furnish_group_name) ? furnish_group_name : name) end |
#do_delegate(meth_name) ⇒ Object
Helper to trace calls to this provisioner. Pretty much everything we care about goes through here.
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 76 def do_delegate(meth_name) meth_name = meth_name.to_s # indicate we actually did something @store[ [furnish_group_name, meth_name].join("-") ] = Time.now.to_i @order.push(furnish_group_name) call_order.push(id || "unknown") yield end |
#initialize ⇒ Object
Construct a Dummy.
23 24 25 26 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 23 def initialize @store = Palsy::Object.new('dummy') @order = Palsy::List.new('dummy_order', 'shared') end |
#make_log ⇒ Object
Test the mixin functionality
90 91 92 93 94 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 90 def make_log if_debug do puts "hello from Dummy" end end |
#report ⇒ Object
report shim
47 48 49 50 51 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 47 def report do_delegate(__method__) do [furnish_group_name, @persist] end end |
#run_state ⇒ Object
used in state transitions to capture run information
31 32 33 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 31 def run_state @run_state ||= Palsy::Map.new('dummy_run_state', [self.class.name, respond_to?(:furnish_group_name) ? furnish_group_name : name].join("-")) end |
#shutdown(args = { }) ⇒ Object
shutdown shim
66 67 68 69 70 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 66 def shutdown(args={ }) do_delegate(__method__) do run_state[__method__] = args end end |
#startup(args = { }) ⇒ Object
startup shim
56 57 58 59 60 61 |
# File 'lib/furnish/provisioners/dummy_include.rb', line 56 def startup(args={ }) @persist = "floop" do_delegate(__method__) do run_state[__method__] = args end end |