Sha256: 68c3ba5a9c5706bb31a24e013ddebd872ad7e0afe9cc551996cd417c8bc42157
Contents?: true
Size: 1.29 KB
Versions: 4
Compression:
Stored size: 1.29 KB
Contents
require "rake" require "fileutils" require "dtc_rake/config" require "dtc_rake/product" require "dtc_rake/ui" require "dtc_rake/util" include DtcRake::UI product = DtcRake::Product.instance def build_yardoc(product) begin require "zip" rescue LoadError error "Gem rubyzip is not available. In order to use this task, you must: gem install rubyzip" end announce "Building command client yardoc pack" output_dir = DtcRake::Config.instance.output_dir archive = product.yardoc_file_name tmp_dir = File.basename(archive, ".zip") FileUtils.cd product.gem_project do [ File.join(output_dir, tmp_dir), File.join(output_dir, "doc") ].each do |dir| FileUtils.rm_rf dir if File.directory? dir end system "yardoc" FileUtils.cd output_dir do FileUtils.mv "doc", tmp_dir info "Creating #{archive}" FileUtils.rm_f archive Zip::File.open(archive, "w") do |zip| Dir["#{tmp_dir}/**/**"].reject { |f| f == archive }.each do |file| zip.add(file.sub("target/", ""), file) end end end end DtcRake.mv_to_output_dir(product.gem_project, archive) end if product.has_gem namespace :build do desc "Builds pack with command client yardoc" task :yardoc do build_yardoc(product) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
dtc_rake-1.0.0.pre.beta.1 | lib/tasks/build_yardoc.rake |
dtc_rake-0.2.0 | lib/tasks/build_yardoc.rake |
dtc_rake-0.1.2 | lib/tasks/build_yardoc.rake |
dtc_rake-0.1.0 | lib/tasks/build_yardoc.rake |