Class: Profile::HomeBrew

Inherits:
JSONable show all
Includes:
Bashman
Defined in:
lib/bashman/homebrew.rb

Constant Summary

Constants included from Bashman

Bashman::CONFIG, Bashman::CONFIG_PATH, Bashman::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bashman

included, version

Methods inherited from JSONable

#from_json!, #to_hash, #to_json

Instance Attribute Details

#casksObject (readonly)

Returns the value of attribute casks.



6
7
8
# File 'lib/bashman/homebrew.rb', line 6

def casks
  @casks
end

#formulaeObject (readonly)

Returns the value of attribute formulae.



7
8
9
# File 'lib/bashman/homebrew.rb', line 7

def formulae
  @formulae
end

Instance Method Details

#get_installedObject



9
10
11
12
13
14
15
16
# File 'lib/bashman/homebrew.rb', line 9

def get_installed
    @installed = self.installed? if @installed.nil?

    if @installed
        @casks = self.get_casks
        @formulae = self.get_formulae
    end
end

#installed?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
# File 'lib/bashman/homebrew.rb', line 18

def installed?
    path = Profile::HomeBrew.which('brew')
    @installed = path.empty? ? false : true
    @installed
end