uri 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of uri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +21 -0
- data/README.md +4 -3
- data/Rakefile +9 -2
- data/lib/uri/common.rb +76 -91
- data/lib/uri/file.rb +7 -1
- data/lib/uri/ftp.rb +2 -2
- data/lib/uri/generic.rb +32 -13
- data/lib/uri/http.rb +40 -3
- data/lib/uri/https.rb +2 -2
- data/lib/uri/ldap.rb +2 -2
- data/lib/uri/ldaps.rb +2 -1
- data/lib/uri/mailto.rb +2 -3
- data/lib/uri/rfc2396_parser.rb +14 -21
- data/lib/uri/rfc3986_parser.rb +11 -17
- data/lib/uri/version.rb +1 -1
- data/lib/uri/ws.rb +83 -0
- data/lib/uri/wss.rb +23 -0
- data/lib/uri.rb +3 -3
- data/uri.gemspec +4 -2
- metadata +12 -8
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a80d9c44af3ea75a719aee7ec6d152ce0252b862baafc52458952321720334c3
|
4
|
+
data.tar.gz: 73a981c24af7b9f66afe406ad1a8aaf94e0af8e67b4d0cf0fbabec3b8a66153d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b831894911f07c4c50717a3de80e5cfacc8720bb3ab2598da01d9de50552d0b4a7cff7263c4cd359f5908484e76ab07ae43d82ab9439b1b2184c7d0132552e
|
7
|
+
data.tar.gz: cf7054d37950fed4bbfa06dbdd2c3304f23b74c04817e36e7ad7887cceb4d8134feccaab35a9f1a20bcb6882ac5947d4f6518a83236f1d7555a2369bf31f2595
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: [ 3.1, '3.0', 2.7, 2.6, 2.5, 2.4, head, truffleruby ]
|
11
|
+
os: [ ubuntu-latest, macos-latest ]
|
12
|
+
runs-on: ${{ matrix.os }}
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
bundler-cache: true
|
20
|
+
- name: Run test
|
21
|
+
run: rake test
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# URI
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
[](https://github.com/ruby/uri/actions/workflows/test.yml)
|
4
|
+
|
5
|
+
URI is a module providing classes to handle Uniform Resource Identifiers [RFC2396](http://tools.ietf.org/html/rfc2396).
|
5
6
|
|
6
7
|
## Features
|
7
8
|
|
@@ -50,4 +51,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
50
51
|
|
51
52
|
## Contributing
|
52
53
|
|
53
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
54
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/uri.
|
data/Rakefile
CHANGED
@@ -2,9 +2,16 @@ require "bundler/gem_tasks"
|
|
2
2
|
require "rake/testtask"
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs << "test
|
6
|
-
t.
|
5
|
+
t.libs << "test/lib"
|
6
|
+
t.ruby_opts << "-rhelper"
|
7
7
|
t.test_files = FileList["test/**/test_*.rb"]
|
8
8
|
end
|
9
9
|
|
10
|
+
task :sync_tool do
|
11
|
+
require 'fileutils'
|
12
|
+
FileUtils.cp "../ruby/tool/lib/test/unit/core_assertions.rb", "./test/lib"
|
13
|
+
FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
|
14
|
+
FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
|
15
|
+
end
|
16
|
+
|
10
17
|
task :default => :test
|
data/lib/uri/common.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -14,9 +13,12 @@ require_relative "rfc2396_parser"
|
|
14
13
|
require_relative "rfc3986_parser"
|
15
14
|
|
16
15
|
module URI
|
16
|
+
include RFC2396_REGEXP
|
17
|
+
|
17
18
|
REGEXP = RFC2396_REGEXP
|
18
19
|
Parser = RFC2396_Parser
|
19
20
|
RFC3986_PARSER = RFC3986_Parser.new
|
21
|
+
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
|
20
22
|
|
21
23
|
# URI::Parser.new
|
22
24
|
DEFAULT_PARSER = Parser.new
|
@@ -28,6 +30,7 @@ module URI
|
|
28
30
|
DEFAULT_PARSER.regexp.each_pair do |sym, str|
|
29
31
|
const_set(sym, str)
|
30
32
|
end
|
33
|
+
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
31
34
|
|
32
35
|
module Util # :nodoc:
|
33
36
|
def make_components_hash(klass, array_hash)
|
@@ -61,88 +64,44 @@ module URI
|
|
61
64
|
module_function :make_components_hash
|
62
65
|
end
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
# == Synopsis
|
68
|
-
#
|
69
|
-
# URI.escape(str [, unsafe])
|
70
|
-
#
|
71
|
-
# == Args
|
72
|
-
#
|
73
|
-
# +str+::
|
74
|
-
# String to replaces in.
|
75
|
-
# +unsafe+::
|
76
|
-
# Regexp that matches all symbols that must be replaced with codes.
|
77
|
-
# By default uses <tt>UNSAFE</tt>.
|
78
|
-
# When this argument is a String, it represents a character set.
|
79
|
-
#
|
80
|
-
# == Description
|
81
|
-
#
|
82
|
-
# Escapes the string, replacing all unsafe characters with codes.
|
83
|
-
#
|
84
|
-
# This method is obsolete and should not be used. Instead, use
|
85
|
-
# CGI.escape, URI.encode_www_form or URI.encode_www_form_component
|
86
|
-
# depending on your specific use case.
|
87
|
-
#
|
88
|
-
# == Usage
|
89
|
-
#
|
90
|
-
# require 'uri'
|
91
|
-
#
|
92
|
-
# enc_uri = URI.escape("http://example.com/?a=\11\15")
|
93
|
-
# # => "http://example.com/?a=%09%0D"
|
94
|
-
#
|
95
|
-
# URI.unescape(enc_uri)
|
96
|
-
# # => "http://example.com/?a=\t\r"
|
97
|
-
#
|
98
|
-
# URI.escape("@?@!", "!?")
|
99
|
-
# # => "@%3F@%21"
|
100
|
-
#
|
101
|
-
def escape(*arg)
|
102
|
-
warn "URI.escape is obsolete", uplevel: 1
|
103
|
-
DEFAULT_PARSER.escape(*arg)
|
104
|
-
end
|
105
|
-
alias encode escape
|
106
|
-
#
|
107
|
-
# == Synopsis
|
108
|
-
#
|
109
|
-
# URI.unescape(str)
|
110
|
-
#
|
111
|
-
# == Args
|
112
|
-
#
|
113
|
-
# +str+::
|
114
|
-
# String to unescape.
|
115
|
-
#
|
116
|
-
# == Description
|
117
|
-
#
|
118
|
-
# This method is obsolete and should not be used. Instead, use
|
119
|
-
# CGI.unescape, URI.decode_www_form or URI.decode_www_form_component
|
120
|
-
# depending on your specific use case.
|
121
|
-
#
|
122
|
-
# == Usage
|
123
|
-
#
|
124
|
-
# require 'uri'
|
125
|
-
#
|
126
|
-
# enc_uri = URI.escape("http://example.com/?a=\11\15")
|
127
|
-
# # => "http://example.com/?a=%09%0D"
|
128
|
-
#
|
129
|
-
# URI.unescape(enc_uri)
|
130
|
-
# # => "http://example.com/?a=\t\r"
|
131
|
-
#
|
132
|
-
def unescape(*arg)
|
133
|
-
warn "URI.unescape is obsolete", uplevel: 1
|
134
|
-
DEFAULT_PARSER.unescape(*arg)
|
135
|
-
end
|
136
|
-
alias decode unescape
|
137
|
-
end # module Escape
|
67
|
+
module Schemes
|
68
|
+
end
|
69
|
+
private_constant :Schemes
|
138
70
|
|
139
|
-
|
140
|
-
|
71
|
+
#
|
72
|
+
# Register the given +klass+ to be instantiated when parsing URLs with the given +scheme+.
|
73
|
+
# Note that currently only schemes which after .upcase are valid constant names
|
74
|
+
# can be registered (no -/+/. allowed).
|
75
|
+
#
|
76
|
+
def self.register_scheme(scheme, klass)
|
77
|
+
Schemes.const_set(scheme.to_s.upcase, klass)
|
78
|
+
end
|
141
79
|
|
142
|
-
@@schemes = {}
|
143
80
|
# Returns a Hash of the defined schemes.
|
144
81
|
def self.scheme_list
|
145
|
-
|
82
|
+
Schemes.constants.map { |name|
|
83
|
+
[name.to_s.upcase, Schemes.const_get(name)]
|
84
|
+
}.to_h
|
85
|
+
end
|
86
|
+
|
87
|
+
INITIAL_SCHEMES = scheme_list
|
88
|
+
private_constant :INITIAL_SCHEMES
|
89
|
+
Ractor.make_shareable(INITIAL_SCHEMES) if defined?(Ractor)
|
90
|
+
|
91
|
+
#
|
92
|
+
# Construct a URI instance, using the scheme to detect the appropriate class
|
93
|
+
# from +URI.scheme_list+.
|
94
|
+
#
|
95
|
+
def self.for(scheme, *arguments, default: Generic)
|
96
|
+
const_name = scheme.to_s.upcase
|
97
|
+
|
98
|
+
uri_class = INITIAL_SCHEMES[const_name]
|
99
|
+
uri_class ||= if /\A[A-Z]\w*\z/.match?(const_name) && Schemes.const_defined?(const_name, false)
|
100
|
+
Schemes.const_get(const_name, false)
|
101
|
+
end
|
102
|
+
uri_class ||= default
|
103
|
+
|
104
|
+
return uri_class.new(scheme, *arguments)
|
146
105
|
end
|
147
106
|
|
148
107
|
#
|
@@ -315,7 +274,7 @@ module URI
|
|
315
274
|
#
|
316
275
|
# Returns a Regexp object which matches to URI-like strings.
|
317
276
|
# The Regexp object returned by this method includes arbitrary
|
318
|
-
# number of capture group (parentheses). Never rely on
|
277
|
+
# number of capture group (parentheses). Never rely on its number.
|
319
278
|
#
|
320
279
|
# == Usage
|
321
280
|
#
|
@@ -341,6 +300,7 @@ module URI
|
|
341
300
|
256.times do |i|
|
342
301
|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
|
343
302
|
end
|
303
|
+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
|
344
304
|
TBLENCWWWCOMP_[' '] = '+'
|
345
305
|
TBLENCWWWCOMP_.freeze
|
346
306
|
TBLDECWWWCOMP_ = {} # :nodoc:
|
@@ -362,10 +322,37 @@ module URI
|
|
362
322
|
# If +enc+ is given, convert +str+ to the encoding before percent encoding.
|
363
323
|
#
|
364
324
|
# This is an implementation of
|
365
|
-
#
|
325
|
+
# https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data.
|
366
326
|
#
|
367
327
|
# See URI.decode_www_form_component, URI.encode_www_form.
|
368
328
|
def self.encode_www_form_component(str, enc=nil)
|
329
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_, str, enc)
|
330
|
+
end
|
331
|
+
|
332
|
+
# Decodes given +str+ of URL-encoded form data.
|
333
|
+
#
|
334
|
+
# This decodes + to SP.
|
335
|
+
#
|
336
|
+
# See URI.encode_www_form_component, URI.decode_www_form.
|
337
|
+
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
338
|
+
_decode_uri_component(/\+|%\h\h/, str, enc)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Encodes +str+ using URL encoding
|
342
|
+
#
|
343
|
+
# This encodes SP to %20 instead of +.
|
344
|
+
def self.encode_uri_component(str, enc=nil)
|
345
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
|
346
|
+
end
|
347
|
+
|
348
|
+
# Decodes given +str+ of URL-encoded data.
|
349
|
+
#
|
350
|
+
# This does not decode + to SP.
|
351
|
+
def self.decode_uri_component(str, enc=Encoding::UTF_8)
|
352
|
+
_decode_uri_component(/%\h\h/, str, enc)
|
353
|
+
end
|
354
|
+
|
355
|
+
def self._encode_uri_component(regexp, table, str, enc)
|
369
356
|
str = str.to_s.dup
|
370
357
|
if str.encoding != Encoding::ASCII_8BIT
|
371
358
|
if enc && enc != Encoding::ASCII_8BIT
|
@@ -374,19 +361,16 @@ module URI
|
|
374
361
|
end
|
375
362
|
str.force_encoding(Encoding::ASCII_8BIT)
|
376
363
|
end
|
377
|
-
str.gsub!(
|
364
|
+
str.gsub!(regexp, table)
|
378
365
|
str.force_encoding(Encoding::US_ASCII)
|
379
366
|
end
|
367
|
+
private_class_method :_encode_uri_component
|
380
368
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
#
|
385
|
-
# See URI.encode_www_form_component, URI.decode_www_form.
|
386
|
-
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
387
|
-
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/ =~ str
|
388
|
-
str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
|
369
|
+
def self._decode_uri_component(regexp, str, enc)
|
370
|
+
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/.match?(str)
|
371
|
+
str.b.gsub(regexp, TBLDECWWWCOMP_).force_encoding(enc)
|
389
372
|
end
|
373
|
+
private_class_method :_decode_uri_component
|
390
374
|
|
391
375
|
# Generates URL-encoded form data from given +enum+.
|
392
376
|
#
|
@@ -403,7 +387,7 @@ module URI
|
|
403
387
|
# This method doesn't handle files. When you send a file, use
|
404
388
|
# multipart/form-data.
|
405
389
|
#
|
406
|
-
# This refers
|
390
|
+
# This refers https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
407
391
|
#
|
408
392
|
# URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
|
409
393
|
# #=> "q=ruby&lang=en"
|
@@ -716,6 +700,7 @@ module URI
|
|
716
700
|
"utf-16"=>"utf-16le",
|
717
701
|
"utf-16le"=>"utf-16le",
|
718
702
|
} # :nodoc:
|
703
|
+
Ractor.make_shareable(WEB_ENCODINGS_) if defined?(Ractor)
|
719
704
|
|
720
705
|
# :nodoc:
|
721
706
|
# return encoding or nil
|
data/lib/uri/file.rb
CHANGED
@@ -33,6 +33,9 @@ module URI
|
|
33
33
|
# If an Array is used, the components must be passed in the
|
34
34
|
# order <code>[host, path]</code>.
|
35
35
|
#
|
36
|
+
# A path from e.g. the File class should be escaped before
|
37
|
+
# being passed.
|
38
|
+
#
|
36
39
|
# Examples:
|
37
40
|
#
|
38
41
|
# require 'uri'
|
@@ -44,6 +47,9 @@ module URI
|
|
44
47
|
# :path => '/ruby/src'})
|
45
48
|
# uri2.to_s # => "file://host.example.com/ruby/src"
|
46
49
|
#
|
50
|
+
# uri3 = URI::File.build({:path => URI::escape('/path/my file.txt')})
|
51
|
+
# uri3.to_s # => "file:///path/my%20file.txt"
|
52
|
+
#
|
47
53
|
def self.build(args)
|
48
54
|
tmp = Util::make_components_hash(self, args)
|
49
55
|
super(tmp)
|
@@ -90,5 +96,5 @@ module URI
|
|
90
96
|
end
|
91
97
|
end
|
92
98
|
|
93
|
-
|
99
|
+
register_scheme 'FILE', File
|
94
100
|
end
|
data/lib/uri/ftp.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See URI for general documentation
|
9
8
|
#
|
@@ -263,5 +262,6 @@ module URI
|
|
263
262
|
return str
|
264
263
|
end
|
265
264
|
end
|
266
|
-
|
265
|
+
|
266
|
+
register_scheme 'FTP', FTP
|
267
267
|
end
|
data/lib/uri/generic.rb
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
6
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
7
|
-
# Revision:: $Id$
|
8
7
|
#
|
9
8
|
# See URI for general documentation
|
10
9
|
#
|
@@ -565,16 +564,26 @@ module URI
|
|
565
564
|
end
|
566
565
|
end
|
567
566
|
|
568
|
-
# Returns the user component.
|
567
|
+
# Returns the user component (without URI decoding).
|
569
568
|
def user
|
570
569
|
@user
|
571
570
|
end
|
572
571
|
|
573
|
-
# Returns the password component.
|
572
|
+
# Returns the password component (without URI decoding).
|
574
573
|
def password
|
575
574
|
@password
|
576
575
|
end
|
577
576
|
|
577
|
+
# Returns the user component after URI decoding.
|
578
|
+
def decoded_user
|
579
|
+
URI.decode_uri_component(@user) if @user
|
580
|
+
end
|
581
|
+
|
582
|
+
# Returns the password component after URI decoding.
|
583
|
+
def decoded_password
|
584
|
+
URI.decode_uri_component(@password) if @password
|
585
|
+
end
|
586
|
+
|
578
587
|
#
|
579
588
|
# Checks the host +v+ component for RFC2396 compliance
|
580
589
|
# and against the URI::Parser Regexp for :HOST.
|
@@ -644,7 +653,7 @@ module URI
|
|
644
653
|
#
|
645
654
|
def hostname
|
646
655
|
v = self.host
|
647
|
-
|
656
|
+
v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v
|
648
657
|
end
|
649
658
|
|
650
659
|
# Sets the host part of the URI as the argument with brackets for IPv6 addresses.
|
@@ -660,7 +669,7 @@ module URI
|
|
660
669
|
# it is wrapped with brackets.
|
661
670
|
#
|
662
671
|
def hostname=(v)
|
663
|
-
v = "[#{v}]" if
|
672
|
+
v = "[#{v}]" if !(v&.start_with?('[') && v&.end_with?(']')) && v&.index(':')
|
664
673
|
self.host = v
|
665
674
|
end
|
666
675
|
|
@@ -1098,7 +1107,7 @@ module URI
|
|
1098
1107
|
# # => "http://my.example.com/main.rbx?page=1"
|
1099
1108
|
#
|
1100
1109
|
def merge(oth)
|
1101
|
-
rel = parser.
|
1110
|
+
rel = parser.__send__(:convert_to_uri, oth)
|
1102
1111
|
|
1103
1112
|
if rel.absolute?
|
1104
1113
|
#raise BadURIError, "both URI are absolute" if absolute?
|
@@ -1183,7 +1192,7 @@ module URI
|
|
1183
1192
|
|
1184
1193
|
# :stopdoc:
|
1185
1194
|
def route_from0(oth)
|
1186
|
-
oth = parser.
|
1195
|
+
oth = parser.__send__(:convert_to_uri, oth)
|
1187
1196
|
if self.relative?
|
1188
1197
|
raise BadURIError,
|
1189
1198
|
"relative URI: #{self}"
|
@@ -1291,7 +1300,7 @@ module URI
|
|
1291
1300
|
# #=> #<URI::Generic /main.rbx?page=1>
|
1292
1301
|
#
|
1293
1302
|
def route_to(oth)
|
1294
|
-
parser.
|
1303
|
+
parser.__send__(:convert_to_uri, oth).route_from(self)
|
1295
1304
|
end
|
1296
1305
|
|
1297
1306
|
#
|
@@ -1405,7 +1414,7 @@ module URI
|
|
1405
1414
|
# Returns an Array of the components defined from the COMPONENT Array.
|
1406
1415
|
def component_ary
|
1407
1416
|
component.collect do |x|
|
1408
|
-
self.
|
1417
|
+
self.__send__(x)
|
1409
1418
|
end
|
1410
1419
|
end
|
1411
1420
|
protected :component_ary
|
@@ -1430,7 +1439,7 @@ module URI
|
|
1430
1439
|
def select(*components)
|
1431
1440
|
components.collect do |c|
|
1432
1441
|
if component.include?(c)
|
1433
|
-
self.
|
1442
|
+
self.__send__(c)
|
1434
1443
|
else
|
1435
1444
|
raise ArgumentError,
|
1436
1445
|
"expected of components of #{self.class} (#{self.class.component.join(', ')})"
|
@@ -1515,9 +1524,19 @@ module URI
|
|
1515
1524
|
proxy_uri = env["CGI_#{name.upcase}"]
|
1516
1525
|
end
|
1517
1526
|
elsif name == 'http_proxy'
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1527
|
+
if RUBY_ENGINE == 'jruby' && p_addr = ENV_JAVA['http.proxyHost']
|
1528
|
+
p_port = ENV_JAVA['http.proxyPort']
|
1529
|
+
if p_user = ENV_JAVA['http.proxyUser']
|
1530
|
+
p_pass = ENV_JAVA['http.proxyPass']
|
1531
|
+
proxy_uri = "http://#{p_user}:#{p_pass}@#{p_addr}:#{p_port}"
|
1532
|
+
else
|
1533
|
+
proxy_uri = "http://#{p_addr}:#{p_port}"
|
1534
|
+
end
|
1535
|
+
else
|
1536
|
+
unless proxy_uri = env[name]
|
1537
|
+
if proxy_uri = env[name.upcase]
|
1538
|
+
warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.', uplevel: 1
|
1539
|
+
end
|
1521
1540
|
end
|
1522
1541
|
end
|
1523
1542
|
else
|
data/lib/uri/http.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See URI for general documentation
|
9
8
|
#
|
@@ -81,8 +80,46 @@ module URI
|
|
81
80
|
url = @query ? "#@path?#@query" : @path.dup
|
82
81
|
url.start_with?(?/.freeze) ? url : ?/ + url
|
83
82
|
end
|
84
|
-
end
|
85
83
|
|
86
|
-
|
84
|
+
#
|
85
|
+
# == Description
|
86
|
+
#
|
87
|
+
# Returns the authority for an HTTP uri, as defined in
|
88
|
+
# https://datatracker.ietf.org/doc/html/rfc3986/#section-3.2.
|
89
|
+
#
|
90
|
+
#
|
91
|
+
# Example:
|
92
|
+
#
|
93
|
+
# URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
|
94
|
+
# URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
|
95
|
+
# URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
|
96
|
+
#
|
97
|
+
def authority
|
98
|
+
if port == default_port
|
99
|
+
host
|
100
|
+
else
|
101
|
+
"#{host}:#{port}"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
#
|
106
|
+
# == Description
|
107
|
+
#
|
108
|
+
# Returns the origin for an HTTP uri, as defined in
|
109
|
+
# https://datatracker.ietf.org/doc/html/rfc6454.
|
110
|
+
#
|
111
|
+
#
|
112
|
+
# Example:
|
113
|
+
#
|
114
|
+
# URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
|
115
|
+
# URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
|
116
|
+
# URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
|
117
|
+
# URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
|
118
|
+
#
|
119
|
+
def origin
|
120
|
+
"#{scheme}://#{authority}"
|
121
|
+
end
|
122
|
+
end
|
87
123
|
|
124
|
+
register_scheme 'HTTP', HTTP
|
88
125
|
end
|
data/lib/uri/https.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See URI for general documentation
|
9
8
|
#
|
@@ -19,5 +18,6 @@ module URI
|
|
19
18
|
# A Default port of 443 for URI::HTTPS
|
20
19
|
DEFAULT_PORT = 443
|
21
20
|
end
|
22
|
-
|
21
|
+
|
22
|
+
register_scheme 'HTTPS', HTTPS
|
23
23
|
end
|
data/lib/uri/ldap.rb
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
# License::
|
8
8
|
# URI::LDAP is copyrighted free software by Takaaki Tateishi and Akira Yamada.
|
9
9
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
10
|
-
# Revision:: $Id$
|
11
10
|
#
|
12
11
|
# See URI for general documentation
|
13
12
|
#
|
@@ -119,6 +118,7 @@ module URI
|
|
119
118
|
|
120
119
|
# Private method to cleanup +dn+ from using the +path+ component attribute.
|
121
120
|
def parse_dn
|
121
|
+
raise InvalidURIError, 'bad LDAP URL' unless @path
|
122
122
|
@dn = @path[1..-1]
|
123
123
|
end
|
124
124
|
private :parse_dn
|
@@ -257,5 +257,5 @@ module URI
|
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
|
-
|
260
|
+
register_scheme 'LDAP', LDAP
|
261
261
|
end
|
data/lib/uri/ldaps.rb
CHANGED
data/lib/uri/mailto.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See URI for general documentation
|
9
8
|
#
|
@@ -16,7 +15,7 @@ module URI
|
|
16
15
|
# RFC6068, the mailto URL scheme.
|
17
16
|
#
|
18
17
|
class MailTo < Generic
|
19
|
-
include
|
18
|
+
include RFC2396_REGEXP
|
20
19
|
|
21
20
|
# A Default port of nil for URI::MailTo.
|
22
21
|
DEFAULT_PORT = nil
|
@@ -290,5 +289,5 @@ module URI
|
|
290
289
|
alias to_rfc822text to_mailtext
|
291
290
|
end
|
292
291
|
|
293
|
-
|
292
|
+
register_scheme 'MAILTO', MailTo
|
294
293
|
end
|
data/lib/uri/rfc2396_parser.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -117,7 +116,7 @@ module URI
|
|
117
116
|
# See also URI::Parser.initialize_regexp.
|
118
117
|
attr_reader :regexp
|
119
118
|
|
120
|
-
# Returns a split URI against regexp[:ABS_URI]
|
119
|
+
# Returns a split URI against +regexp[:ABS_URI]+.
|
121
120
|
def split(uri)
|
122
121
|
case uri
|
123
122
|
when ''
|
@@ -208,21 +207,9 @@ module URI
|
|
208
207
|
# #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
|
209
208
|
#
|
210
209
|
def parse(uri)
|
211
|
-
|
212
|
-
registry, path, opaque, query, fragment = self.split(uri)
|
213
|
-
|
214
|
-
if scheme && URI.scheme_list.include?(scheme.upcase)
|
215
|
-
URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
|
216
|
-
registry, path, opaque, query,
|
217
|
-
fragment, self)
|
218
|
-
else
|
219
|
-
Generic.new(scheme, userinfo, host, port,
|
220
|
-
registry, path, opaque, query,
|
221
|
-
fragment, self)
|
222
|
-
end
|
210
|
+
URI.for(*self.split(uri), self)
|
223
211
|
end
|
224
212
|
|
225
|
-
|
226
213
|
#
|
227
214
|
# == Args
|
228
215
|
#
|
@@ -270,8 +257,8 @@ module URI
|
|
270
257
|
end
|
271
258
|
end
|
272
259
|
|
273
|
-
# Returns Regexp that is default self.regexp[:ABS_URI_REF]
|
274
|
-
# unless +schemes+ is provided. Then it is a Regexp.union with self.pattern[:X_ABS_URI]
|
260
|
+
# Returns Regexp that is default +self.regexp[:ABS_URI_REF]+,
|
261
|
+
# unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+.
|
275
262
|
def make_regexp(schemes = nil)
|
276
263
|
unless schemes
|
277
264
|
@regexp[:ABS_URI_REF]
|
@@ -290,7 +277,7 @@ module URI
|
|
290
277
|
# +str+::
|
291
278
|
# String to make safe
|
292
279
|
# +unsafe+::
|
293
|
-
# Regexp to apply. Defaults to self.regexp[:UNSAFE]
|
280
|
+
# Regexp to apply. Defaults to +self.regexp[:UNSAFE]+
|
294
281
|
#
|
295
282
|
# == Description
|
296
283
|
#
|
@@ -322,7 +309,7 @@ module URI
|
|
322
309
|
# +str+::
|
323
310
|
# String to remove escapes from
|
324
311
|
# +escaped+::
|
325
|
-
# Regexp to apply. Defaults to self.regexp[:ESCAPED]
|
312
|
+
# Regexp to apply. Defaults to +self.regexp[:ESCAPED]+
|
326
313
|
#
|
327
314
|
# == Description
|
328
315
|
#
|
@@ -335,8 +322,14 @@ module URI
|
|
335
322
|
end
|
336
323
|
|
337
324
|
@@to_s = Kernel.instance_method(:to_s)
|
338
|
-
|
339
|
-
|
325
|
+
if @@to_s.respond_to?(:bind_call)
|
326
|
+
def inspect
|
327
|
+
@@to_s.bind_call(self)
|
328
|
+
end
|
329
|
+
else
|
330
|
+
def inspect
|
331
|
+
@@to_s.bind(self).call
|
332
|
+
end
|
340
333
|
end
|
341
334
|
|
342
335
|
private
|
data/lib/uri/rfc3986_parser.rb
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
module URI
|
3
3
|
class RFC3986_Parser # :nodoc:
|
4
4
|
# URI defined in RFC3986
|
5
|
-
|
6
|
-
|
7
|
-
RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+)\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
|
5
|
+
RFC3986_URI = /\A(?<URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*))(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
|
6
|
+
RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
|
8
7
|
attr_reader :regexp
|
9
8
|
|
10
9
|
def initialize
|
@@ -69,18 +68,7 @@ module URI
|
|
69
68
|
end
|
70
69
|
|
71
70
|
def parse(uri) # :nodoc:
|
72
|
-
|
73
|
-
registry, path, opaque, query, fragment = self.split(uri)
|
74
|
-
scheme_list = URI.scheme_list
|
75
|
-
if scheme && scheme_list.include?(uc = scheme.upcase)
|
76
|
-
scheme_list[uc].new(scheme, userinfo, host, port,
|
77
|
-
registry, path, opaque, query,
|
78
|
-
fragment, self)
|
79
|
-
else
|
80
|
-
Generic.new(scheme, userinfo, host, port,
|
81
|
-
registry, path, opaque, query,
|
82
|
-
fragment, self)
|
83
|
-
end
|
71
|
+
URI.for(*self.split(uri), self)
|
84
72
|
end
|
85
73
|
|
86
74
|
|
@@ -90,8 +78,14 @@ module URI
|
|
90
78
|
end
|
91
79
|
|
92
80
|
@@to_s = Kernel.instance_method(:to_s)
|
93
|
-
|
94
|
-
|
81
|
+
if @@to_s.respond_to?(:bind_call)
|
82
|
+
def inspect
|
83
|
+
@@to_s.bind_call(self)
|
84
|
+
end
|
85
|
+
else
|
86
|
+
def inspect
|
87
|
+
@@to_s.bind(self).call
|
88
|
+
end
|
95
89
|
end
|
96
90
|
|
97
91
|
private
|
data/lib/uri/version.rb
CHANGED
data/lib/uri/ws.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
# = uri/ws.rb
|
3
|
+
#
|
4
|
+
# Author:: Matt Muller <mamuller@amazon.com>
|
5
|
+
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
+
#
|
7
|
+
# See URI for general documentation
|
8
|
+
#
|
9
|
+
|
10
|
+
require_relative 'generic'
|
11
|
+
|
12
|
+
module URI
|
13
|
+
|
14
|
+
#
|
15
|
+
# The syntax of WS URIs is defined in RFC6455 section 3.
|
16
|
+
#
|
17
|
+
# Note that the Ruby URI library allows WS URLs containing usernames and
|
18
|
+
# passwords. This is not legal as per the RFC, but used to be
|
19
|
+
# supported in Internet Explorer 5 and 6, before the MS04-004 security
|
20
|
+
# update. See <URL:http://support.microsoft.com/kb/834489>.
|
21
|
+
#
|
22
|
+
class WS < Generic
|
23
|
+
# A Default port of 80 for URI::WS.
|
24
|
+
DEFAULT_PORT = 80
|
25
|
+
|
26
|
+
# An Array of the available components for URI::WS.
|
27
|
+
COMPONENT = %i[
|
28
|
+
scheme
|
29
|
+
userinfo host port
|
30
|
+
path
|
31
|
+
query
|
32
|
+
].freeze
|
33
|
+
|
34
|
+
#
|
35
|
+
# == Description
|
36
|
+
#
|
37
|
+
# Creates a new URI::WS object from components, with syntax checking.
|
38
|
+
#
|
39
|
+
# The components accepted are userinfo, host, port, path, and query.
|
40
|
+
#
|
41
|
+
# The components should be provided either as an Array, or as a Hash
|
42
|
+
# with keys formed by preceding the component names with a colon.
|
43
|
+
#
|
44
|
+
# If an Array is used, the components must be passed in the
|
45
|
+
# order <code>[userinfo, host, port, path, query]</code>.
|
46
|
+
#
|
47
|
+
# Example:
|
48
|
+
#
|
49
|
+
# uri = URI::WS.build(host: 'www.example.com', path: '/foo/bar')
|
50
|
+
#
|
51
|
+
# uri = URI::WS.build([nil, "www.example.com", nil, "/path", "query"])
|
52
|
+
#
|
53
|
+
# Currently, if passed userinfo components this method generates
|
54
|
+
# invalid WS URIs as per RFC 1738.
|
55
|
+
#
|
56
|
+
def self.build(args)
|
57
|
+
tmp = Util.make_components_hash(self, args)
|
58
|
+
super(tmp)
|
59
|
+
end
|
60
|
+
|
61
|
+
#
|
62
|
+
# == Description
|
63
|
+
#
|
64
|
+
# Returns the full path for a WS URI, as required by Net::HTTP::Get.
|
65
|
+
#
|
66
|
+
# If the URI contains a query, the full path is URI#path + '?' + URI#query.
|
67
|
+
# Otherwise, the path is simply URI#path.
|
68
|
+
#
|
69
|
+
# Example:
|
70
|
+
#
|
71
|
+
# uri = URI::WS.build(path: '/foo/bar', query: 'test=true')
|
72
|
+
# uri.request_uri # => "/foo/bar?test=true"
|
73
|
+
#
|
74
|
+
def request_uri
|
75
|
+
return unless @path
|
76
|
+
|
77
|
+
url = @query ? "#@path?#@query" : @path.dup
|
78
|
+
url.start_with?(?/.freeze) ? url : ?/ + url
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
register_scheme 'WS', WS
|
83
|
+
end
|
data/lib/uri/wss.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
# = uri/wss.rb
|
3
|
+
#
|
4
|
+
# Author:: Matt Muller <mamuller@amazon.com>
|
5
|
+
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
+
#
|
7
|
+
# See URI for general documentation
|
8
|
+
#
|
9
|
+
|
10
|
+
require_relative 'ws'
|
11
|
+
|
12
|
+
module URI
|
13
|
+
|
14
|
+
# The default port for WSS URIs is 443, and the scheme is 'wss:' rather
|
15
|
+
# than 'ws:'. Other than that, WSS URIs are identical to WS URIs;
|
16
|
+
# see URI::WS.
|
17
|
+
class WSS < WS
|
18
|
+
# A Default port of 443 for URI::WSS
|
19
|
+
DEFAULT_PORT = 443
|
20
|
+
end
|
21
|
+
|
22
|
+
register_scheme 'WSS', WSS
|
23
|
+
end
|
data/lib/uri.rb
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
# class RSYNC < Generic
|
31
31
|
# DEFAULT_PORT = 873
|
32
32
|
# end
|
33
|
-
#
|
33
|
+
# register_scheme 'RSYNC', RSYNC
|
34
34
|
# end
|
35
35
|
# #=> URI::RSYNC
|
36
36
|
#
|
@@ -70,7 +70,6 @@
|
|
70
70
|
# - URI::REGEXP - (in uri/common.rb)
|
71
71
|
# - URI::REGEXP::PATTERN - (in uri/common.rb)
|
72
72
|
# - URI::Util - (in uri/common.rb)
|
73
|
-
# - URI::Escape - (in uri/common.rb)
|
74
73
|
# - URI::Error - (in uri/common.rb)
|
75
74
|
# - URI::InvalidURIError - (in uri/common.rb)
|
76
75
|
# - URI::InvalidComponentError - (in uri/common.rb)
|
@@ -86,7 +85,6 @@
|
|
86
85
|
# License::
|
87
86
|
# Copyright (c) 2001 akira yamada <akira@ruby-lang.org>
|
88
87
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
89
|
-
# Revision:: $Id$
|
90
88
|
#
|
91
89
|
|
92
90
|
module URI
|
@@ -102,3 +100,5 @@ require_relative 'uri/https'
|
|
102
100
|
require_relative 'uri/ldap'
|
103
101
|
require_relative 'uri/ldaps'
|
104
102
|
require_relative 'uri/mailto'
|
103
|
+
require_relative 'uri/ws'
|
104
|
+
require_relative 'uri/wss'
|
data/uri.gemspec
CHANGED
@@ -13,7 +13,9 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.summary = %q{URI is a module providing classes to handle Uniform Resource Identifiers}
|
14
14
|
spec.description = spec.summary
|
15
15
|
spec.homepage = "https://github.com/ruby/uri"
|
16
|
-
spec.
|
16
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
17
|
+
|
18
|
+
spec.required_ruby_version = '>= 2.4'
|
17
19
|
|
18
20
|
spec.metadata["homepage_uri"] = spec.homepage
|
19
21
|
spec.metadata["source_code_uri"] = spec.homepage
|
@@ -21,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
21
23
|
# Specify which files should be added to the gem when it is released.
|
22
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
25
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
24
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
27
|
end
|
26
28
|
spec.bindir = "exe"
|
27
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Yamada
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: URI is a module providing classes to handle Uniform Resource Identifiers
|
14
14
|
email:
|
@@ -17,8 +17,9 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".github/dependabot.yml"
|
21
|
+
- ".github/workflows/test.yml"
|
20
22
|
- ".gitignore"
|
21
|
-
- ".travis.yml"
|
22
23
|
- Gemfile
|
23
24
|
- LICENSE.txt
|
24
25
|
- README.md
|
@@ -38,14 +39,17 @@ files:
|
|
38
39
|
- lib/uri/rfc2396_parser.rb
|
39
40
|
- lib/uri/rfc3986_parser.rb
|
40
41
|
- lib/uri/version.rb
|
42
|
+
- lib/uri/ws.rb
|
43
|
+
- lib/uri/wss.rb
|
41
44
|
- uri.gemspec
|
42
45
|
homepage: https://github.com/ruby/uri
|
43
46
|
licenses:
|
47
|
+
- Ruby
|
44
48
|
- BSD-2-Clause
|
45
49
|
metadata:
|
46
50
|
homepage_uri: https://github.com/ruby/uri
|
47
51
|
source_code_uri: https://github.com/ruby/uri
|
48
|
-
post_install_message:
|
52
|
+
post_install_message:
|
49
53
|
rdoc_options: []
|
50
54
|
require_paths:
|
51
55
|
- lib
|
@@ -53,15 +57,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
57
|
requirements:
|
54
58
|
- - ">="
|
55
59
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
60
|
+
version: '2.4'
|
57
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
62
|
requirements:
|
59
63
|
- - ">="
|
60
64
|
- !ruby/object:Gem::Version
|
61
65
|
version: '0'
|
62
66
|
requirements: []
|
63
|
-
rubygems_version: 3.
|
64
|
-
signing_key:
|
67
|
+
rubygems_version: 3.4.0.dev
|
68
|
+
signing_key:
|
65
69
|
specification_version: 4
|
66
70
|
summary: URI is a module providing classes to handle Uniform Resource Identifiers
|
67
71
|
test_files: []
|