File: mrbdoc.rb

package info (click to toggle)
mruby 1.0.0%2B20141015%2Bgitb4cc962c-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,408 kB
  • ctags: 3,526
  • sloc: ansic: 25,319; ruby: 10,638; yacc: 5,738; sh: 14; makefile: 12
file content (38 lines) | stat: -rwxr-xr-x 766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
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
#!/usr/bin/env ruby

$: << File.dirname(__FILE__) + '/lib'

require 'mrbdoc_analyze'
require 'mrbdoc_docu'

MRUBY_ROOT = ARGV[0]
DOC_ROOT = ARGV[1]
_WRITE_LINE_NO = ARGV[2]
STDOUT.sync = true

raise ArgumentError.new 'mruby root missing!' if MRUBY_ROOT.nil?
raise ArgumentError.new 'doc root missing!' if DOC_ROOT.nil?

if _WRITE_LINE_NO.nil?
  WRITE_LINE_NO = true
else
  case _WRITE_LINE_NO
  when 'true'
    WRITE_LINE_NO = true
  when 'false'
    WRITE_LINE_NO = false
  else
    raise ArgumentError.new 'Line no parameter has to be false or true!'
  end
end

mrbdoc = MRBDoc.new

mrbdoc.analyze_code MRUBY_ROOT do |progress|
  puts progress
end

cfg = {:print_line_no => WRITE_LINE_NO}
mrbdoc.write_documentation DOC_ROOT, cfg do |progress|
  puts progress
end