Module: GitWorkflow::Callbacks::Styles::Debug

Defined in:
lib/git_workflow/callbacks/styles/debug.rb

Defined Under Namespace

Modules: FinishBehaviour, StartBehaviour

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setup(start_command = GitWorkflow::Commands::Start, finish_command = GitWorkflow::Commands::Finish) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/git_workflow/callbacks/styles/debug.rb', line 11

def self.setup(start_command = GitWorkflow::Commands::Start, finish_command = GitWorkflow::Commands::Finish)
  Default.setup(start_command, finish_command)

  start_command.send(:include, StartBehaviour)
  finish_command.send(:include, FinishBehaviour)

  require 'git_workflow/logging'
  Log4r::Outputter['verbose_information'].level = Log4r::DEBUG
end

Instance Method Details

#debug_method(method) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/git_workflow/callbacks/styles/debug.rb', line 43

def debug_method(method)
  chain_methods(method, :debug) do |with_chain_method, without_chain_method|
    class_eval <<-END_OF_DEBUG_METHOD
      def #{ with_chain_method }(*args, &block)
        debug("#{ method }(\#{ args.map(&:inspect).join(',') })") do
          #{ without_chain_method }(*args, &block)
        end
      end
    END_OF_DEBUG_METHOD
  end
  alias_method_chain(method, :debug)
end