Sha256: 3d0d05457be93423730601bfdcdcaa31623e79c86c83c5d6e3f6e7a59afb2aaf

Contents?: true

Size: 897 Bytes

Versions: 25

Compression:

Stored size: 897 Bytes

Contents

require 'rdoc/usage'

#due to a bug in rdoc, RDoc.usage won't work correctly when run from a gem executable
# see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/211297
# Display usage from the given file

def RDoc.usage_from_file(input_file, *args)
        comment = File.open(input_file) do |file|
                RDoc.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)
        exit
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
ripxplore-0.17.1 lib/rdoc_patch.rb
ripxplore-0.17.0 lib/rdoc_patch.rb
ripxplore-0.16.1 lib/rdoc_patch.rb
ripxplore-0.15.1 lib/rdoc_patch.rb
ripxplore-0.14.1 lib/rdoc_patch.rb
ripxplore-0.14.0 lib/rdoc_patch.rb
ripxplore-0.13.0 lib/rdoc_patch.rb
ripxplore-0.12.0 lib/rdoc_patch.rb
ripxplore-0.11.0 lib/rdoc_patch.rb
dsktool-0.1.6 lib/rdoc_patch.rb
dsktool-0.1.5 lib/rdoc_patch.rb
dsktool-0.2.1 lib/rdoc_patch.rb
dsktool-0.4.2 lib/rdoc_patch.rb
dsktool-0.4.1 lib/rdoc_patch.rb
dsktool-0.5.1 lib/rdoc_patch.rb
ripxplore-0.0.2 lib/rdoc_patch.rb
ripxplore-0.4.0 lib/rdoc_patch.rb
ripxplore-0.0.1 lib/rdoc_patch.rb
ripxplore-0.5.0 lib/rdoc_patch.rb
ripxplore-0.5.1 lib/rdoc_patch.rb