Module: RDoc
- Defined in:
- lib/saikuro/usage.rb
Class Method Summary collapse
- .main_program_file=(file) ⇒ Object
-
.usage_no_exit(*args) ⇒ Object
Display usage.
Class Method Details
.main_program_file=(file) ⇒ Object
8 9 10 |
# File 'lib/saikuro/usage.rb', line 8 def RDoc.main_program_file=(file) @@main_program_file = file end |
.usage_no_exit(*args) ⇒ Object
Display usage
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/saikuro/usage.rb', line 13 def RDoc.usage_no_exit(*args) @@main_program_file ||= caller[-1].sub(/:\d+$/, '') comment = File.open(@@main_program_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 = RI::Options.instance if args = ENV["RI"] .parse(args.split) end formatter = .formatter.new(, "") formatter.display_flow(flow) end |