Class: Resource::Hook
Instance Method Summary collapse
-
#initialize(target, binding) ⇒ Hook
constructor
A new instance of Hook.
- #run ⇒ Object
- #should_skip? ⇒ Boolean
Methods inherited from Base
inherited, #not_if, #set_base_defaults, #unix_mode
Methods included from ClassAttr
Methods included from BlockAttr
Constructor Details
#initialize(target, binding) ⇒ Hook
Returns a new instance of Hook.
5 6 7 8 |
# File 'lib/resource/hook.rb', line 5 def initialize target, binding @target = target @binding = binding end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/resource/hook.rb', line 10 def run if ::File.exist?(@target) Output.info 'Hook found', @target eval(::File.read(@target), @binding) else Output.warn 'Hook not found', @target end end |
#should_skip? ⇒ Boolean
19 20 21 |
# File 'lib/resource/hook.rb', line 19 def should_skip? false end |