⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (377 Bytes)
Bug #19566
» ruby-op-uri-bug-workaround.rb
jgomo3 (Jesús Gómez)
, 03/31/2023 10:56 PM
#!/usr/bin/env ruby
require
'optionparser'
require
'uri'
input
=
[
"--uri"
,
"http://example.com/"
]
results
=
{}
op
=
OptionParser
.
new
op
.
accept
(
URI
,
&
URI
.
method
(
:parse
))
op
.
on
(
"--uri URI"
,
URI
,
"According to OptionParser doc, 'Anything accepted by URI.parse'"
)
do
|
v
|
results
[
:uri
]
=
v
end
op
.
parse
(
input
)
puts
"Input:
#{
input
[
1
]
}
"
puts
"Parsed:
#{
results
[
:uri
]
}
"
« Previous
1
2
Next »
(2-2/2)
Loading...