diff --git a/CHANGELOG.md b/CHANGELOG.md index fb14a21..1b185a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Development +* Replaced the require call for `puppet_x` helper library to use a dynamically + expanded path. This works around limitations in Puppet Ruby `LOAD_PATH` + with error `no such file to load -- puppet_x/encore/powershellmodule/helper`. + + Contributed by Valters Jansons (@sigv) + ## 2.2.0 (2020-11-12) * Added PowerShell runtime caching using `ruby-pwsh` gem and the `puppetlabs/pwshlib` forge module diff --git a/lib/puppet/provider/package/powershellcore.rb b/lib/puppet/provider/package/powershellcore.rb index 5bd0c65..8539241 100644 --- a/lib/puppet/provider/package/powershellcore.rb +++ b/lib/puppet/provider/package/powershellcore.rb @@ -1,6 +1,6 @@ require 'puppet/provider/package' require 'json' -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:package).provide :powershellcore, parent: Puppet::Provider::Package do initvars diff --git a/lib/puppet/provider/package/windowspowershell.rb b/lib/puppet/provider/package/windowspowershell.rb index 19e9592..4e6003f 100644 --- a/lib/puppet/provider/package/windowspowershell.rb +++ b/lib/puppet/provider/package/windowspowershell.rb @@ -1,4 +1,4 @@ -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:package).provide(:windowspowershell, parent: :powershellcore) do initvars diff --git a/lib/puppet/provider/pspackageprovider/powershellcore.rb b/lib/puppet/provider/pspackageprovider/powershellcore.rb index 6bd616f..8aa0482 100644 --- a/lib/puppet/provider/pspackageprovider/powershellcore.rb +++ b/lib/puppet/provider/pspackageprovider/powershellcore.rb @@ -1,5 +1,5 @@ require 'json' -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:pspackageprovider).provide :powershellcore do confine operatingsystem: :windows diff --git a/lib/puppet/provider/pspackageprovider/windowspowershell.rb b/lib/puppet/provider/pspackageprovider/windowspowershell.rb index f90827f..296ee6e 100644 --- a/lib/puppet/provider/pspackageprovider/windowspowershell.rb +++ b/lib/puppet/provider/pspackageprovider/windowspowershell.rb @@ -1,4 +1,4 @@ -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:pspackageprovider).provide(:windowspowershell, parent: :powershellcore) do confine operatingsystem: :windows diff --git a/lib/puppet/provider/psrepository/powershellcore.rb b/lib/puppet/provider/psrepository/powershellcore.rb index 8bff1fe..4a30d6a 100644 --- a/lib/puppet/provider/psrepository/powershellcore.rb +++ b/lib/puppet/provider/psrepository/powershellcore.rb @@ -1,4 +1,4 @@ -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:psrepository).provide(:powershellcore) do initvars diff --git a/lib/puppet/provider/psrepository/windowspowershell.rb b/lib/puppet/provider/psrepository/windowspowershell.rb index 5bc7b01..3f46025 100644 --- a/lib/puppet/provider/psrepository/windowspowershell.rb +++ b/lib/puppet/provider/psrepository/windowspowershell.rb @@ -1,4 +1,4 @@ -require 'puppet_x/encore/powershellmodule/helper' +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppet_x', 'encore', 'powershellmodule', 'helper.rb')) Puppet::Type.type(:psrepository).provide(:windowspowershell, parent: :powershellcore) do initvars