Skip to content

Commit

Permalink
(maint) Remove unnecessary fileutils requires
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek committed Nov 12, 2019
1 parent a9edfe4 commit d419c56
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 17 deletions.
3 changes: 0 additions & 3 deletions lib/pdk/generate/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def self.invoke(opts = {})
require 'pdk/module/templatedir'
require 'pdk/util'
require 'pdk/util/template_uri'
require 'fileutils'
require 'pathname'

validate_options(opts) unless opts[:module_name].nil?
Expand Down Expand Up @@ -137,8 +136,6 @@ def self.prepare_metadata(opts = {})
end

def self.prepare_module_directory(target_dir)
require 'fileutils'

[
File.join(target_dir, 'examples'),
File.join(target_dir, 'files'),
Expand Down
6 changes: 0 additions & 6 deletions lib/pdk/module/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def build_dir
#
# If the directory already exists, remove it first.
def create_build_dir
require 'fileutils'

cleanup_build_dir

PDK::Util::Filesystem.mkdir_p(build_dir)
Expand All @@ -78,8 +76,6 @@ def create_build_dir
#
# @return nil.
def cleanup_build_dir
require 'fileutils'

PDK::Util::Filesystem.rm_rf(build_dir, secure: true)
end

Expand Down Expand Up @@ -115,7 +111,6 @@ def stage_module_in_build_dir
# @return nil.
def stage_path(path)
require 'pathname'
require 'fileutils'

relative_path = Pathname.new(path).relative_path_from(Pathname.new(module_dir))
dest_path = File.join(build_dir, relative_path)
Expand Down Expand Up @@ -224,7 +219,6 @@ def validate_ustar_path!(path)
#
# @return nil.
def build_package
require 'fileutils'
require 'zlib'
require 'minitar'
require 'find'
Expand Down
3 changes: 0 additions & 3 deletions lib/pdk/util/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ module Bundler
class BundleHelper; end

def self.ensure_bundle!(gem_overrides = nil)
require 'fileutils'

bundle = BundleHelper.new

# This will default ensure_bundle! to re-resolving everything to latest
Expand Down Expand Up @@ -110,7 +108,6 @@ def installed?(gem_overrides = {})

def lock!
require 'pdk/util'
require 'fileutils'
require 'pdk/util/ruby_version'

if PDK::Util.package_install?
Expand Down
1 change: 1 addition & 0 deletions lib/pdk/util/filesystem.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pdk'
autoload :FileUtils, 'fileutils'

module PDK
module Util
Expand Down
1 change: 0 additions & 1 deletion lib/pdk/util/puppet_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def fetch_puppet_dev(options = {})
return if options[:run] == :once && puppet_dev_fetched?

require 'pdk/util/git'
require 'fileutils'

# Check if the source is cloned and is a readable git repo
unless PDK::Util::Git.remote_repo? puppet_dev_path
Expand Down
2 changes: 0 additions & 2 deletions lib/pdk/validate/puppet/puppet_epp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def self.remove_validate_tmpdir
return unless @validate_tmpdir
return unless PDK::Util::Filesystem.directory?(@validate_tmpdir)

require 'fileutils'

PDK::Util::Filesystem.remove_entry_secure(@validate_tmpdir)
@validate_tmpdir = nil
end
Expand Down
2 changes: 0 additions & 2 deletions lib/pdk/validate/puppet/puppet_syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def self.remove_validate_tmpdir
return unless @validate_tmpdir
return unless PDK::Util::Filesystem.directory?(@validate_tmpdir)

require 'fileutils'

PDK::Util::Filesystem.remove_entry_secure(@validate_tmpdir)
@validate_tmpdir = nil
end
Expand Down

0 comments on commit d419c56

Please sign in to comment.