Class: Gitty::HookCommand::Uninstall
- Includes:
- FileUtils
- Defined in:
- lib/gitty/commands/uninstall.rb
Instance Attribute Summary
Attributes inherited from Runner
Instance Method Summary collapse
-
#initialize(args, stdout = STDOUT, stderr = STDERR) ⇒ Uninstall
constructor
A new instance of Uninstall.
- #run ⇒ Object
Methods inherited from Runner
Constructor Details
#initialize(args, stdout = STDOUT, stderr = STDERR) ⇒ Uninstall
Returns a new instance of Uninstall.
3 4 5 6 |
# File 'lib/gitty/commands/uninstall.rb', line 3 def initialize(args, stdout = STDOUT, stderr = STDERR) super @hookname = args.shift end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gitty/commands/uninstall.rb', line 8 def run = {:installed => true} [:install_kind] = [:kind] if [:kind] hook = Gitty::Hook.find(@hookname, ) return no_hook_found unless hook hook.uninstall stdout.puts "#{hook.install_kind} hook #{hook.name} has been successfully uninstalled." if hook.install_kind == :shared stdout.puts "To propagate this change other developers, run 'git hook publish -m \"removed #{hook.name}\"" end end |