Module: Hoe::Manifest

Defined in:
lib/hoe/manifest.rb

Overview

Manifest plugin for hoe.

Tasks Provided:

manifest

Recreate the Manifest.txt

Instance Method Summary collapse

Instance Method Details

#define_manifest_tasksObject

Define tasks for plugin.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hoe/manifest.rb', line 12

def define_manifest_tasks
  desc 'Recreate Manifest.txt to include ALL files to be deployed'
  task :manifest => :clean do
    require 'find'
    files = []
    with_config do |config, _|
      exclusions = config["exclude"]
      abort "exclude entry missing from .hoerc. Aborting." if exclusions.nil?
      Find.find '.' do |path|
        next unless File.file? path
        next if path =~ exclusions
        files << path[2..-1]
      end
      files = files.sort.join "\n"
      File.open 'Manifest.txt', 'w' do |fp| fp.puts files end
    end
  end
end