Class: Overcommit::Installer
- Inherits:
-
Object
- Object
- Overcommit::Installer
- Defined in:
- lib/overcommit/installer.rb
Instance Method Summary collapse
-
#initialize(options, target) ⇒ Installer
constructor
A new instance of Installer.
- #install ⇒ Object
- #run ⇒ Object
- #uninstall ⇒ Object
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(, target) @options = @target = target end |
Instance Method Details
#install ⇒ Object
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 |
#run ⇒ Object
11 12 13 14 |
# File 'lib/overcommit/installer.rb', line 11 def run validate_target @options[:uninstall] ? uninstall : install end |
#uninstall ⇒ Object
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 |