class PoiseBuildEssential::BuildEssentialProviders::Base
The provider base class for `poise_build_essential`.
@see PoiseBuildEssential::Resources::PoiseBuildEssential::Resource
@provides poise_build_essential
Public Instance Methods
The `install` action for the `poise_build_essential` resource.
@return [void]
# File lib/poise_build_essential/build_essential_providers/base.rb, line 34 def action_install notifying_block do install_build_essential end end
The `remove` action for the `poise_build_essential` resource.
@return [void]
# File lib/poise_build_essential/build_essential_providers/base.rb, line 52 def action_remove notifying_block do remove_build_essential end end
The `upgrade` action for the `poise_build_essential` resource.
@return [void]
# File lib/poise_build_essential/build_essential_providers/base.rb, line 43 def action_upgrade notifying_block do upgrade_build_essential end end
Private Instance Methods
Install C compiler and build tools. Must be implemented by subclasses.
@abstract
# File lib/poise_build_essential/build_essential_providers/base.rb, line 63 def install_build_essential unsupported_platform("Unknown platform for poise_build_eseential: #{node['platform']} (#{node['platform_family']})") # Return an array so upgrade/remove also work. [] end
Uninstall C compiler and build tools. Must be implemented by subclasses.
@abstract
# File lib/poise_build_essential/build_essential_providers/base.rb, line 81 def remove_build_essential install_build_essential.tap do |installed| Array(installed).each {|r| r.action(:remove) } end end
Helper method for either warning about an unsupported platform or raising an exception.
@api private @param msg [String] Error message to display. @return [void]
# File lib/poise_build_essential/build_essential_providers/base.rb, line 93 def unsupported_platform(msg) if new_resource.allow_unsupported_platform Chef::Log.warn(msg) else raise RuntimeError.new(msg) end end
Upgrade C compiler and build tools. Must be implemented by subclasses.
@abstract
# File lib/poise_build_essential/build_essential_providers/base.rb, line 72 def upgrade_build_essential install_build_essential.tap do |installed| Array(installed).each {|r| r.action(:upgrade) } end end