lib/puppet_litmus/rake_helper.rb
# Builds all the modules in a specified directory
#
# @param source_dir [String] the directory to get the modules from
# @param target_dir [String] temporary location to store tarballs before uploading. This directory will be cleaned before use. The default is <source_dir>/pkg
# @return [Array] an array of module tars' filenames
Builds all the modules in a specified directory
Builds all the modules in a specified directory
def build_modules_in_dir(source_dir, target_dir = nil)
    target_dir ||= File.join(Dir.pwd, 'pkg')
    FileUtils.rm_rf(target_dir) if File.directory?(target_dir)
    module_tars = Dir.entries(source_dir).map do |entry|
      next if ['.', '..'].include? entry
      module_dir = File.join(source_dir, entry)
      next unless File.directory? module_dir
      build_module(module_dir, target_dir)
    end
    module_tars.compact
  end
def build_modules_in_dir ( source_dir , target_dir = nil ) target_dir ||= File . join ( Dir . pwd , 'pkg' ) FileUtils . rm_rf ( target_dir ) if File . directory? ( target_dir ) module_tars = Dir . entries ( source_dir ) . map do | entry | next if [ '.' , '..' ] . include? entry module_dir = File . join ( source_dir , entry ) next unless File . directory? module_dir build_module ( module_dir , target_dir ) end module_tars . compact end
Builds all the modules in a specified directory
Builds all the modules in a specified directory
# remove old build dir if exists, before we build afresh
an array of module tars' filenames
an array of module tars ' filenames
Array
source_dir
the directory to get the modules from
the directory to get the modules from
target_dir
temporary location to store tarballs before uploading. This directory will be cleaned before use. The default is /pkg
temporary location to store tarballs before uploading . This directory will be cleaned before use . The default is / pkg