Class: Ghundle::Command::ListAll

Inherits:
Common
  • Object
show all
Defined in:
lib/ghundle/command/list_all.rb

Overview

Lists all available hooks stored in the hook home directory.

Instance Attribute Summary

Attributes inherited from Common

#args

Instance Method Summary collapse

Methods inherited from Common

call, #initialize

Constructor Details

This class inherits a constructor from Ghundle::Command::Common

Instance Method Details

#callObject



8
9
10
# File 'lib/ghundle/command/list_all.rb', line 8

def call
  puts output.strip
end

#outputObject



12
13
14
15
16
17
18
19
# File 'lib/ghundle/command/list_all.rb', line 12

def output
  Dir[config.hooks_root.join('*')].map do |path|
    next if not File.directory?(path)

    hook = Hook.new(Source::Local.new(path))
    hook_description(hook)
  end.join("\n")
end