Class: Brewmaster::CaskCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/brewmaster/cask_collection.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(names) ⇒ CaskCollection

Returns a new instance of CaskCollection.



3
4
5
# File 'lib/brewmaster/cask_collection.rb', line 3

def initialize(names)
  @names = names
end

Class Method Details

.installedObject



16
17
18
# File 'lib/brewmaster/cask_collection.rb', line 16

def self.installed
  Cask.installed.map {|c| (c.split("/").last)}
end

Instance Method Details

#install_missingObject



7
8
9
# File 'lib/brewmaster/cask_collection.rb', line 7

def install_missing
  Cask::CLI::Install.run(*missing)
end

#missingObject

anything not installed, excluding the outdated



12
13
14
# File 'lib/brewmaster/cask_collection.rb', line 12

def missing
  @missing ||= @names - self.class.installed
end