Debian Codegraph @

libexec/rdoc

raw
1 #!/usr/bin/env ruby
2 #
3 # RDoc: Documentation tool for source code
4 # (see lib/rdoc/rdoc.rb for more information)
5 #
6 # Copyright (c) 2003 Dave Thomas
7 # Released under the same terms as Ruby
8
9 begin
10 gem 'rdoc'
11 rescue NameError => e # --disable-gems
12 raise unless e.name == :gem
13 rescue Gem::LoadError
14 end
15
16 require 'rdoc/rdoc'
17
18 begin
19 r = RDoc::RDoc.new
20 r.document ARGV
21 rescue Errno::ENOSPC
22 $stderr.puts 'Ran out of space creating documentation'
23 $stderr.puts
24 $stderr.puts 'Please free up some space and try again'
25 rescue SystemExit
26 raise
27 rescue Exception => e
28 if $DEBUG_RDOC then
29 $stderr.puts e.message
30 $stderr.puts "#{e.backtrace.join "\n\t"}"
31 $stderr.puts
32 elsif Interrupt === e then
33 $stderr.puts
34 $stderr.puts 'Interrupted'
35 else
36 $stderr.puts "uh-oh! RDoc had a problem:"
37 $stderr.puts e.message
38 $stderr.puts
39 $stderr.puts "run with --debug for full backtrace"
40 end
41
42 exit 1
43 end