Class: Bumpversion::Hook

Inherits:
Object
  • Object
show all
Defined in:
lib/bumpversion/hook.rb

Class Method Summary collapse

Class Method Details

.call_system(key_hook, options) ⇒ Object



4
5
6
7
8
9
# File 'lib/bumpversion/hook.rb', line 4

def self.call_system(key_hook, options)
  return false unless options[key_hook]
  command = options[key_hook] % options
  PrettyOutput.info "Executing command: #{command}"
  system("#{command} 1> /dev/null") if command
end

.pos_commit_hook(options) ⇒ Object



11
12
13
# File 'lib/bumpversion/hook.rb', line 11

def self.pos_commit_hook(options)
  call_system(:pos_commit_hooks, options)
end

.pre_commit_hook(options) ⇒ Object



15
16
17
# File 'lib/bumpversion/hook.rb', line 15

def self.pre_commit_hook(options)
  call_system(:pre_commit_hooks, options)
end