Module: SuperHooks

Defined in:
lib/super_hooks.rb,
lib/super_hooks/git.rb,
lib/super_hooks/hook.rb,
lib/super_hooks/runner.rb,
lib/super_hooks/version.rb,
lib/super_hooks/installer.rb

Overview

A module to interact with git hooks

It is knows if hooks are installed or not

Defined Under Namespace

Modules: Git Classes: Hook, Installer, Runner, Version

Constant Summary collapse

BINARY_NAME =

The binary name Used for covenience when creating the scripts

'super_hooks'
ROOT =

The root pathname

Pathname.new(File.dirname(__FILE__) + '/../').expand_path
VERSION =

The current version of SuperHooks

Version.to_s

Class Method Summary collapse

Class Method Details

.installed?Boolean

Allows to look if super_hooks is installed

Example:

installed?
#=> true

Returns a boolean

Returns:

  • (Boolean)


37
38
39
40
41
# File 'lib/super_hooks.rb', line 37

def self.installed?
  return false unless Git.repository?
  hooks_folder = File.join(Git.current_repository, '.git', 'hooks.old', '')
  File.exist?(hooks_folder)
end