Skip to content

Commit

Permalink
Merge pull request #287 from Clebam/fix-lib-requirement
Browse files Browse the repository at this point in the history
(MODULES-11424) Fix requirement method
  • Loading branch information
jordanbreen28 authored Jun 12, 2023
2 parents 5607302 + b40797b commit 7770dfa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
12 changes: 2 additions & 10 deletions lib/puppet/provider/registry_key/registry.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# frozen_string_literal: true

# REMIND: need to support recursive delete of subkeys & values
begin
# We expect this to work once Puppet supports Rubygems in #7788
require 'puppet_x/puppetlabs/registry'
rescue LoadError
# Work around #7788 (Rubygems support for modules)
require 'pathname' # JJM WORK_AROUND #14073
module_base = Pathname.new(__FILE__).dirname
require "#{module_base}../../../puppet_x/puppetlabs/registry"
end
require_relative '../../../puppet_x/puppetlabs/registry'

# rubocop:disable Metrics/BlockLength
Puppet::Type.type(:registry_key).provide(:registry) do
desc <<-DOC
Expand Down
8 changes: 1 addition & 7 deletions lib/puppet/provider/registry_value/registry.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# frozen_string_literal: true

require 'puppet/type'
begin
require 'puppet_x/puppetlabs/registry'
rescue LoadError
require 'pathname' # JJM WORK_AROUND #14073 and #7788
module_base = "#{Pathname.new(__FILE__).dirname}../../../"
require "#{module_base}puppet_x/puppetlabs/registry"
end
require_relative '../../../puppet_x/puppetlabs/registry'

# rubocop:disable Metrics/BlockLength
Puppet::Type.type(:registry_value).provide(:registry) do
Expand Down
7 changes: 1 addition & 6 deletions lib/puppet/type/registry_key.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# frozen_string_literal: true

require 'puppet/type'
begin
require 'puppet_x/puppetlabs/registry'
rescue LoadError
require 'pathname' # JJM WORK_AROUND #14073 and #7788
require "#{Pathname.new(__FILE__).dirname}../../puppet_x/puppetlabs/registry"
end
require_relative '../../puppet_x/puppetlabs/registry'

# @summary
# Manages registry keys on Windows systems
Expand Down
7 changes: 1 addition & 6 deletions lib/puppet/type/registry_value.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# frozen_string_literal: true

require 'puppet/type'
begin
require 'puppet_x/puppetlabs/registry'
rescue LoadError
require 'pathname' # JJM WORK_AROUND #14073 and #7788
require "#{Pathname.new(__FILE__).dirname}../../puppet_x/puppetlabs/registry"
end
require_relative '../../puppet_x/puppetlabs/registry'

# @summary
# Manages registry values on Windows systems.
Expand Down

0 comments on commit 7770dfa

Please sign in to comment.