Sha256: a3c12411eb3af2fc39160ebb35e6e1d03fc7e8499e456dfad7d9dc23701610ab

Contents?: true

Size: 1.73 KB

Versions: 28

Compression:

Stored size: 1.73 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'oyster'
require File.dirname(__FILE__) + '/../lib/pdoc'

spec = Oyster.spec do
  name "pdoc -- Inline comment parser and JavaScript documentation generator"
  author "Tobie Langel <tobie.langel@gmail.com>"
  
  synopsis <<-EOS
    pdoc [-o OUTPUT_DIR] [-t TEMPLATE_DIR] SOURCE_FILES
    pdoc [OPTIONS] -d SOURCE_DIRECTORY
  EOS
  
  string :directory,
         :desc => "Directory to search for JavaScript files. Will take all *.js " +
                  "files from the given directory (including subdirectories) and use " +
                  "them to generate documentation. This option takes precedence over " +
                  "SOURCE_FILES."
  
  string :output,
         :desc => "Directory in which to dump output files",
         :default => "pdoc"
  
  string :templates,
         :desc => "Directory containing template files"
  
  subcommand :'copy-templates' do
    synopsis <<-EOS
      pdoc copy-templates TYPE DESTINATION
    EOS
    
    description <<-EOS
      PDoc includes a set of default templates for each type of output generator.
      This command lets you extract a set of these templates into a local directory
      so you can tweak it to suit your needs. Be sure to specify your set of
      templates next time you run pdoc.
    EOS
  end
end

begin; options = spec.parse
rescue Oyster::HelpRendered; exit
end

if command = options[:'copy-templates']
  args = command[:unclaimed]
  PDoc.copy_templates(args[0], File.expand_path(args[1]))
  exit
end

files = (d = options[:directory]) ?
        Dir["#{d}/**/*.js"].map(&File.method(:expand_path)) :
        options[:unclaimed].dup

files << {:destination => options[:output], :templates => options[:templates]}
PDoc::Runner.new(*files).run

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
distil-0.14.4 vendor/pdoc/bin/pdoc
distil-0.14.3 vendor/pdoc/bin/pdoc
distil-0.14.2 vendor/pdoc/bin/pdoc
distil-0.14.2.a vendor/pdoc/bin/pdoc
distil-0.14.1 vendor/pdoc/bin/pdoc
distil-0.14.1.a vendor/pdoc/bin/pdoc
distil-0.14.0 vendor/pdoc/bin/pdoc
distil-0.14.0.i vendor/pdoc/bin/pdoc
distil-0.14.0.h vendor/pdoc/bin/pdoc
distil-0.14.0.g vendor/pdoc/bin/pdoc
distil-0.14.0.d vendor/pdoc/bin/pdoc
distil-0.14.0.c vendor/pdoc/bin/pdoc
distil-0.14.0.b vendor/pdoc/bin/pdoc
distil-0.13.6 vendor/pdoc/bin/pdoc
distil-0.13.5 vendor/pdoc/bin/pdoc
distil-0.13.4 vendor/pdoc/bin/pdoc
distil-0.13.3 vendor/pdoc/bin/pdoc
distil-0.13.2 vendor/pdoc/bin/pdoc
distil-0.13.1 vendor/pdoc/bin/pdoc
distil-0.13.0 vendor/pdoc/bin/pdoc