Class: GHRH::Command::List
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- GHRH::Command::List
- Defined in:
- lib/ghrh/command/list.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ghrh/command/list.rb', line 6 def execute raise "No repo specified or set (github.repo)" if not repo resp = GHRH::Client.get("/repos/#{repo}/hooks") raise "Unexpected response #{resp.code} #{resp.}" if resp.code != 200 tbl = Tabularize.new :vborder => '', :iborder => '' tbl << %w(id name active events) tbl.separator! resp.each do |p| tbl << [ p['id'], p['name'], p['active'], p['events'].join(',') ] end puts tbl end |