summaryrefslogtreecommitdiff
path: root/lib/optparse/uri.rb
blob: bba0db209dc1181de75924c660962c4783424549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- ruby -*-

require 'optparse'
unless defined?(URI)
  begin
    require 'URI/uri'		# Akira Yamada version.
  rescue LoadError
    require 'uri/uri'		# Tomoyuki Kosimizu version.
  end
end
if URI.respond_to?(:parse)
  OptionParser.accept(URI) {|s| [URI.parse(s)] if s}
else
  OptionParser.accept(URI) {|s| [URI.create(s)] if s}
end