Module: RunfileTasks::Docs

Extended by:
Docs
Included in:
Docs
Defined in:
lib/runfile-tasks/docs/rdoc.rb

Constant Summary collapse

@@default_rdoc_options =
[
  "--main README.md",
  "--all",
]

Instance Method Summary collapse

Instance Method Details

#rdoc(files = nil, options = @@default_rdoc_options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/runfile-tasks/docs/rdoc.rb', line 10

def rdoc(files=nil, options=@@default_rdoc_options)
  files or files = Dir['**/*.{rb,md}']
  files = "'" + files.join("' '") + "'"
  usage  "rdoc [-- OPTIONS...]"
  help   "Generate documentation using the rdoc command line tool. To pass arguments to rdoc, place them after '--'."
  action :rdoc do |args|
    inopts = args['OPTIONS']
    options = inopts unless inopts.empty?
    options = options.join(' ')
    cmd = "rdoc #{options} #{files}"
    say "!txtgrn!Running: !txtpur!#{cmd}"
    system cmd
  end
end