Sha256: 78d754fc0e5c5d1d7304ddae7350658d1dd4b3e791b240f7f5dee62e78b07714

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

# $Id$

require 'find'

namespace :manifest do

  desc 'Verify the manifest'
  task :check do
    fn = 'Manifest.tmp'
    files = manifest_files

    File.open(fn, 'w') {|fp| fp.puts files}
    lines = %x(#{DIFF} -du Manifest.txt #{fn}).split("\n")
    if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
      lines.map! do |line|
        case line
        when %r/^(-{3}|\+{3})/; nil
        when %r/^@/; Console::ANSICode.blue line
        when %r/^\+/; Console::ANSICode.green line
        when %r/^\-/; Console::ANSICode.red line
        else line end
      end
    end
    puts lines.compact
    rm fn rescue nil
  end

  desc 'Create a new manifest'
  task :create do
    fn = 'Manifest.txt'
    files = manifest_files
    unless test(?f, fn)
      files << fn
      files.sort!
    end
    File.open(fn, 'w') {|fp| fp.puts files}
  end

  task :assert do
    files = manifest_files
    manifest = File.read('Manifest.txt').split($/)
    raise RuntimeError, "Manifest.txt is out of date" unless files == manifest
  end

end  # namespace :manifest

desc 'Alias to manifest:check'
task :manifest => 'manifest:check'

# EOF

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
topfunky-castanaut-1.0.1 tasks/manifest.rake
bones-1.3.3 data/tasks/manifest.rake
castanaut-1.0.0 tasks/manifest.rake