Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Allow customizing properties on the system package install resource v…
Browse files Browse the repository at this point in the history
…ia a block.

This is mostly being added to allow disabling dev_package for a provider.
  • Loading branch information
coderanger committed Mar 27, 2017
1 parent 10666dc commit 6cd5677
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/poise_languages/system/mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Mixin
#
# @api public
# @return [PoiseLanguages::System::Resource]
def install_system_packages
def install_system_packages(&block)
dev_package_overrides = system_dev_package_overrides
poise_languages_system system_package_name do
# Otherwise use the default install action.
Expand All @@ -38,16 +38,18 @@ def install_system_packages
dev_package_overrides dev_package_overrides
package_version options['package_version'] if options['package_version']
version options['version']
instance_exec(&block) if block
end
end

# Uninstall a language using system packages.
#
# @api public
# @return [PoiseLanguages::System::Resource]
def uninstall_system_packages
def uninstall_system_packages(&block)
install_system_packages.tap do |r|
r.action(:uninstall)
r.instance_exec(&block) if block
end
end

Expand Down

0 comments on commit 6cd5677

Please sign in to comment.