Sha256: f44f33e81519d9a7f2c32922d86129a346d2e6b701f3c6bb3aa702d979603966
Contents?: true
Size: 1.38 KB
Versions: 20
Compression:
Stored size: 1.38 KB
Contents
module Distil JSDOC_COMMAND= "#{VENDOR_DIR}/jsdoc-toolkit/jsrun.sh" class JavascriptDocProduct < Product option :jsdoc_conf, "#{LIB_DIR}/jsdoc.conf" option :jsdoc_template, "#{VENDOR_DIR}/jsdoc-extras/templates/coherent" option :jsdoc_plugins, "#{VENDOR_DIR}/jsdoc-extras/plugins" option :doc_folder, Interpolated, "$(path)/doc" extension "js" def filename File.join(doc_folder, 'index.html') end def write_output return if up_to_date @up_to_date= true return if (!File.exists?(JSDOC_COMMAND)) tmp= Tempfile.new("jsdoc.conf") template= File.read(jsdoc_conf) doc_files= [] files.each { |f| next if !handles_file?(f) p= f.file_path || f.to_s doc_files << "\"#{p}\"" } conf= replace_tokens(template, { "DOC_FILES"=>doc_files.join(",\n"), "DOC_OUTPUT_DIR"=>doc_folder, "DOC_TEMPLATE_DIR"=>jsdoc_template, "DOC_PLUGINS_DIR"=>jsdoc_plugins }) tmp << conf tmp.close() command= "#{JSDOC_COMMAND} -c=#{tmp.path}" stdin, stdout, stderr= Open3.popen3(command) stdin.close output= stdout.read errors= stderr.read tmp.delete puts errors puts output end end end
Version data entries
20 entries across 20 versions & 1 rubygems