Sha256: 34a6d140e93d6a8cee6c5f80f09e20a94a1808c5441980fafc01729bb59eee1d

Contents?: true

Size: 1.45 KB

Versions: 6

Compression:

Stored size: 1.45 KB

Contents

=begin
  Copyright 2004 Dave Thomas
  Copyright 2006 Suraj N. Kurapati

  This file is part of Ruby-VPI.

  Ruby-VPI is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  Ruby-VPI is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Ruby-VPI; if not, write to the Free Software Foundation,
  Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
=end

require 'rdoc/usage'

module RDoc
  # Display usage information from RDoc comments in the given file.
  def RDoc.usage_from_file input_file, *args
    comment = File.open(input_file) do |file|
      find_comment(file)
    end

    comment = comment.gsub(/^\s*#/, '')

    markup = SM::SimpleMarkup.new
    flow_convertor = SM::ToFlow.new

    flow = markup.convert(comment, flow_convertor)

    format = "plain"

    unless args.empty?
      flow = extract_sections(flow, args)
    end

    options = RI::Options.instance
    if args = ENV["RI"]
      options.parse(args.split)
    end
    formatter = options.formatter.new(options, "")
    formatter.display_flow(flow)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-vpi-13.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-14.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-12.1.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-15.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-15.0.2 lib/ruby-vpi/rdoc.rb
ruby-vpi-15.0.1 lib/ruby-vpi/rdoc.rb