File: uri.rb

package info (click to toggle)
liboptparse-ruby 0.8.4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 428 kB
  • ctags: 644
  • sloc: ruby: 1,819; makefile: 47
file content (15 lines) | stat: -rw-r--r-- 335 bytes parent folder | download
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