Sha256: 4f73f7ee45b3ff4a89fb386b341dc2537ab08cd03012ed55c0a131d5b0bb85c0

Contents?: true

Size: 1.27 KB

Versions: 17

Compression:

Stored size: 1.27 KB

Contents

# $Id$

require 'find'

namespace :manifest do

  desc 'Verify the manifest'
  task :check do
    fn = 'Manifest.tmp'
    files = []
    exclude = Regexp.new(PROJ.exclude.join('|'))
    Find.find '.' do |path|
      path.sub! %r/^(\.\/|\/)/o, ''
      next unless test ?f, path
      next if path =~ exclude
      files << path
    end

    File.open(fn, 'w') {|fp| fp.puts files.sort}
    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 = []
    exclude = Regexp.new(PROJ.exclude.join('|'))
    Find.find '.' do |path|
      path.sub! %r/^(\.\/|\/)/o, ''
      next unless test ?f, path
      next if path =~ exclude
      files << path
    end

    files << fn unless test ?f, fn
    File.open(fn, 'w') {|fp| fp.puts files.sort}
  end
end  # namespace :manifest

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

# EOF

Version data entries

17 entries across 15 versions & 6 rubygems

Version Path
bones-1.3.2 data/tasks/manifest.rake
bones-1.3.2 tasks/manifest.rake
logging-0.6.3 tasks/manifest.rake
logging-0.7.0 tasks/manifest.rake
logging-0.6.2 tasks/manifest.rake
ludy-0.1.10 tasks/manifest.rake
ludy-0.1.9 tasks/manifest.rake
pyre-0.2.0 tasks/manifest.rake
pyre-0.1.0 tasks/manifest.rake
pyre-0.3.1 tasks/manifest.rake
pyre-0.3.0 tasks/manifest.rake
pyre-0.1.1 tasks/manifest.rake
spacer-0.5.1 tasks/manifest.rake
spacer-0.5.1 tasks/archive/manifest.rake
spacer-0.5.0 tasks/manifest.rake
webby-0.7.4 tasks/manifest.rake
webby-0.7.3 tasks/manifest.rake