Class: Overcommit::HookLoader::BuiltInHookLoader

Inherits:
Base
  • Object
show all
Defined in:
lib/overcommit/hook_loader/built_in_hook_loader.rb

Overview

Responsible for loading hooks that ship with Overcommit.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Overcommit::HookLoader::Base

Instance Method Details

#load_hooksObject



4
5
6
7
8
9
10
# File 'lib/overcommit/hook_loader/built_in_hook_loader.rb', line 4

def load_hooks
  @config.enabled_builtin_hooks(@context).map do |hook_name|
    underscored_hook_name = Overcommit::Utils.snake_case(hook_name)
    require "overcommit/hook/#{@context.hook_type_name}/#{underscored_hook_name}"
    create_hook(hook_name)
  end
end