X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fsup%2Fhook.rb;h=9c48bcabea67caa6dc011c030213f0cc6b94026e;hb=ed7ec99d5a1c42c53ad94c81832a7ba73b14fadc;hp=f40ba1b42b438b5279798407fc1bee93a7df85f9;hpb=da6a682e67731a4f76095bfd36b245e7b8f11374;p=sup diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb index f40ba1b..9c48bca 100644 --- a/lib/sup/hook.rb +++ b/lib/sup/hook.rb @@ -19,6 +19,11 @@ class HookManager attr_writer :__locals + ## an annoying gotcha here is that if you try something + ## like var = var.foo(), var will magically get allocated + ## to Nil and method_missing will never get called. You + ## can work around this by calling self.var or simply + ## not assigning it to itself. def method_missing m, *a case @__locals[m] when Proc @@ -40,7 +45,7 @@ class HookManager end def log s - Redwood::log "hook[#@__name]: #{s}" + info "hook[#@__name]: #{s}" end def ask_yes_or_no q @@ -79,8 +84,6 @@ class HookManager @tags = {} Dir.mkdir dir unless File.exists? dir - - self.class.i_am_the_instance self end attr_reader :tags @@ -150,7 +153,7 @@ private end def log m - Redwood::log("hook: " + m) + info("hook: " + m) end end