Sha256: 0e3de1af86c56eafaa906c1922bf7ff46c1647a1958233f3d08c7c4a9316517e

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require 'rubygems/doc_manager'
require 'launchy'

module Shoe
  module Tasks

    # Defines <tt>`rake rdoc`</tt> to generate project documentation.
    #
    # Uses
    # <tt>{Gem::DocManager}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html]</tt>,
    # so rdoc is generated locally just as it will be with <tt>`gem
    # install`</tt> and <tt>`gem rdoc`</tt>. Your users will thank you for
    # making sure their local documentation looks nice.
    #
    # (Incidentally, this is why Shoe prefers rdoc (the file format) over
    # Markdown[http://daringfireball.net/projects/markdown/] and rdoc (the
    # tool) over YARD[http://yardoc.org/], even though both have considerable
    # advantages -- it's what your users are going to get!)
    #
    # This task is always enabled.
    #
    # To configure, add
    # <tt>rdoc_options[http://docs.rubygems.org/read/chapter/20#rdoc_options]</tt> and
    # <tt>extra_rdoc_files[http://docs.rubygems.org/read/chapter/20#extra_rdoc_files]</tt>
    # to your gemspec.
    class Rdoc < Abstract
      def active?
        true
      end

      def define
        desc 'Generate documentation'
        task :rdoc do
          Gem::DocManager.new(spec).extend(Extensions::DocManager).generate_rdoc
          Launchy::Browser.run('rdoc/index.html')
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoe-0.6.1 lib/shoe/tasks/rdoc.rb
shoe-0.6.0 lib/shoe/tasks/rdoc.rb