Sha256: dde28aef846557d6a24732170aba86a12b1ec92c062da4c5658ba1f049e9c37b
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
require 'reap/task' require 'facet/gem/self/gempath' class Reap::Template < Reap::Task #task_name 'template' task_desc "Create a ProjectInfo template." task_help %{ reap template Creates an empty PrjectInfo file in the current directory. It will not overwrite a PrjectInfo file if one is already present. } task_available { |app| ! app.projectfile? } # Copies the file from lib/data to the current dir. def run f = nil if ::ProjectInfo::INFO_FILES.any?{ |f| File.exists?(f) } puts "Project file '#{f}' already exists." return end filename = 'ProjectInfo' # if using gems if dir = Gem.gempath('reap') dir = File.join( dir, 'data', 'reap', 'scaffold', 'standard' ) else dir = File.join( ::Config::CONFIG['datadir'], 'reap', 'scaffold', 'standard' ) end f = File.join( dir, filename ) raise "ProjectInfo template file #{f} is missing." unless File.file?( f ) # copy FileUtils.install( f, '.' ) tell "#{filename} created. You'll need to fill it out." return nil end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
reap-5.0.0 | lib/reap/task/template.rb |