Permalink
Browse files

Don't depend on RDoc::Usage any more

This was removed from Ruby 1.9 with no replacement. Since all it
does is print out a nice usage message, and since this is being
used internally by Textmate, AND since this code has not been touched
in 5 years, I think it's perfectly valid to simple hard-wire the
"usage" output and remove the dependency, so that you can reflow
comments when using Ruby 1.9.
  • Loading branch information...
1 parent 421ef13 commit 286c8cfd0c4f29c227cc749963e6f70c590715b2 @norman norman committed with infininight Jul 17, 2011
Showing with 19 additions and 20 deletions.
  1. +19 −20 Support/bin/rubywrap.rb
View
@@ -120,24 +120,23 @@
# With appropriate use of -r and -p RubyWrap should work for any language that
# distinguishes comments by some prefix. Languages that use "# " should work
# well out of the box.
-#
-# == Usage
-#
-# rubywrap.rb [<options>]
-# Options:
-# --prefix, -p <prefix> Use <prefix> as the comment prefix.
-# --shortthreshold -s <n> Lines of length <= n are single line blocks.
-# --cols, -c <n> How many columns to wrap to (default: 78)
-# --tabsize, -t <n> How many spaces a tab is (default: 2)
-# --no-rdoc-style, -n Do not use RDoc conventions.
-# --retabify, -r Retabify output.
-# --help, -h Display this help.
-# --doc, -d Display full documentation.
-# Reads commented code from stdin and outputs wrapped commented code to
-# stdout.
-#
-require 'rdoc/usage'
+$usage = <<-EOS
+rubywrap.rb [<options>]
+Options:
+ --prefix, -p <prefix> Use <prefix> as the comment prefix.
+ --shortthreshold -s <n> Lines of length <= n are single line blocks.
+ --cols, -c <n> How many columns to wrap to (default: 78)
+ --tabsize, -t <n> How many spaces a tab is (default: 2)
+ --no-rdoc-style, -n Do not use RDoc conventions.
+ --retabify, -r Retabify output.
+ --help, -h Display this help.
+ --doc, -d Display full documentation.
+
+Reads commented code from stdin and outputs wrapped commented code to
+stdout.
+EOS
+
require 'getoptlong'
opts = GetoptLong.new(
@@ -172,13 +171,13 @@
when "--retabify"
$retabify = true
when "--help"
- RDoc::usage("Usage")
+ print $usage; exit
when "--doc"
- RDoc::usage
+ print $usage; exit
end
end
if ARGV.length != 0
- RDoc::usage
+ print $usage; exit
end
# Add detabify, entabify to String class.

0 comments on commit 286c8cf

Please sign in to comment.