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 "      def \#{ with_chain_method }(*args, &block)\n        debug(\"\#{ method }(\\\#{ args.map(&:inspect).join(',') })\") do\n          \#{ without_chain_method }(*args, &block)\n        end\n      end\n    END_OF_DEBUG_METHOD\n  end\n  alias_method_chain(method, :debug)\nend\n"