Module: LogCabin::Modules::HomebrewFormula

Defined in:
lib/prospectus/modules/homebrew_formula.rb

Overview

Pull state from a homebrew formula file

Instance Method Summary collapse

Instance Method Details

#load!Object



8
9
10
11
12
13
# File 'lib/prospectus/modules/homebrew_formula.rb', line 8

def load!
  raise('No name specified') unless @name
  cask_file = "Formula/#{@name}.rb"
  output = `brew info --json=v1 #{cask_file}`
  @state.value = JSON.parse(output).first.dig('versions', 'stable')
end