class PoiseBuildEssential::BuildEssentialProviders::MacOSX

A provider for `poise_build_essential` to install on macOS platforms.

@see PoiseBuildEssential::Resources::PoiseBuildEssential::Resource @provides poise_build_essential

Private Instance Methods

install_build_essential() click to toggle source

(see Base#install_build_essential)

# File lib/poise_build_essential/build_essential_providers/mac_os_x.rb, line 33
      def install_build_essential
        # This script was graciously borrowed and modified from Tim Sutton's
        # osx-vm-templates at https://github.com/timsutton/osx-vm-templates/blob/b001475df54a9808d3d56d06e71b8fa3001fff42/scripts/xcode-cli-tools.sh
        execute 'install XCode Command Line tools' do
          command <<-EOH
# create the placeholder file that's checked by CLI updates' .dist code
# in Apple's SUS catalog
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
# find the CLI Tools update
PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n')
# install it
softwareupdate -i "$PROD" --verbose
# Remove the placeholder to prevent perpetual appearance in the update utility
rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
          EOH
          not_if 'pkgutil --pkgs=com.apple.pkg.CLTools_Executables'
        end
      end
remove_build_essential() click to toggle source

(see Base#remove_build_essential)

# File lib/poise_build_essential/build_essential_providers/mac_os_x.rb, line 59
def remove_build_essential
  # Not sure how to do this, ignoring for now.
  raise NotImplementedError
end
upgrade_build_essential() click to toggle source

(see Base#upgrade_build_essential)

# File lib/poise_build_essential/build_essential_providers/mac_os_x.rb, line 53
def upgrade_build_essential
  # Make upgrade the same as install on Mac.
  install_build_essential
end