Class: BrewCaskTools::Tasks::Caskroom
- Inherits:
-
Thor::Shell::Basic
- Object
- Thor::Shell::Basic
- BrewCaskTools::Tasks::Caskroom
- Defined in:
- lib/bct/tasks/caskroom.rb
Overview
Base class for Tasks that interact with the Caskroom
Direct Known Subclasses
Instance Method Summary collapse
- #caskroom ⇒ Object
- #format(headers, output) ⇒ Object
- #handle(casks, adverb) {|casks| ... } ⇒ Object
- #increment(cask) ⇒ Object
- #progressbar ⇒ Object
Instance Method Details
#caskroom ⇒ Object
10 11 12 |
# File 'lib/bct/tasks/caskroom.rb', line 10 def caskroom @caskroom ||= BrewCaskTools::Caskroom.new end |
#format(headers, output) ⇒ Object
29 30 31 |
# File 'lib/bct/tasks/caskroom.rb', line 29 def format(headers, output) print_table(output.unshift(headers)) end |
#handle(casks, adverb) {|casks| ... } ⇒ Object
18 19 20 21 22 |
# File 'lib/bct/tasks/caskroom.rb', line 18 def handle(casks, adverb) puts "#{adverb.capitalize} packages\n------------------" yield casks puts "\n" end |
#increment(cask) ⇒ Object
24 25 26 27 |
# File 'lib/bct/tasks/caskroom.rb', line 24 def increment(cask) .title = " #{cask.name.capitalize} " .increment end |
#progressbar ⇒ Object
14 15 16 |
# File 'lib/bct/tasks/caskroom.rb', line 14 def @progressbar ||= ProgressBar.create(title: ' Progress ') end |