17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/capify.rb', line 17
def capify
unless options[:list]
capfile_temp = "templates/Capfile.tt"
deploy_temp = "templates/deploy.rb.tt"
@recipes = requires.collect { |task| "require 'cap_recipes/tasks/#{task}'" }.join("\n")
template capfile_temp, File.join(path,'/Capfile')
template deploy_temp, File.join(path,'/config/deploy.rb')
else
folders = Dir.glob( File.dirname(__FILE__) + "/../lib/cap_recipes/tasks/*.rb").inject({}) do |packages,file|
desc = IO.readlines(file).first
packages[File.basename(file, ".rb")] = ((desc =~ /#/) ? desc : "No description")
packages
end
puts "Available Recipes:\n"
puts folders.collect { |folder,desc| "\t* #{folder} - #{desc}"}.join("\n")
end
end
|