Method: UtilityFunctions.readManifest

Defined in:
lib/carat-dev/misc/utils.rb

.readManifest(manifestFile = "MANIFEST") ⇒ Object

Read the specified manifestFile, which is a text file describing which files to package up for a distribution. The manifest should consist of one or more lines, each containing one filename or shell glob pattern.



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/carat-dev/misc/utils.rb', line 265

def readManifest( manifestFile="MANIFEST" )
    message "Building manifest..."
    raise "Missing #{manifestFile}, please remake it" unless File.exists? manifestFile

    manifest = IO::readlines( manifestFile ).collect{ |line|
      line.chomp
    }.select{ |line|
      line !~ /^(\s*(#.*)?)?$/
    }

    filelist = []
    for pat in manifest
        $stderr.puts "Adding files that match '#{pat}' to the file list" if $VERBOSE
        filelist |= Dir.glob( pat ).find_all {|f| FileTest.file?(f)}
    end

    message "found #{filelist.length} files.\n"
    return filelist
end