Class: FitCommit::Installer
- Inherits:
-
Object
- Object
- FitCommit::Installer
- Defined in:
- lib/fit-commit/installer.rb
Constant Summary collapse
- HOOK_TEMPLATE_PATH =
File.("../../../templates/hooks/commit-msg", __FILE__)
Instance Method Summary collapse
Instance Method Details
#install ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/fit-commit/installer.rb', line 7 def install FileUtils.mkdir_p(File.dirname(hook_path)) FileUtils.cp(HOOK_TEMPLATE_PATH, hook_path) FileUtils.chmod(0755, hook_path) $stdout.puts "Installed hook to #{hook_path}" true end |
#uninstall ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/fit-commit/installer.rb', line 15 def uninstall if delete_hook $stdout.puts "Deleted hook at #{hook_path}" else $stdout.puts "Hook not found at #{hook_path}" end true end |