Class: BrewCaskTools::Tasks::Caskroom

Inherits:
Thor::Shell::Basic
  • Object
show all
Defined in:
lib/bct/tasks/caskroom.rb

Overview

Base class for Tasks that interact with the Caskroom

Direct Known Subclasses

Outdated

Instance Method Summary collapse

Instance Method Details

#caskroomObject



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

Yields:

  • (casks)


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)
  progressbar.title = "  #{cask.name.capitalize} "
  progressbar.increment
end

#progressbarObject



14
15
16
# File 'lib/bct/tasks/caskroom.rb', line 14

def progressbar
  @progressbar ||= ProgressBar.create(title: '  Progress ')
end