Sha256: e2141aec4515e0dfbb6e4f240c0e34de1a4aa7f92a723dbdde4c7110026cd1f3

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Ratch

  # Provides a pure-Ruby method for generating RDocs.
  module RDocUtils

    DEFAULT_RDOC_OPTIONS = {
      :quiet => true
    }

    # RDoc command.
    #
    # :call-seq:
    #   rdoc(file1, file2, ..., :opt1 => val1, ...)
    #
    def rdoc(*files)
      require 'rdoc/rdoc'

      options = Hash===files.last ? files.pop : {}
      options.rekey!(&:to_s)

      options['title'] ||= options.delete('T')

      options['debug']   = options['debug']   #|| debug?
      options['quiet']   = options['quiet']   #|| quiet?
      options['verbose'] = options['verbose'] #|| verbose?

      # apply pom (todo?)
      #options['title'] ||= metadata.title

      options = DEFAULT_RDOC_OPTIONS.merge(options)

      locally do
        rdoc = RDoc::RDoc.new
        opts = options.to_argv + files
        $stderr.puts("rdoc " + opts.join(' ')) if ($VERBOSE || $DEBUG)
        disable_warnings do
          rdoc.document(options.to_argv + files)
        end
      end
    end

    #
    # TODO: Implement ri doc generator.

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ratch-1.2.0 lib/ratch/utils/rdoc.rb