lib/pdk/module/build.rb in pdk-1.7.0 vs lib/pdk/module/build.rb in pdk-1.7.1

- old
+ new

@@ -6,10 +6,20 @@ require 'pdk/tests/unit' module PDK module Module class Build + DEFAULT_IGNORED = [ + '/pkg/', + '.*', + '~*', + '/coverage', + '/checksums.json', + '/REVISION', + '/spec/fixtures/modules/', + ].freeze + def self.invoke(options = {}) new(options).build end attr_reader :module_dir @@ -35,11 +45,10 @@ # Build a module package from a module directory. # # @return [String] The path to the built package file. def build - cleanup_module create_build_dir stage_module_in_build_dir build_package @@ -81,21 +90,10 @@ # @return nil. def cleanup_build_dir FileUtils.rm_rf(build_dir, secure: true) end - # Clean up any files created during use of the PDK that shouldn't be part - # of the built module (e.g. test fixtures). - # - # @return nil - def cleanup_module - PDK::Util::Bundler.ensure_bundle! - PDK::Util::Bundler.ensure_binstubs!('rake') - - PDK::Test::Unit.tear_down - end - # Combine the module name and version into a Forge-compatible dash # separated string. # # @return [String] The module name and version, joined by a dash. def release_name @@ -212,9 +210,11 @@ end if File.realdirpath(target_dir).start_with?(File.realdirpath(module_dir)) ignored = ignored.add("\/#{File.basename(target_dir)}\/") end + + DEFAULT_IGNORED.each { |r| ignored.add(r) } ignored end end end