Class: Overcommit::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/overcommit/installer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, target) ⇒ Installer

Returns a new instance of Installer.



6
7
8
9
# File 'lib/overcommit/installer.rb', line 6

def initialize(options, target)
  @options = options
  @target  = target
end

Instance Method Details

#installObject



16
17
18
19
20
21
22
# File 'lib/overcommit/installer.rb', line 16

def install
  log.log "Installing hooks into #{@target}"

  install_scripts
  install_hooks
  write_configuration
end

#runObject



11
12
13
14
# File 'lib/overcommit/installer.rb', line 11

def run
  validate_target
  @options[:uninstall] ? uninstall : install
end

#uninstallObject



24
25
26
27
28
29
30
# File 'lib/overcommit/installer.rb', line 24

def uninstall
  log.log "Removing hooks from #{@target}"

  uninstall_scripts
  uninstall_hooks
  rm_configuration
end