Sha256: 93314ed6c392e9ab9fa5a2bc382b7631c04727515a1831a42985b0d8572208df

Contents?: true

Size: 1.45 KB

Versions: 15

Compression:

Stored size: 1.45 KB

Contents

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

  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

15 entries across 15 versions & 1 rubygems

Version Path
ruby-vpi-10.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-11.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-11.1.1 lib/ruby-vpi/rdoc.rb
ruby-vpi-12.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-11.1.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-12.0.1 lib/ruby-vpi/rdoc.rb
ruby-vpi-12.0.2 lib/ruby-vpi/rdoc.rb
ruby-vpi-7.3.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-8.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-7.1.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-7.2.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-7.0.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-8.1.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-8.2.0 lib/ruby-vpi/rdoc.rb
ruby-vpi-9.0.0 lib/ruby-vpi/rdoc.rb