Class: BrewCaskTools::Tasks::CLI

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

Overview

Entrypoint for CLI

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, opts, config) ⇒ CLI

Returns a new instance of CLI.



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

def initialize(args, opts, config)
  super
  return if %w(help version).include?(config[:current_command].name)
  `brew update` # Update Caskroom tap so the latest formulae are pulled down
end

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/bct/tasks.rb', line 19

def self.exit_on_failure?
  true
end

Instance Method Details

#cleanup(*casks) ⇒ Object



41
42
43
# File 'lib/bct/tasks.rb', line 41

def cleanup(*casks)
  Tasks::Cleanup.new(casks)
end

#outdatedObject



29
30
31
# File 'lib/bct/tasks.rb', line 29

def outdated
  Tasks::Outdated.new
end

#upgrade(*casks) ⇒ Object



35
36
37
# File 'lib/bct/tasks.rb', line 35

def upgrade(*casks)
  Tasks::Upgrade.new(casks)
end

#versionObject



24
25
26
# File 'lib/bct/tasks.rb', line 24

def version
  say BrewCaskTools::VERSION, :green
end