Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 286c8cfd0c4f29c227cc749963e6f70c590715b2 1 parent 421ef13
Norman Clarke norman authored infininight committed

Showing 1 changed file with 19 additions and 20 deletions. Show diff stats Hide diff stats

  1. +19 20 Support/bin/rubywrap.rb
39 Support/bin/rubywrap.rb
@@ -120,24 +120,23 @@
120 120 # With appropriate use of -r and -p RubyWrap should work for any language that
121 121 # distinguishes comments by some prefix. Languages that use "# " should work
122 122 # well out of the box.
123   -#
124   -# == Usage
125   -#
126   -# rubywrap.rb [<options>]
127   -# Options:
128   -# --prefix, -p <prefix> Use <prefix> as the comment prefix.
129   -# --shortthreshold -s <n> Lines of length <= n are single line blocks.
130   -# --cols, -c <n> How many columns to wrap to (default: 78)
131   -# --tabsize, -t <n> How many spaces a tab is (default: 2)
132   -# --no-rdoc-style, -n Do not use RDoc conventions.
133   -# --retabify, -r Retabify output.
134   -# --help, -h Display this help.
135   -# --doc, -d Display full documentation.
136   -# Reads commented code from stdin and outputs wrapped commented code to
137   -# stdout.
138   -#
139 123
140   -require 'rdoc/usage'
  124 +$usage = <<-EOS
  125 +rubywrap.rb [<options>]
  126 +Options:
  127 + --prefix, -p <prefix> Use <prefix> as the comment prefix.
  128 + --shortthreshold -s <n> Lines of length <= n are single line blocks.
  129 + --cols, -c <n> How many columns to wrap to (default: 78)
  130 + --tabsize, -t <n> How many spaces a tab is (default: 2)
  131 + --no-rdoc-style, -n Do not use RDoc conventions.
  132 + --retabify, -r Retabify output.
  133 + --help, -h Display this help.
  134 + --doc, -d Display full documentation.
  135 +
  136 +Reads commented code from stdin and outputs wrapped commented code to
  137 +stdout.
  138 +EOS
  139 +
141 140 require 'getoptlong'
142 141
143 142 opts = GetoptLong.new(
@@ -172,13 +171,13 @@
172 171 when "--retabify"
173 172 $retabify = true
174 173 when "--help"
175   - RDoc::usage("Usage")
  174 + print $usage; exit
176 175 when "--doc"
177   - RDoc::usage
  176 + print $usage; exit
178 177 end
179 178 end
180 179 if ARGV.length != 0
181   - RDoc::usage
  180 + print $usage; exit
182 181 end
183 182
184 183 # Add detabify, entabify to String class.

0 comments on commit 286c8cf

Please sign in to comment.
Something went wrong with that request. Please try again.