diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b456bed0..81536b01 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,19 +1,20 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-10-18 11:01:56 -0500 using RuboCop version 0.49.1. +# on 2019-10-30 10:31:01 -0500 using RuboCop version 0.49.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 4 +# Offense count: 6 GetText/DecorateFunctionMessage: Exclude: - 'lib/puppet/provider/exec/powershell.rb' - 'lib/puppet/provider/exec/pwsh.rb' - 'spec/spec_helper_acceptance.rb' -# Offense count: 1 +# Offense count: 3 GetText/DecorateString: Exclude: - 'lib/puppet/provider/exec/powershell.rb' + - 'lib/puppet/provider/exec/pwsh.rb' diff --git a/lib/puppet/provider/exec/powershell.rb b/lib/puppet/provider/exec/powershell.rb index 6eeb2b4a..ff5fcfce 100644 --- a/lib/puppet/provider/exec/powershell.rb +++ b/lib/puppet/provider/exec/powershell.rb @@ -1,5 +1,9 @@ require 'puppet/provider/exec' -require 'ruby-pwsh' +begin + require 'ruby-pwsh' +rescue LoadError + raise 'Could not load the "ruby-pwsh" library; is the dependency module puppetlabs-pwshlib installed in this environment?' +end Puppet::Type.type(:exec).provide :powershell, :parent => Puppet::Provider::Exec do confine :operatingsystem => :windows diff --git a/lib/puppet/provider/exec/pwsh.rb b/lib/puppet/provider/exec/pwsh.rb index 395f5b6a..e6b9a9ef 100644 --- a/lib/puppet/provider/exec/pwsh.rb +++ b/lib/puppet/provider/exec/pwsh.rb @@ -1,5 +1,9 @@ require 'puppet/provider/exec' -require 'ruby-pwsh' +begin + require 'ruby-pwsh' +rescue LoadError + raise 'Could not load the "ruby-pwsh" library; is the dependency module puppetlabs-pwshlib installed in this environment?' +end Puppet::Type.type(:exec).provide :pwsh, :parent => Puppet::Provider::Exec do desc <<-EOT