diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e7846450031..37e066e96d9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -22,10 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent: I18n/RailsI18n/DecorateString: Enabled: false -# This cop supports safe auto-correction (--auto-correct). -Layout/EmptyLineAfterMagicComment: - Enabled: false - # This cop supports safe auto-correction (--auto-correct). # Configuration parameters: EnforcedStyleAlignWith, Severity. # SupportedStylesAlignWith: keyword, variable, start_of_line diff --git a/lib/hiera/puppet_function.rb b/lib/hiera/puppet_function.rb index 29ee5d422cb..cef4c325c08 100644 --- a/lib/hiera/puppet_function.rb +++ b/lib/hiera/puppet_function.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'hiera_puppet' # Provides the base class for the puppet functions hiera, hiera_array, hiera_hash, and hiera_include. diff --git a/lib/hiera/scope.rb b/lib/hiera/scope.rb index 2bbe7684fa6..c86d9914e59 100644 --- a/lib/hiera/scope.rb +++ b/lib/hiera/scope.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'forwardable' class Hiera class Scope diff --git a/lib/hiera_puppet.rb b/lib/hiera_puppet.rb index e40ee0ac4c2..bd16a3f7747 100644 --- a/lib/hiera_puppet.rb +++ b/lib/hiera_puppet.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Puppet.features.hiera? require 'hiera/scope' require_relative 'puppet' diff --git a/lib/puppet.rb b/lib/puppet.rb index f7f710e53e7..1e52ed8a0f4 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative 'puppet/version' require_relative 'puppet/concurrent/synchronized' diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb index 65c1eb3b9f6..14f8573af2d 100644 --- a/lib/puppet/agent.rb +++ b/lib/puppet/agent.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/application' require_relative '../puppet/error' require_relative '../puppet/util/at_fork' diff --git a/lib/puppet/agent/disabler.rb b/lib/puppet/agent/disabler.rb index bfcf77e7251..7f8be7c6a67 100644 --- a/lib/puppet/agent/disabler.rb +++ b/lib/puppet/agent/disabler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/json_lockfile' # This module is responsible for encapsulating the logic for diff --git a/lib/puppet/agent/locker.rb b/lib/puppet/agent/locker.rb index 6a4c1618593..319db65f180 100644 --- a/lib/puppet/agent/locker.rb +++ b/lib/puppet/agent/locker.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/pidlock' require_relative '../../puppet/error' diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 52c159f22f6..cf84e28ef98 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'optparse' require_relative '../puppet/util/command_line' require_relative '../puppet/util/constant_inflector' diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb index 7e7a6f3e4e5..c391441e006 100644 --- a/lib/puppet/application/agent.rb +++ b/lib/puppet/application/agent.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/daemon' require_relative '../../puppet/util/pidlock' diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index 960e6259e1b..e992b6abc2f 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/configurer' require_relative '../../puppet/util/profiler/aggregate' diff --git a/lib/puppet/application/catalog.rb b/lib/puppet/application/catalog.rb index 847fbee4276..470a0f09097 100644 --- a/lib/puppet/application/catalog.rb +++ b/lib/puppet/application/catalog.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/indirection_base' class Puppet::Application::Catalog < Puppet::Application::IndirectionBase diff --git a/lib/puppet/application/config.rb b/lib/puppet/application/config.rb index e54408cea7a..7ede4e8bcfd 100644 --- a/lib/puppet/application/config.rb +++ b/lib/puppet/application/config.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' class Puppet::Application::Config < Puppet::Application::FaceBase diff --git a/lib/puppet/application/describe.rb b/lib/puppet/application/describe.rb index 208e5c67895..e7961423723 100644 --- a/lib/puppet/application/describe.rb +++ b/lib/puppet/application/describe.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' class Formatter diff --git a/lib/puppet/application/device.rb b/lib/puppet/application/device.rb index ed4b7025a9c..50c8e930151 100644 --- a/lib/puppet/application/device.rb +++ b/lib/puppet/application/device.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/configurer' require_relative '../../puppet/util/network_device' diff --git a/lib/puppet/application/doc.rb b/lib/puppet/application/doc.rb index 2ceeb6f83c8..58879291467 100644 --- a/lib/puppet/application/doc.rb +++ b/lib/puppet/application/doc.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' class Puppet::Application::Doc < Puppet::Application diff --git a/lib/puppet/application/epp.rb b/lib/puppet/application/epp.rb index 5c29d9f1eac..31fb67e129f 100644 --- a/lib/puppet/application/epp.rb +++ b/lib/puppet/application/epp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' require_relative '../../puppet/face' diff --git a/lib/puppet/application/face_base.rb b/lib/puppet/application/face_base.rb index dd4cfaf6628..d3514bcf397 100644 --- a/lib/puppet/application/face_base.rb +++ b/lib/puppet/application/face_base.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/face' require 'optparse' diff --git a/lib/puppet/application/facts.rb b/lib/puppet/application/facts.rb index 2d0413872cc..d34e26337e0 100644 --- a/lib/puppet/application/facts.rb +++ b/lib/puppet/application/facts.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/indirection_base' class Puppet::Application::Facts < Puppet::Application::IndirectionBase diff --git a/lib/puppet/application/filebucket.rb b/lib/puppet/application/filebucket.rb index a9a4d550940..b9ab0bea703 100644 --- a/lib/puppet/application/filebucket.rb +++ b/lib/puppet/application/filebucket.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' class Puppet::Application::Filebucket < Puppet::Application diff --git a/lib/puppet/application/generate.rb b/lib/puppet/application/generate.rb index 0b444c75f09..ff8b497c9ba 100644 --- a/lib/puppet/application/generate.rb +++ b/lib/puppet/application/generate.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' # The Generate application. diff --git a/lib/puppet/application/help.rb b/lib/puppet/application/help.rb index 64c8b51d913..6cd85e73cba 100644 --- a/lib/puppet/application/help.rb +++ b/lib/puppet/application/help.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' class Puppet::Application::Help < Puppet::Application::FaceBase diff --git a/lib/puppet/application/indirection_base.rb b/lib/puppet/application/indirection_base.rb index 98d1fc594a5..2b98abc18cb 100644 --- a/lib/puppet/application/indirection_base.rb +++ b/lib/puppet/application/indirection_base.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' class Puppet::Application::IndirectionBase < Puppet::Application::FaceBase diff --git a/lib/puppet/application/lookup.rb b/lib/puppet/application/lookup.rb index ba0611a447a..5f7382616aa 100644 --- a/lib/puppet/application/lookup.rb +++ b/lib/puppet/application/lookup.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/pops' require_relative '../../puppet/node' diff --git a/lib/puppet/application/module.rb b/lib/puppet/application/module.rb index a5f74faad50..b4a40cea19f 100644 --- a/lib/puppet/application/module.rb +++ b/lib/puppet/application/module.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' class Puppet::Application::Module < Puppet::Application::FaceBase diff --git a/lib/puppet/application/node.rb b/lib/puppet/application/node.rb index d8e2f5f5d08..084fbff7d67 100644 --- a/lib/puppet/application/node.rb +++ b/lib/puppet/application/node.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/indirection_base' class Puppet::Application::Node < Puppet::Application::IndirectionBase diff --git a/lib/puppet/application/parser.rb b/lib/puppet/application/parser.rb index 9d1d39046ad..321a7588711 100644 --- a/lib/puppet/application/parser.rb +++ b/lib/puppet/application/parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' require_relative '../../puppet/face' diff --git a/lib/puppet/application/plugin.rb b/lib/puppet/application/plugin.rb index e5455c0abe1..4cbcf7cf672 100644 --- a/lib/puppet/application/plugin.rb +++ b/lib/puppet/application/plugin.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/face_base' class Puppet::Application::Plugin < Puppet::Application::FaceBase environment_mode :not_required diff --git a/lib/puppet/application/report.rb b/lib/puppet/application/report.rb index 4f5d4a42115..23935f9a052 100644 --- a/lib/puppet/application/report.rb +++ b/lib/puppet/application/report.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application/indirection_base' class Puppet::Application::Report < Puppet::Application::IndirectionBase diff --git a/lib/puppet/application/resource.rb b/lib/puppet/application/resource.rb index e71c6310876..3f89df9c1b0 100644 --- a/lib/puppet/application/resource.rb +++ b/lib/puppet/application/resource.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' class Puppet::Application::Resource < Puppet::Application diff --git a/lib/puppet/application/script.rb b/lib/puppet/application/script.rb index b64e4890bd8..eb1378a4116 100644 --- a/lib/puppet/application/script.rb +++ b/lib/puppet/application/script.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/configurer' require_relative '../../puppet/util/profiler/aggregate' diff --git a/lib/puppet/application/ssl.rb b/lib/puppet/application/ssl.rb index 94f623052d3..0f8179585ff 100644 --- a/lib/puppet/application/ssl.rb +++ b/lib/puppet/application/ssl.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/application' require_relative '../../puppet/ssl/oids' diff --git a/lib/puppet/application_support.rb b/lib/puppet/application_support.rb index 1f38e29f0db..c9efff12552 100644 --- a/lib/puppet/application_support.rb +++ b/lib/puppet/application_support.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'yaml' require_relative '../puppet' diff --git a/lib/puppet/coercion.rb b/lib/puppet/coercion.rb index 0badb4d907a..2b7d9a4f23b 100644 --- a/lib/puppet/coercion.rb +++ b/lib/puppet/coercion.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Various methods used to coerce values into a canonical form. # # @api private diff --git a/lib/puppet/compilable_resource_type.rb b/lib/puppet/compilable_resource_type.rb index 8f40568d9ec..ab1349f08f0 100644 --- a/lib/puppet/compilable_resource_type.rb +++ b/lib/puppet/compilable_resource_type.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet' # The CompilableResourceType module should be either included in a class or used as a class extension # to mark that the instance used as the 'resource type' of a resource instance diff --git a/lib/puppet/concurrent.rb b/lib/puppet/concurrent.rb index 460e66c921e..ea3b38ce138 100644 --- a/lib/puppet/concurrent.rb +++ b/lib/puppet/concurrent.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true + module Puppet::Concurrent end diff --git a/lib/puppet/concurrent/lock.rb b/lib/puppet/concurrent/lock.rb index dafec737758..5a4729a26c6 100644 --- a/lib/puppet/concurrent/lock.rb +++ b/lib/puppet/concurrent/lock.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/concurrent/synchronized' module Puppet diff --git a/lib/puppet/concurrent/synchronized.rb b/lib/puppet/concurrent/synchronized.rb index 57f71f6250a..e9f93e9c300 100644 --- a/lib/puppet/concurrent/synchronized.rb +++ b/lib/puppet/concurrent/synchronized.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Puppet module Concurrent # Including Puppet::Concurrent::Synchronized into a class when running on JRuby diff --git a/lib/puppet/concurrent/thread_local_singleton.rb b/lib/puppet/concurrent/thread_local_singleton.rb index b91b96be137..f792e547790 100644 --- a/lib/puppet/concurrent/thread_local_singleton.rb +++ b/lib/puppet/concurrent/thread_local_singleton.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Puppet module Concurrent module ThreadLocalSingleton diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index bdf3f3f4cce..2ddc43e193d 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # The client for interacting with the puppetmaster config server. require 'timeout' require_relative '../puppet/util' diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb index 05cbbcdb8de..91678d58c15 100644 --- a/lib/puppet/configurer/downloader.rb +++ b/lib/puppet/configurer/downloader.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/configurer' require_relative '../../puppet/resource/catalog' diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index a07a060301e..b3e28d814b4 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/facts/facter' require_relative '../../puppet/configurer' diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index 403e03400aa..fb9bf311111 100644 --- a/lib/puppet/configurer/plugin_handler.rb +++ b/lib/puppet/configurer/plugin_handler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Break out the code related to plugins. This module is # just included into the agent, but having it here makes it # easier to test. diff --git a/lib/puppet/confine.rb b/lib/puppet/confine.rb index a7b1515be4c..1884e53665e 100644 --- a/lib/puppet/confine.rb +++ b/lib/puppet/confine.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # The class that handles testing whether our providers # actually work or not. require_relative '../puppet/util' diff --git a/lib/puppet/confine/any.rb b/lib/puppet/confine/any.rb index 591b652f4b4..44f93c6de5d 100644 --- a/lib/puppet/confine/any.rb +++ b/lib/puppet/confine/any.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class Puppet::Confine::Any < Puppet::Confine def self.summarize(confines) confines.inject(0) { |count, confine| count + confine.summary } diff --git a/lib/puppet/confine/boolean.rb b/lib/puppet/confine/boolean.rb index bef4b6927d7..8749192ff80 100644 --- a/lib/puppet/confine/boolean.rb +++ b/lib/puppet/confine/boolean.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine' # Common module for the Boolean confines. It currently diff --git a/lib/puppet/confine/exists.rb b/lib/puppet/confine/exists.rb index 03329684e5f..45752de666b 100644 --- a/lib/puppet/confine/exists.rb +++ b/lib/puppet/confine/exists.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine' class Puppet::Confine::Exists < Puppet::Confine diff --git a/lib/puppet/confine/false.rb b/lib/puppet/confine/false.rb index b00d596da69..37496092d33 100644 --- a/lib/puppet/confine/false.rb +++ b/lib/puppet/confine/false.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine/boolean' class Puppet::Confine::False < Puppet::Confine diff --git a/lib/puppet/confine/feature.rb b/lib/puppet/confine/feature.rb index ec43c973fb0..c8aedba42a7 100644 --- a/lib/puppet/confine/feature.rb +++ b/lib/puppet/confine/feature.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine' class Puppet::Confine::Feature < Puppet::Confine diff --git a/lib/puppet/confine/true.rb b/lib/puppet/confine/true.rb index 848a3f26cd9..e33b2e04f77 100644 --- a/lib/puppet/confine/true.rb +++ b/lib/puppet/confine/true.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine/boolean' class Puppet::Confine::True < Puppet::Confine diff --git a/lib/puppet/confine/variable.rb b/lib/puppet/confine/variable.rb index bb6162ed4e2..d03750dbed4 100644 --- a/lib/puppet/confine/variable.rb +++ b/lib/puppet/confine/variable.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/confine' # Require a specific value for a variable, either a Puppet setting diff --git a/lib/puppet/confine_collection.rb b/lib/puppet/confine_collection.rb index 09347eca793..e1d0b2009da 100644 --- a/lib/puppet/confine_collection.rb +++ b/lib/puppet/confine_collection.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Manage a collection of confines, returning a boolean or # helpful information. require_relative '../puppet/confine' diff --git a/lib/puppet/confiner.rb b/lib/puppet/confiner.rb index 1395ea1e420..563808ee0b8 100644 --- a/lib/puppet/confiner.rb +++ b/lib/puppet/confiner.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/confine_collection' # The Confiner module contains methods for managing a Provider's confinement (suitability under given diff --git a/lib/puppet/context.rb b/lib/puppet/context.rb index d857f9aad2d..886bc003bd3 100644 --- a/lib/puppet/context.rb +++ b/lib/puppet/context.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/thread_local' # Puppet::Context is a system for tracking services and contextual information diff --git a/lib/puppet/context/trusted_information.rb b/lib/puppet/context/trusted_information.rb index 679385180f2..5dc685296ac 100644 --- a/lib/puppet/context/trusted_information.rb +++ b/lib/puppet/context/trusted_information.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/trusted_external' # @api private diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb index 3c7b8bfa7fb..ff59e9ad2f2 100644 --- a/lib/puppet/daemon.rb +++ b/lib/puppet/daemon.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/application' require_relative '../puppet/scheduler' diff --git a/lib/puppet/data_binding.rb b/lib/puppet/data_binding.rb index 6a4a53009c4..f40ae784be3 100644 --- a/lib/puppet/data_binding.rb +++ b/lib/puppet/data_binding.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/indirector' # A class for managing data lookups diff --git a/lib/puppet/datatypes.rb b/lib/puppet/datatypes.rb index 037c45b9ab2..829b5fe73fa 100644 --- a/lib/puppet/datatypes.rb +++ b/lib/puppet/datatypes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Data types in the Puppet Language can have implementations written in Ruby # and distributed in puppet modules. A data type can be declared together with # its implementation by creating a file in 'lib/puppet/functions/'. diff --git a/lib/puppet/datatypes/error.rb b/lib/puppet/datatypes/error.rb index 4cc48f6efa3..625c7f7f151 100644 --- a/lib/puppet/datatypes/error.rb +++ b/lib/puppet/datatypes/error.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Puppet::DataTypes.create_type('Error') do interface <<-PUPPET type_parameters => { diff --git a/lib/puppet/datatypes/impl/error.rb b/lib/puppet/datatypes/impl/error.rb index 9067836a12d..aab3dc24793 100644 --- a/lib/puppet/datatypes/impl/error.rb +++ b/lib/puppet/datatypes/impl/error.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class Puppet::DataTypes::Error attr_reader :msg, :kind, :issue_code, :details alias message msg diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index 897bb795755..00a6e906813 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/util/platform' module Puppet diff --git a/lib/puppet/environments.rb b/lib/puppet/environments.rb index ef3c8d800d9..52fbd8425af 100644 --- a/lib/puppet/environments.rb +++ b/lib/puppet/environments.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/concurrent/synchronized' # @api private diff --git a/lib/puppet/error.rb b/lib/puppet/error.rb index 3625dedf09f..d080c60a494 100644 --- a/lib/puppet/error.rb +++ b/lib/puppet/error.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Puppet # The base class for all Puppet errors. It can wrap another exception class Error < RuntimeError diff --git a/lib/puppet/etc.rb b/lib/puppet/etc.rb index 963d5e6e42d..23a75683cc5 100644 --- a/lib/puppet/etc.rb +++ b/lib/puppet/etc.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/util/character_encoding' # Wrapper around Ruby Etc module allowing us to manage encoding in a single # place. diff --git a/lib/puppet/external/dot.rb b/lib/puppet/external/dot.rb index 42c5956f3e0..33335de1b02 100644 --- a/lib/puppet/external/dot.rb +++ b/lib/puppet/external/dot.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # rdot.rb # # diff --git a/lib/puppet/face.rb b/lib/puppet/face.rb index fa418b760ee..309def6d011 100644 --- a/lib/puppet/face.rb +++ b/lib/puppet/face.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # The public name of this feature is 'face', but we have hidden all the # plumbing over in the 'interfaces' namespace to make clear the distinction # between the two. diff --git a/lib/puppet/face/catalog.rb b/lib/puppet/face/catalog.rb index 0f0677db01f..3a7ea1a975b 100644 --- a/lib/puppet/face/catalog.rb +++ b/lib/puppet/face/catalog.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/face' Puppet::Indirector::Face.define(:catalog, '0.0.1') do diff --git a/lib/puppet/face/catalog/select.rb b/lib/puppet/face/catalog/select.rb index 2c14a8eb077..53bdfd83f59 100644 --- a/lib/puppet/face/catalog/select.rb +++ b/lib/puppet/face/catalog/select.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Select and show a list of resources of a given type. Puppet::Face.define(:catalog, '0.0.1') do action :select do diff --git a/lib/puppet/face/config.rb b/lib/puppet/face/config.rb index a8101d92193..9ce2ff09306 100644 --- a/lib/puppet/face/config.rb +++ b/lib/puppet/face/config.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/settings/ini_file' diff --git a/lib/puppet/face/epp.rb b/lib/puppet/face/epp.rb index d9ad057cb46..56130e6d5c3 100644 --- a/lib/puppet/face/epp.rb +++ b/lib/puppet/face/epp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/pops' require_relative '../../puppet/parser/files' diff --git a/lib/puppet/face/facts.rb b/lib/puppet/face/facts.rb index e1e0ac7921e..d59cc970305 100644 --- a/lib/puppet/face/facts.rb +++ b/lib/puppet/face/facts.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/face' require_relative '../../puppet/node/facts' diff --git a/lib/puppet/face/generate.rb b/lib/puppet/face/generate.rb index a6b22a7f2e1..f1ac1457987 100644 --- a/lib/puppet/face/generate.rb +++ b/lib/puppet/face/generate.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/generate/type' diff --git a/lib/puppet/face/help.rb b/lib/puppet/face/help.rb index bcc77c57f34..0d062ca7272 100644 --- a/lib/puppet/face/help.rb +++ b/lib/puppet/face/help.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/application/face_base' require_relative '../../puppet/util/constant_inflector' diff --git a/lib/puppet/face/module.rb b/lib/puppet/face/module.rb index c30c13194aa..486d8be9999 100644 --- a/lib/puppet/face/module.rb +++ b/lib/puppet/face/module.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/module_tool' require_relative '../../puppet/util/colors' diff --git a/lib/puppet/face/module/changes.rb b/lib/puppet/face/module/changes.rb index 743c3f5ac24..bea0bba9c49 100644 --- a/lib/puppet/face/module/changes.rb +++ b/lib/puppet/face/module/changes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Puppet::Face.define(:module, '1.0.0') do action(:changes) do summary _("Show modified files of an installed module.") diff --git a/lib/puppet/face/module/install.rb b/lib/puppet/face/module/install.rb index 780a8cd9192..d1f499bb397 100644 --- a/lib/puppet/face/module/install.rb +++ b/lib/puppet/face/module/install.rb @@ -1,5 +1,6 @@ # encoding: UTF-8 # frozen_string_literal: true + require_relative '../../../puppet/forge' require_relative '../../../puppet/module_tool/install_directory' require 'pathname' diff --git a/lib/puppet/face/module/uninstall.rb b/lib/puppet/face/module/uninstall.rb index db17083bd1c..7da7befbd16 100644 --- a/lib/puppet/face/module/uninstall.rb +++ b/lib/puppet/face/module/uninstall.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Puppet::Face.define(:module, '1.0.0') do action(:uninstall) do summary _("Uninstall a puppet module.") diff --git a/lib/puppet/face/node.rb b/lib/puppet/face/node.rb index 16b1adf44ee..49a18dabe33 100644 --- a/lib/puppet/face/node.rb +++ b/lib/puppet/face/node.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/face' Puppet::Indirector::Face.define(:node, '0.0.1') do copyright "Puppet Inc.", 2011 diff --git a/lib/puppet/face/node/clean.rb b/lib/puppet/face/node/clean.rb index 993e38db9d1..3f817136f3f 100644 --- a/lib/puppet/face/node/clean.rb +++ b/lib/puppet/face/node/clean.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Puppet::Face.define(:node, '0.0.1') do action(:clean) do summary _("Clean up signed certs, cached facts, node objects, and reports for a node stored by the puppetmaster") diff --git a/lib/puppet/face/parser.rb b/lib/puppet/face/parser.rb index 76458df462f..902b0188163 100644 --- a/lib/puppet/face/parser.rb +++ b/lib/puppet/face/parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/parser' diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb index ee4b2426ab0..78dcd336f2d 100644 --- a/lib/puppet/face/plugin.rb +++ b/lib/puppet/face/plugin.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/face' require_relative '../../puppet/configurer/plugin_handler' diff --git a/lib/puppet/face/report.rb b/lib/puppet/face/report.rb index a166e3055f5..19cfef5710d 100644 --- a/lib/puppet/face/report.rb +++ b/lib/puppet/face/report.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/face' Puppet::Indirector::Face.define(:report, '0.0.1') do diff --git a/lib/puppet/face/resource.rb b/lib/puppet/face/resource.rb index 364d2f6e2ab..3a7a29c0a34 100644 --- a/lib/puppet/face/resource.rb +++ b/lib/puppet/face/resource.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector/face' Puppet::Indirector::Face.define(:resource, '0.0.1') do diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb index d8f1647148f..c37eda00af6 100644 --- a/lib/puppet/feature/base.rb +++ b/lib/puppet/feature/base.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' # Add the simple features, all in one file. diff --git a/lib/puppet/feature/bolt.rb b/lib/puppet/feature/bolt.rb index 7bfbf3e14cd..e202d5d8add 100644 --- a/lib/puppet/feature/bolt.rb +++ b/lib/puppet/feature/bolt.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:bolt, :libs => ['bolt']) diff --git a/lib/puppet/feature/cfpropertylist.rb b/lib/puppet/feature/cfpropertylist.rb index 2abf98406b8..a66c634f41f 100644 --- a/lib/puppet/feature/cfpropertylist.rb +++ b/lib/puppet/feature/cfpropertylist.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:cfpropertylist, :libs => ['cfpropertylist']) diff --git a/lib/puppet/feature/eventlog.rb b/lib/puppet/feature/eventlog.rb index 28ee44dadb1..07c256cbe65 100644 --- a/lib/puppet/feature/eventlog.rb +++ b/lib/puppet/feature/eventlog.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' if Puppet::Util::Platform.windows? diff --git a/lib/puppet/feature/hiera_eyaml.rb b/lib/puppet/feature/hiera_eyaml.rb index 887475e30b0..167319fdd38 100644 --- a/lib/puppet/feature/hiera_eyaml.rb +++ b/lib/puppet/feature/hiera_eyaml.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:hiera_eyaml, :libs => ['hiera/backend/eyaml/parser/parser']) diff --git a/lib/puppet/feature/hocon.rb b/lib/puppet/feature/hocon.rb index 039dac2d73b..2dd7295b8fa 100644 --- a/lib/puppet/feature/hocon.rb +++ b/lib/puppet/feature/hocon.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:hocon, :libs => ['hocon']) diff --git a/lib/puppet/feature/libuser.rb b/lib/puppet/feature/libuser.rb index 109058e1663..bb793453391 100644 --- a/lib/puppet/feature/libuser.rb +++ b/lib/puppet/feature/libuser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' require_relative '../../puppet/util/libuser' diff --git a/lib/puppet/feature/msgpack.rb b/lib/puppet/feature/msgpack.rb index 5284c230f91..0dd2f0d162d 100644 --- a/lib/puppet/feature/msgpack.rb +++ b/lib/puppet/feature/msgpack.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:msgpack, :libs => ["msgpack"]) diff --git a/lib/puppet/feature/pe_license.rb b/lib/puppet/feature/pe_license.rb index 96f7644ae52..2cf9e0a47ec 100644 --- a/lib/puppet/feature/pe_license.rb +++ b/lib/puppet/feature/pe_license.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' #Is the pe license library installed providing the ability to read licenses. diff --git a/lib/puppet/feature/pson.rb b/lib/puppet/feature/pson.rb index 031732f20ed..4a2511b6d12 100644 --- a/lib/puppet/feature/pson.rb +++ b/lib/puppet/feature/pson.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' # PSON is deprecated, use JSON instead diff --git a/lib/puppet/feature/selinux.rb b/lib/puppet/feature/selinux.rb index ce1e9321e7a..bcfc4087465 100644 --- a/lib/puppet/feature/selinux.rb +++ b/lib/puppet/feature/selinux.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:selinux, :libs => ["selinux"]) diff --git a/lib/puppet/feature/ssh.rb b/lib/puppet/feature/ssh.rb index 3c9635c9142..49ca36f4cb6 100644 --- a/lib/puppet/feature/ssh.rb +++ b/lib/puppet/feature/ssh.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add(:ssh, :libs => %{net/ssh}) diff --git a/lib/puppet/feature/telnet.rb b/lib/puppet/feature/telnet.rb index 26115495a7a..71add4df6d6 100644 --- a/lib/puppet/feature/telnet.rb +++ b/lib/puppet/feature/telnet.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' Puppet.features.add :telnet do diff --git a/lib/puppet/feature/zlib.rb b/lib/puppet/feature/zlib.rb index 6a9b9873dbc..a2a4e2824e8 100644 --- a/lib/puppet/feature/zlib.rb +++ b/lib/puppet/feature/zlib.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/feature' # We want this to load if possible, but it's not automatically diff --git a/lib/puppet/ffi/posix.rb b/lib/puppet/ffi/posix.rb index 8c8185527c7..1fd2c91d851 100644 --- a/lib/puppet/ffi/posix.rb +++ b/lib/puppet/ffi/posix.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'ffi' module Puppet diff --git a/lib/puppet/ffi/posix/constants.rb b/lib/puppet/ffi/posix/constants.rb index 3f43d1570f5..c36f2d8b198 100644 --- a/lib/puppet/ffi/posix/constants.rb +++ b/lib/puppet/ffi/posix/constants.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/ffi/posix' module Puppet::FFI::POSIX diff --git a/lib/puppet/ffi/posix/functions.rb b/lib/puppet/ffi/posix/functions.rb index b4eef0f8fa6..5688451720a 100644 --- a/lib/puppet/ffi/posix/functions.rb +++ b/lib/puppet/ffi/posix/functions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/ffi/posix' module Puppet::FFI::POSIX diff --git a/lib/puppet/ffi/windows.rb b/lib/puppet/ffi/windows.rb index 037e2cd7dc9..2d63264a580 100644 --- a/lib/puppet/ffi/windows.rb +++ b/lib/puppet/ffi/windows.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'ffi' module Puppet diff --git a/lib/puppet/ffi/windows/api_types.rb b/lib/puppet/ffi/windows/api_types.rb index 6fa26104aac..fc6485f89e3 100644 --- a/lib/puppet/ffi/windows/api_types.rb +++ b/lib/puppet/ffi/windows/api_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/ffi/windows' require_relative '../../../puppet/util/windows/string' diff --git a/lib/puppet/ffi/windows/constants.rb b/lib/puppet/ffi/windows/constants.rb index 6d12503691a..fc4a4ab15ae 100644 --- a/lib/puppet/ffi/windows/constants.rb +++ b/lib/puppet/ffi/windows/constants.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows diff --git a/lib/puppet/ffi/windows/functions.rb b/lib/puppet/ffi/windows/functions.rb index 89d3e04e835..b9b9c1be270 100644 --- a/lib/puppet/ffi/windows/functions.rb +++ b/lib/puppet/ffi/windows/functions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows diff --git a/lib/puppet/ffi/windows/structs.rb b/lib/puppet/ffi/windows/structs.rb index 7254eb3cebf..c37eb88acd3 100644 --- a/lib/puppet/ffi/windows/structs.rb +++ b/lib/puppet/ffi/windows/structs.rb @@ -1,5 +1,6 @@ # coding: utf-8 # frozen_string_literal: true + require_relative '../../../puppet/ffi/windows' module Puppet::FFI::Windows diff --git a/lib/puppet/file_bucket.rb b/lib/puppet/file_bucket.rb index 27c7e4c3f83..f7c11e5e032 100644 --- a/lib/puppet/file_bucket.rb +++ b/lib/puppet/file_bucket.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # stub module Puppet::FileBucket class BucketError < RuntimeError; end diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb index 82250d012ff..6186d4d067b 100644 --- a/lib/puppet/file_bucket/dipper.rb +++ b/lib/puppet/file_bucket/dipper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'pathname' require_relative '../../puppet/file_bucket' require_relative '../../puppet/file_bucket/file' diff --git a/lib/puppet/file_bucket/file.rb b/lib/puppet/file_bucket/file.rb index d3778b6b1ab..1053e55d6d1 100644 --- a/lib/puppet/file_bucket/file.rb +++ b/lib/puppet/file_bucket/file.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_bucket' require_relative '../../puppet/indirector' require_relative '../../puppet/util/checksums' diff --git a/lib/puppet/file_serving.rb b/lib/puppet/file_serving.rb index ad951a03c7d..dc1536c72e5 100644 --- a/lib/puppet/file_serving.rb +++ b/lib/puppet/file_serving.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Just a stub class. class Puppet::FileServing # :nodoc: end diff --git a/lib/puppet/file_serving/base.rb b/lib/puppet/file_serving/base.rb index 2abc679f8e5..7ac9f5efca4 100644 --- a/lib/puppet/file_serving/base.rb +++ b/lib/puppet/file_serving/base.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_serving' require_relative '../../puppet/util' diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index 57e05f53d55..d6549f8ab46 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet' require_relative '../../puppet/file_serving' require_relative '../../puppet/file_serving/mount' diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb index 85f9d694d67..18eed7551ef 100644 --- a/lib/puppet/file_serving/configuration/parser.rb +++ b/lib/puppet/file_serving/configuration/parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/configuration' require_relative '../../../puppet/util/watched_file' diff --git a/lib/puppet/file_serving/content.rb b/lib/puppet/file_serving/content.rb index 088cf663d7c..c938768aa7a 100644 --- a/lib/puppet/file_serving/content.rb +++ b/lib/puppet/file_serving/content.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/indirector' require_relative '../../puppet/file_serving' require_relative '../../puppet/file_serving/base' diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index b0ca063e0f3..aab1a3573e0 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'find' require_relative '../../puppet/file_serving' require_relative '../../puppet/file_serving/metadata' diff --git a/lib/puppet/file_serving/http_metadata.rb b/lib/puppet/file_serving/http_metadata.rb index 6d198fb6352..5c9a4bfb7bf 100644 --- a/lib/puppet/file_serving/http_metadata.rb +++ b/lib/puppet/file_serving/http_metadata.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_serving/metadata' # Simplified metadata representation, suitable for the information diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 0d57438b2e5..23c71a7753d 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet' require_relative '../../puppet/indirector' require_relative '../../puppet/file_serving' diff --git a/lib/puppet/file_serving/mount.rb b/lib/puppet/file_serving/mount.rb index d85c55ae372..64a33187aff 100644 --- a/lib/puppet/file_serving/mount.rb +++ b/lib/puppet/file_serving/mount.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/logging' require_relative '../../puppet/file_serving' require_relative '../../puppet/file_serving/metadata' diff --git a/lib/puppet/file_serving/mount/file.rb b/lib/puppet/file_serving/mount/file.rb index b64607cb77e..d71094b830b 100644 --- a/lib/puppet/file_serving/mount/file.rb +++ b/lib/puppet/file_serving/mount/file.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount diff --git a/lib/puppet/file_serving/mount/locales.rb b/lib/puppet/file_serving/mount/locales.rb index eb1e1bb2932..a2b44066cf2 100644 --- a/lib/puppet/file_serving/mount/locales.rb +++ b/lib/puppet/file_serving/mount/locales.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' # Find files in the modules' locales directories. diff --git a/lib/puppet/file_serving/mount/modules.rb b/lib/puppet/file_serving/mount/modules.rb index b13c73dc24f..bd982011d7c 100644 --- a/lib/puppet/file_serving/mount/modules.rb +++ b/lib/puppet/file_serving/mount/modules.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' # This is the modules-specific mount: it knows how to search through diff --git a/lib/puppet/file_serving/mount/pluginfacts.rb b/lib/puppet/file_serving/mount/pluginfacts.rb index eb7837d89fe..14455984cfb 100644 --- a/lib/puppet/file_serving/mount/pluginfacts.rb +++ b/lib/puppet/file_serving/mount/pluginfacts.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' # Find files in the modules' pluginfacts directories. diff --git a/lib/puppet/file_serving/mount/plugins.rb b/lib/puppet/file_serving/mount/plugins.rb index 78d7462c9ca..c7d32c09764 100644 --- a/lib/puppet/file_serving/mount/plugins.rb +++ b/lib/puppet/file_serving/mount/plugins.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' # Find files in the modules' plugins directories. diff --git a/lib/puppet/file_serving/mount/scripts.rb b/lib/puppet/file_serving/mount/scripts.rb index 746f235dec0..ad5aa5ea97c 100644 --- a/lib/puppet/file_serving/mount/scripts.rb +++ b/lib/puppet/file_serving/mount/scripts.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'puppet/file_serving/mount' class Puppet::FileServing::Mount::Scripts < Puppet::FileServing::Mount diff --git a/lib/puppet/file_serving/mount/tasks.rb b/lib/puppet/file_serving/mount/tasks.rb index e344a758d16..14035f3f00e 100644 --- a/lib/puppet/file_serving/mount/tasks.rb +++ b/lib/puppet/file_serving/mount/tasks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../../puppet/file_serving/mount' class Puppet::FileServing::Mount::Tasks < Puppet::FileServing::Mount diff --git a/lib/puppet/file_serving/terminus_helper.rb b/lib/puppet/file_serving/terminus_helper.rb index 3b29ebf8ece..be1f7c58c7e 100644 --- a/lib/puppet/file_serving/terminus_helper.rb +++ b/lib/puppet/file_serving/terminus_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_serving' require_relative '../../puppet/file_serving/fileset' diff --git a/lib/puppet/file_serving/terminus_selector.rb b/lib/puppet/file_serving/terminus_selector.rb index c03d04a03e5..0fbb051e2a7 100644 --- a/lib/puppet/file_serving/terminus_selector.rb +++ b/lib/puppet/file_serving/terminus_selector.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_serving' # This module is used to pick the appropriate terminus diff --git a/lib/puppet/file_system.rb b/lib/puppet/file_system.rb index 85068cf3d5f..0c6dd4a2704 100644 --- a/lib/puppet/file_system.rb +++ b/lib/puppet/file_system.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Puppet::FileSystem require_relative '../puppet/util' require_relative 'file_system/path_pattern' diff --git a/lib/puppet/file_system/file_impl.rb b/lib/puppet/file_system/file_impl.rb index 969a895ecc5..6150217e1cf 100644 --- a/lib/puppet/file_system/file_impl.rb +++ b/lib/puppet/file_system/file_impl.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Abstract implementation of the Puppet::FileSystem # class Puppet::FileSystem::FileImpl diff --git a/lib/puppet/file_system/jruby.rb b/lib/puppet/file_system/jruby.rb index 3458488ba90..cd8366a0e01 100644 --- a/lib/puppet/file_system/jruby.rb +++ b/lib/puppet/file_system/jruby.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_system/posix' class Puppet::FileSystem::JRuby < Puppet::FileSystem::Posix diff --git a/lib/puppet/file_system/memory_file.rb b/lib/puppet/file_system/memory_file.rb index 30bd800622d..27805f0b5e0 100644 --- a/lib/puppet/file_system/memory_file.rb +++ b/lib/puppet/file_system/memory_file.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # An in-memory file abstraction. Commonly used with Puppet::FileSystem::File#overlay # @api private class Puppet::FileSystem::MemoryFile diff --git a/lib/puppet/file_system/memory_impl.rb b/lib/puppet/file_system/memory_impl.rb index 9ee6f746596..f2cc71b0093 100644 --- a/lib/puppet/file_system/memory_impl.rb +++ b/lib/puppet/file_system/memory_impl.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class Puppet::FileSystem::MemoryImpl def initialize(*files) @files = files + all_children_of(files) diff --git a/lib/puppet/file_system/path_pattern.rb b/lib/puppet/file_system/path_pattern.rb index 6755ba427fa..cd16c1c2498 100644 --- a/lib/puppet/file_system/path_pattern.rb +++ b/lib/puppet/file_system/path_pattern.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'pathname' require_relative '../../puppet/error' diff --git a/lib/puppet/file_system/posix.rb b/lib/puppet/file_system/posix.rb index 40f0872b396..07fe60cd50a 100644 --- a/lib/puppet/file_system/posix.rb +++ b/lib/puppet/file_system/posix.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class Puppet::FileSystem::Posix < Puppet::FileSystem::FileImpl def binread(path) path.binread diff --git a/lib/puppet/file_system/uniquefile.rb b/lib/puppet/file_system/uniquefile.rb index a19a5a98108..b076df56996 100644 --- a/lib/puppet/file_system/uniquefile.rb +++ b/lib/puppet/file_system/uniquefile.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_system' require 'delegate' require 'tmpdir' diff --git a/lib/puppet/file_system/windows.rb b/lib/puppet/file_system/windows.rb index 0c2ea2de1b2..f28ca8e6d41 100644 --- a/lib/puppet/file_system/windows.rb +++ b/lib/puppet/file_system/windows.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/file_system/posix' require_relative '../../puppet/util/windows' diff --git a/lib/puppet/forge.rb b/lib/puppet/forge.rb index 0e44c532d01..12ac34ab093 100644 --- a/lib/puppet/forge.rb +++ b/lib/puppet/forge.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../puppet/vendor' Puppet::Vendor.load_vendored diff --git a/lib/puppet/forge/cache.rb b/lib/puppet/forge/cache.rb index 8ac2fa52074..bc5675f65ae 100644 --- a/lib/puppet/forge/cache.rb +++ b/lib/puppet/forge/cache.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'uri' require_relative '../../puppet/forge' diff --git a/lib/puppet/forge/errors.rb b/lib/puppet/forge/errors.rb index 69551a201cf..18732ed5a93 100644 --- a/lib/puppet/forge/errors.rb +++ b/lib/puppet/forge/errors.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/util/json' require_relative '../../puppet/error' require_relative '../../puppet/forge' diff --git a/lib/puppet/forge/repository.rb b/lib/puppet/forge/repository.rb index 307b9e5ea1b..9203201ff54 100644 --- a/lib/puppet/forge/repository.rb +++ b/lib/puppet/forge/repository.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative '../../puppet/ssl/openssl_loader' require 'digest/sha1' require 'uri' diff --git a/lib/puppet/functions.rb b/lib/puppet/functions.rb index d784c603285..cad6970d080 100644 --- a/lib/puppet/functions.rb +++ b/lib/puppet/functions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Functions in the puppet language can be written in Ruby and distributed in # puppet modules. The function is written by creating a file in the module's # `lib/puppet/functions/` directory, where `` is diff --git a/lib/puppet/functions/abs.rb b/lib/puppet/functions/abs.rb index 816761114ac..c00157fff06 100644 --- a/lib/puppet/functions/abs.rb +++ b/lib/puppet/functions/abs.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns the absolute value of a Numeric value, for example -34.56 becomes # 34.56. Takes a single `Integer` or `Float` value as an argument. # diff --git a/lib/puppet/functions/alert.rb b/lib/puppet/functions/alert.rb index c5cefd28dac..82ca82c9296 100644 --- a/lib/puppet/functions/alert.rb +++ b/lib/puppet/functions/alert.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Logs a message on the server at level `alert`. Puppet::Functions.create_function(:alert, Puppet::Functions::InternalFunction) do # @param values The values to log. diff --git a/lib/puppet/functions/all.rb b/lib/puppet/functions/all.rb index e4efe6ffd89..1b6d8375c84 100644 --- a/lib/puppet/functions/all.rb +++ b/lib/puppet/functions/all.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # repeatedly using each value in a data structure until the lambda returns a non "truthy" value which # makes the function return `false`, or if the end of the iteration is reached, `true` is returned. diff --git a/lib/puppet/functions/annotate.rb b/lib/puppet/functions/annotate.rb index e96afcb6f25..ce3f9d2ff3e 100644 --- a/lib/puppet/functions/annotate.rb +++ b/lib/puppet/functions/annotate.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Handles annotations on objects. The function can be used in four different ways. # # With two arguments, an `Annotation` type and an object, the function returns the annotation diff --git a/lib/puppet/functions/any.rb b/lib/puppet/functions/any.rb index ebfeea809fe..296a6044336 100644 --- a/lib/puppet/functions/any.rb +++ b/lib/puppet/functions/any.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # repeatedly using each value in a data structure until the lambda returns a "truthy" value which # makes the function return `true`, or if the end of the iteration is reached, false is returned. diff --git a/lib/puppet/functions/assert_type.rb b/lib/puppet/functions/assert_type.rb index 2ed3e062ba9..9b862c792a3 100644 --- a/lib/puppet/functions/assert_type.rb +++ b/lib/puppet/functions/assert_type.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns the given value if it is of the given # [data type](https://puppet.com/docs/puppet/latest/lang_data.html), or # otherwise either raises an error or executes an optional two-parameter diff --git a/lib/puppet/functions/binary_file.rb b/lib/puppet/functions/binary_file.rb index d4225ac9d5b..6cfe8374710 100644 --- a/lib/puppet/functions/binary_file.rb +++ b/lib/puppet/functions/binary_file.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Loads a binary file from a module or file system and returns its contents as a `Binary`. # The argument to this function should be a `/` # reference, which will load `` from a module's `files` diff --git a/lib/puppet/functions/break.rb b/lib/puppet/functions/break.rb index abca3db3821..1a6a8f6c8c1 100644 --- a/lib/puppet/functions/break.rb +++ b/lib/puppet/functions/break.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Breaks an innermost iteration as if it encountered an end of input. # This function does not return to the caller. # diff --git a/lib/puppet/functions/call.rb b/lib/puppet/functions/call.rb index 3b59f91c913..0d17370cfee 100644 --- a/lib/puppet/functions/call.rb +++ b/lib/puppet/functions/call.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Calls an arbitrary Puppet function by name. # # This function takes one mandatory argument and one or more optional arguments: diff --git a/lib/puppet/functions/camelcase.rb b/lib/puppet/functions/camelcase.rb index 690e8f5a067..4dfe6e70dbb 100644 --- a/lib/puppet/functions/camelcase.rb +++ b/lib/puppet/functions/camelcase.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Creates a Camel Case version of a String # # This function is compatible with the stdlib function with the same name. diff --git a/lib/puppet/functions/capitalize.rb b/lib/puppet/functions/capitalize.rb index b3d3177b9e6..b8507f402ca 100644 --- a/lib/puppet/functions/capitalize.rb +++ b/lib/puppet/functions/capitalize.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Capitalizes the first character of a String, or the first character of every String in an Iterable value (such as an Array). # # This function is compatible with the stdlib function with the same name. diff --git a/lib/puppet/functions/ceiling.rb b/lib/puppet/functions/ceiling.rb index 345b10d65a3..a46f507510f 100644 --- a/lib/puppet/functions/ceiling.rb +++ b/lib/puppet/functions/ceiling.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns the smallest `Integer` greater or equal to the argument. # Takes a single numeric value as an argument. # diff --git a/lib/puppet/functions/chomp.rb b/lib/puppet/functions/chomp.rb index 045adeaa924..a7b909e7ba4 100644 --- a/lib/puppet/functions/chomp.rb +++ b/lib/puppet/functions/chomp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns a new string with the record separator character(s) removed. # The record separator is the line ending characters `\r` and `\n`. # diff --git a/lib/puppet/functions/chop.rb b/lib/puppet/functions/chop.rb index 68efccfe4ed..210937aafeb 100644 --- a/lib/puppet/functions/chop.rb +++ b/lib/puppet/functions/chop.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns a new string with the last character removed. # If the string ends with `\r\n`, both characters are removed. Applying chop to an empty # string returns an empty string. If you wish to merely remove record diff --git a/lib/puppet/functions/compare.rb b/lib/puppet/functions/compare.rb index c17cac7d6e3..6a322677743 100644 --- a/lib/puppet/functions/compare.rb +++ b/lib/puppet/functions/compare.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Compares two values and returns -1, 0 or 1 if first value is smaller, equal or larger than the second value. # The compare function accepts arguments of the data types `String`, `Numeric`, `Timespan`, `Timestamp`, and `Semver`, # such that: diff --git a/lib/puppet/functions/contain.rb b/lib/puppet/functions/contain.rb index e4d9bd36042..dea0ae79ac8 100644 --- a/lib/puppet/functions/contain.rb +++ b/lib/puppet/functions/contain.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Makes one or more classes be contained inside the current class. # If any of these classes are undeclared, they will be declared as if # there were declared with the `include` function. diff --git a/lib/puppet/functions/convert_to.rb b/lib/puppet/functions/convert_to.rb index bf19fae65dd..c21af06dc3c 100644 --- a/lib/puppet/functions/convert_to.rb +++ b/lib/puppet/functions/convert_to.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # The `convert_to(value, type)` is a convenience function that does the same as `new(type, value)`. # The difference in the argument ordering allows it to be used in chained style for # improved readability "left to right". diff --git a/lib/puppet/functions/crit.rb b/lib/puppet/functions/crit.rb index ed43adeb788..e71cdcf51b7 100644 --- a/lib/puppet/functions/crit.rb +++ b/lib/puppet/functions/crit.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Logs a message on the server at level `crit`. Puppet::Functions.create_function(:crit, Puppet::Functions::InternalFunction) do # @param values The values to log. diff --git a/lib/puppet/functions/debug.rb b/lib/puppet/functions/debug.rb index 2533f7a068f..2a643890dc2 100644 --- a/lib/puppet/functions/debug.rb +++ b/lib/puppet/functions/debug.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Logs a message on the server at level `debug`. Puppet::Functions.create_function(:debug, Puppet::Functions::InternalFunction) do # @param values The values to log. diff --git a/lib/puppet/functions/defined.rb b/lib/puppet/functions/defined.rb index 1a33b1f298f..1d07d914c74 100644 --- a/lib/puppet/functions/defined.rb +++ b/lib/puppet/functions/defined.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Determines whether a given class or resource type is defined and returns a Boolean # value. You can also use `defined` to determine whether a specific resource is defined, # or whether a variable has a value (including `undef`, as opposed to the variable never diff --git a/lib/puppet/functions/dig.rb b/lib/puppet/functions/dig.rb index 26fbac3ff08..5cc2781a5b5 100644 --- a/lib/puppet/functions/dig.rb +++ b/lib/puppet/functions/dig.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns a value for a sequence of given keys/indexes into a structure, such as # an array or hash. # diff --git a/lib/puppet/functions/downcase.rb b/lib/puppet/functions/downcase.rb index a052387af92..98fb9fb1b4e 100644 --- a/lib/puppet/functions/downcase.rb +++ b/lib/puppet/functions/downcase.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Converts a String, Array or Hash (recursively) into lower case. # # This function is compatible with the stdlib function with the same name. diff --git a/lib/puppet/functions/each.rb b/lib/puppet/functions/each.rb index 2f42fdde9e1..a7c1ebda4a5 100644 --- a/lib/puppet/functions/each.rb +++ b/lib/puppet/functions/each.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Runs a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # repeatedly using each value in a data structure, then returns the values unchanged. # diff --git a/lib/puppet/functions/emerg.rb b/lib/puppet/functions/emerg.rb index d1c9d8eb672..716db8d7ea6 100644 --- a/lib/puppet/functions/emerg.rb +++ b/lib/puppet/functions/emerg.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Logs a message on the server at level `emerg`. Puppet::Functions.create_function(:emerg, Puppet::Functions::InternalFunction) do # @param values The values to log. diff --git a/lib/puppet/functions/empty.rb b/lib/puppet/functions/empty.rb index 4e4c1f91edb..1560a29877d 100644 --- a/lib/puppet/functions/empty.rb +++ b/lib/puppet/functions/empty.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Returns `true` if the given argument is an empty collection of values. # # This function can answer if one of the following is empty: diff --git a/lib/puppet/functions/epp.rb b/lib/puppet/functions/epp.rb index 95af8050df4..4abe3dd7885 100644 --- a/lib/puppet/functions/epp.rb +++ b/lib/puppet/functions/epp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Evaluates an Embedded Puppet (EPP) template file and returns the rendered text # result as a String. # diff --git a/lib/puppet/functions/err.rb b/lib/puppet/functions/err.rb index 9d202ac54e5..c507fcf17b8 100644 --- a/lib/puppet/functions/err.rb +++ b/lib/puppet/functions/err.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Logs a message on the server at level `err`. Puppet::Functions.create_function(:err, Puppet::Functions::InternalFunction) do # @param values The values to log. diff --git a/lib/puppet/functions/eyaml_lookup_key.rb b/lib/puppet/functions/eyaml_lookup_key.rb index e76c837f90b..a4de064d53f 100644 --- a/lib/puppet/functions/eyaml_lookup_key.rb +++ b/lib/puppet/functions/eyaml_lookup_key.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # The `eyaml_lookup_key` is a hiera 5 `lookup_key` data provider function. # See [the configuration guide documentation](https://puppet.com/docs/puppet/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-hiera-eyaml) for # how to use this function. diff --git a/lib/puppet/functions/filter.rb b/lib/puppet/functions/filter.rb index 33170afa141..4582934abff 100644 --- a/lib/puppet/functions/filter.rb +++ b/lib/puppet/functions/filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Applies a [lambda](https://puppet.com/docs/puppet/latest/lang_lambdas.html) # to every value in a data structure and returns an array or hash containing any elements # for which the lambda evaluates to a truthy value (not `false` or `undef`). diff --git a/lib/puppet/functions/find_file.rb b/lib/puppet/functions/find_file.rb index 9ede5310a04..e930adfd37a 100644 --- a/lib/puppet/functions/find_file.rb +++ b/lib/puppet/functions/find_file.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Finds an existing file from a module and returns its path. # # This function accepts an argument that is a String as a `/` diff --git a/lib/puppet/functions/find_template.rb b/lib/puppet/functions/find_template.rb index 58730373184..127ad090aa4 100644 --- a/lib/puppet/functions/find_template.rb +++ b/lib/puppet/functions/find_template.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Finds an existing template from a module and returns its path. # # This function accepts an argument that is a String as a `/