rdoc 788 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. begin
  9. gem 'rdoc'
  10. rescue NameError => e # --disable-gems
  11. raise unless e.name == :gem
  12. rescue Gem::LoadError
  13. end
  14. require 'rdoc/rdoc'
  15. begin
  16. r = RDoc::RDoc.new
  17. r.document ARGV
  18. rescue SystemExit
  19. raise
  20. rescue Exception => e
  21. if $DEBUG_RDOC then
  22. $stderr.puts e.message
  23. $stderr.puts "#{e.backtrace.join "\n\t"}"
  24. $stderr.puts
  25. elsif Interrupt === e then
  26. $stderr.puts
  27. $stderr.puts 'Interrupted'
  28. else
  29. $stderr.puts "uh-oh! RDoc had a problem:"
  30. $stderr.puts e.message
  31. $stderr.puts
  32. $stderr.puts "run with --debug for full backtrace"
  33. end
  34. exit 1
  35. end