diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-12-13 20:19:08 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-12-13 20:19:33 +0900 |
commit | 82cc2843a92b286cc13afd0860a4e111d4ea2a0b (patch) | |
tree | a517dedd40d35540930cea7732f5a36e76a549e8 /lib/rubygems/uri_parsing.rb | |
parent | 26774351dc5f494253ba031e4bc453dc4dddb2cf (diff) |
Prepare to release RubyGems 3.1.0 final version.
Diffstat (limited to 'lib/rubygems/uri_parsing.rb')
-rw-r--r-- | lib/rubygems/uri_parsing.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/rubygems/uri_parsing.rb b/lib/rubygems/uri_parsing.rb new file mode 100644 index 0000000000..941d7e023a --- /dev/null +++ b/lib/rubygems/uri_parsing.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require "rubygems/uri_parser" + +module Gem::UriParsing + + def parse_uri(source_uri) + return source_uri unless source_uri.is_a?(String) + + uri_parser.parse(source_uri) + end + + private :parse_uri + + def uri_parser + require "uri" + + Gem::UriParser.new + end + + private :uri_parser + +end |