class Chef::Resource::HomebrewUpdate
Constants
- BREW_STAMP
- BREW_STAMP_DIR
Public Instance Methods
Source
# File lib/chef/resource/homebrew_update.rb, line 65 def brew_up_to_date? ::File.exist?(BREW_STAMP) && ::File.mtime(BREW_STAMP) > Time.now - new_resource.frequency end
Determines whether we need to run ‘homebrew update`
@return [Boolean]
Source
# File lib/chef/resource/homebrew_update.rb, line 70 def do_update directory BREW_STAMP_DIR do recursive true end file BREW_STAMP do content "BREW::Update::Post-Invoke-Success\n" action :create_if_missing end execute "brew update" do command "#{homebrew_bin_path} update" user find_homebrew_uid login true notifies :touch, "file[#{BREW_STAMP}]", :immediately end end