addressable 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile +4 -2
- data/lib/addressable/idna/native.rb +0 -1
- data/lib/addressable/idna/pure.rb +0 -1
- data/lib/addressable/idna.rb +0 -1
- data/lib/addressable/template.rb +3 -4
- data/lib/addressable/uri.rb +57 -53
- data/lib/addressable/version.rb +1 -2
- data/spec/addressable/idna_spec.rb +0 -1
- data/spec/addressable/net_http_compat_spec.rb +0 -1
- data/spec/addressable/security_spec.rb +0 -1
- data/spec/addressable/template_spec.rb +9 -1
- data/spec/addressable/uri_spec.rb +81 -1
- data/tasks/gem.rake +5 -2
- metadata +11 -11
- data/addressable.gemspec +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ddda72232f6aef9f6f4311c2855f1b3fea9acc80f51c4e5e90bd23820b0d74e
|
4
|
+
data.tar.gz: 88f208cb2d73dec64663e6e3c1710dc08b188402937038fefce6a2d47debc97d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e1b0c83fc2f2e54cba6804f3840c8bb29f0d73259979d5bf678ebd5d32257b91585d9b71a780321427835d10f98b9c07969267878f0b032c53d031c30202a4c
|
7
|
+
data.tar.gz: 35abc3652c8ff92032411e4daad7133b7c4649aff4a1a25fe622cf1c9b661d56f096a1084392e053788baea79f551a9d4a448d16c9e61e23bf4d9692a6728bf3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# Addressable 2.8.1
|
2
|
+
- refactor `Addressable::URI.normalize_path` to address linter offenses ([#430](https://github.com/sporkmonger/addressable/pull/430))
|
3
|
+
- remove redundant colon in `Addressable::URI::CharacterClasses::AUTHORITY` regex ([#438](https://github.com/sporkmonger/addressable/pull/438))
|
4
|
+
- update gemspec to reflect supported Ruby versions ([#466], [#464], [#463])
|
5
|
+
- compatibility w/ public_suffix 5.x ([#466], [#465], [#460])
|
6
|
+
- fixes "invalid byte sequence in UTF-8" exception when unencoding URLs containing non UTF-8 characters ([#459](https://github.com/sporkmonger/addressable/pull/459))
|
7
|
+
- `Ractor` compatibility ([#449](https://github.com/sporkmonger/addressable/pull/449))
|
8
|
+
- use the whole string instead of a single line for template match ([#431](https://github.com/sporkmonger/addressable/pull/431))
|
9
|
+
- force UTF-8 encoding only if needed ([#341](https://github.com/sporkmonger/addressable/pull/341))
|
10
|
+
|
11
|
+
[#460]: https://github.com/sporkmonger/addressable/pull/460
|
12
|
+
[#463]: https://github.com/sporkmonger/addressable/pull/463
|
13
|
+
[#464]: https://github.com/sporkmonger/addressable/pull/464
|
14
|
+
[#465]: https://github.com/sporkmonger/addressable/pull/465
|
15
|
+
[#466]: https://github.com/sporkmonger/addressable/pull/466
|
16
|
+
|
1
17
|
# Addressable 2.8.0
|
2
18
|
- fixes ReDoS vulnerability in Addressable::Template#match
|
3
19
|
- no longer replaces `+` with spaces in queries for non-http(s) schemes
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
|
-
gemspec
|
5
|
+
gemspec
|
6
6
|
|
7
7
|
group :test do
|
8
8
|
gem 'rspec', '~> 3.8'
|
@@ -25,4 +25,6 @@ group :test, :development do
|
|
25
25
|
gem "rake", ">= 12.3.3"
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
unless ENV["IDNA_MODE"] == "pure"
|
29
|
+
gem "idn-ruby", platform: :mri
|
30
|
+
end
|
data/lib/addressable/idna.rb
CHANGED
data/lib/addressable/template.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# encoding:utf-8
|
4
3
|
#--
|
5
4
|
# Copyright (C) Bob Aman
|
6
5
|
#
|
@@ -657,12 +656,12 @@ module Addressable
|
|
657
656
|
def ordered_variable_defaults
|
658
657
|
@ordered_variable_defaults ||= begin
|
659
658
|
expansions, _ = parse_template_pattern(pattern)
|
660
|
-
expansions.
|
659
|
+
expansions.flat_map do |capture|
|
661
660
|
_, _, varlist = *capture.match(EXPRESSION)
|
662
661
|
varlist.split(',').map do |varspec|
|
663
662
|
varspec[VARSPEC, 1]
|
664
663
|
end
|
665
|
-
end
|
664
|
+
end
|
666
665
|
end
|
667
666
|
end
|
668
667
|
|
@@ -1023,7 +1022,7 @@ module Addressable
|
|
1023
1022
|
end
|
1024
1023
|
|
1025
1024
|
# Ensure that the regular expression matches the whole URI.
|
1026
|
-
regexp_string = "
|
1025
|
+
regexp_string = "\\A#{regexp_string}\\z"
|
1027
1026
|
return expansions, Regexp.new(regexp_string)
|
1028
1027
|
end
|
1029
1028
|
|
data/lib/addressable/uri.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# encoding:utf-8
|
4
3
|
#--
|
5
4
|
# Copyright (C) Bob Aman
|
6
5
|
#
|
@@ -38,20 +37,26 @@ module Addressable
|
|
38
37
|
##
|
39
38
|
# Container for the character classes specified in
|
40
39
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
|
40
|
+
#
|
41
|
+
# Note: Concatenated and interpolated `String`s are not affected by the
|
42
|
+
# `frozen_string_literal` directive and must be frozen explicitly.
|
43
|
+
#
|
44
|
+
# Interpolated `String`s *were* frozen this way before Ruby 3.0:
|
45
|
+
# https://bugs.ruby-lang.org/issues/17104
|
41
46
|
module CharacterClasses
|
42
47
|
ALPHA = "a-zA-Z"
|
43
48
|
DIGIT = "0-9"
|
44
49
|
GEN_DELIMS = "\\:\\/\\?\\#\\[\\]\\@"
|
45
50
|
SUB_DELIMS = "\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\="
|
46
|
-
RESERVED = GEN_DELIMS + SUB_DELIMS
|
47
|
-
UNRESERVED = ALPHA + DIGIT + "\\-\\.\\_\\~"
|
48
|
-
PCHAR = UNRESERVED + SUB_DELIMS + "\\:\\@"
|
49
|
-
SCHEME = ALPHA + DIGIT + "\\-\\+\\."
|
50
|
-
HOST = UNRESERVED + SUB_DELIMS + "\\[\\:\\]"
|
51
|
-
AUTHORITY = PCHAR + "\\[\\:\\]"
|
52
|
-
PATH = PCHAR + "\\/"
|
53
|
-
QUERY = PCHAR + "\\/\\?"
|
54
|
-
FRAGMENT = PCHAR + "\\/\\?"
|
51
|
+
RESERVED = (GEN_DELIMS + SUB_DELIMS).freeze
|
52
|
+
UNRESERVED = (ALPHA + DIGIT + "\\-\\.\\_\\~").freeze
|
53
|
+
PCHAR = (UNRESERVED + SUB_DELIMS + "\\:\\@").freeze
|
54
|
+
SCHEME = (ALPHA + DIGIT + "\\-\\+\\.").freeze
|
55
|
+
HOST = (UNRESERVED + SUB_DELIMS + "\\[\\:\\]").freeze
|
56
|
+
AUTHORITY = (PCHAR + "\\[\\:\\]").freeze
|
57
|
+
PATH = (PCHAR + "\\/").freeze
|
58
|
+
QUERY = (PCHAR + "\\/\\?").freeze
|
59
|
+
FRAGMENT = (PCHAR + "\\/\\?").freeze
|
55
60
|
end
|
56
61
|
|
57
62
|
module NormalizeCharacterClasses
|
@@ -469,19 +474,13 @@ module Addressable
|
|
469
474
|
"Expected Class (String or Addressable::URI), " +
|
470
475
|
"got #{return_type.inspect}"
|
471
476
|
end
|
472
|
-
uri = uri.dup
|
473
|
-
# Seriously, only use UTF-8. I'm really not kidding!
|
474
|
-
uri.force_encoding("utf-8")
|
475
|
-
|
476
|
-
unless leave_encoded.empty?
|
477
|
-
leave_encoded = leave_encoded.dup.force_encoding("utf-8")
|
478
|
-
end
|
479
477
|
|
480
|
-
result = uri.gsub(/%[0-9a-f]{2}/
|
478
|
+
result = uri.gsub(/%[0-9a-f]{2}/i) do |sequence|
|
481
479
|
c = sequence[1..3].to_i(16).chr
|
482
|
-
c.force_encoding(
|
480
|
+
c.force_encoding(sequence.encoding)
|
483
481
|
leave_encoded.include?(c) ? sequence : c
|
484
482
|
end
|
483
|
+
|
485
484
|
result.force_encoding("utf-8")
|
486
485
|
if return_type == String
|
487
486
|
return result
|
@@ -561,10 +560,10 @@ module Addressable
|
|
561
560
|
leave_re = if leave_encoded.length > 0
|
562
561
|
character_class = "#{character_class}%" unless character_class.include?('%')
|
563
562
|
|
564
|
-
"|%(?!#{leave_encoded.chars.
|
563
|
+
"|%(?!#{leave_encoded.chars.flat_map do |char|
|
565
564
|
seq = SEQUENCE_ENCODING_TABLE[char]
|
566
565
|
[seq.upcase, seq.downcase]
|
567
|
-
end.
|
566
|
+
end.join('|')})"
|
568
567
|
end
|
569
568
|
|
570
569
|
character_class = if leave_re
|
@@ -900,7 +899,7 @@ module Addressable
|
|
900
899
|
end
|
901
900
|
end
|
902
901
|
# All normalized values should be UTF-8
|
903
|
-
@normalized_scheme
|
902
|
+
force_utf8_encoding_if_needed(@normalized_scheme)
|
904
903
|
@normalized_scheme
|
905
904
|
end
|
906
905
|
|
@@ -955,7 +954,7 @@ module Addressable
|
|
955
954
|
end
|
956
955
|
end
|
957
956
|
# All normalized values should be UTF-8
|
958
|
-
@normalized_user
|
957
|
+
force_utf8_encoding_if_needed(@normalized_user)
|
959
958
|
@normalized_user
|
960
959
|
end
|
961
960
|
|
@@ -1012,9 +1011,7 @@ module Addressable
|
|
1012
1011
|
end
|
1013
1012
|
end
|
1014
1013
|
# All normalized values should be UTF-8
|
1015
|
-
|
1016
|
-
@normalized_password.force_encoding(Encoding::UTF_8)
|
1017
|
-
end
|
1014
|
+
force_utf8_encoding_if_needed(@normalized_password)
|
1018
1015
|
@normalized_password
|
1019
1016
|
end
|
1020
1017
|
|
@@ -1082,9 +1079,7 @@ module Addressable
|
|
1082
1079
|
end
|
1083
1080
|
end
|
1084
1081
|
# All normalized values should be UTF-8
|
1085
|
-
|
1086
|
-
@normalized_userinfo.force_encoding(Encoding::UTF_8)
|
1087
|
-
end
|
1082
|
+
force_utf8_encoding_if_needed(@normalized_userinfo)
|
1088
1083
|
@normalized_userinfo
|
1089
1084
|
end
|
1090
1085
|
|
@@ -1151,9 +1146,7 @@ module Addressable
|
|
1151
1146
|
end
|
1152
1147
|
end
|
1153
1148
|
# All normalized values should be UTF-8
|
1154
|
-
|
1155
|
-
@normalized_host.force_encoding(Encoding::UTF_8)
|
1156
|
-
end
|
1149
|
+
force_utf8_encoding_if_needed(@normalized_host)
|
1157
1150
|
@normalized_host
|
1158
1151
|
end
|
1159
1152
|
|
@@ -1271,9 +1264,7 @@ module Addressable
|
|
1271
1264
|
authority
|
1272
1265
|
end
|
1273
1266
|
# All normalized values should be UTF-8
|
1274
|
-
|
1275
|
-
@normalized_authority.force_encoding(Encoding::UTF_8)
|
1276
|
-
end
|
1267
|
+
force_utf8_encoding_if_needed(@normalized_authority)
|
1277
1268
|
@normalized_authority
|
1278
1269
|
end
|
1279
1270
|
|
@@ -1507,7 +1498,7 @@ module Addressable
|
|
1507
1498
|
site_string
|
1508
1499
|
end
|
1509
1500
|
# All normalized values should be UTF-8
|
1510
|
-
@normalized_site
|
1501
|
+
force_utf8_encoding_if_needed(@normalized_site)
|
1511
1502
|
@normalized_site
|
1512
1503
|
end
|
1513
1504
|
|
@@ -1570,7 +1561,7 @@ module Addressable
|
|
1570
1561
|
result
|
1571
1562
|
end
|
1572
1563
|
# All normalized values should be UTF-8
|
1573
|
-
@normalized_path
|
1564
|
+
force_utf8_encoding_if_needed(@normalized_path)
|
1574
1565
|
@normalized_path
|
1575
1566
|
end
|
1576
1567
|
|
@@ -1646,7 +1637,7 @@ module Addressable
|
|
1646
1637
|
component == "" ? nil : component
|
1647
1638
|
end
|
1648
1639
|
# All normalized values should be UTF-8
|
1649
|
-
@normalized_query
|
1640
|
+
force_utf8_encoding_if_needed(@normalized_query)
|
1650
1641
|
@normalized_query
|
1651
1642
|
end
|
1652
1643
|
|
@@ -1842,9 +1833,7 @@ module Addressable
|
|
1842
1833
|
component == "" ? nil : component
|
1843
1834
|
end
|
1844
1835
|
# All normalized values should be UTF-8
|
1845
|
-
|
1846
|
-
@normalized_fragment.force_encoding(Encoding::UTF_8)
|
1847
|
-
end
|
1836
|
+
force_utf8_encoding_if_needed(@normalized_fragment)
|
1848
1837
|
@normalized_fragment
|
1849
1838
|
end
|
1850
1839
|
|
@@ -2440,30 +2429,35 @@ module Addressable
|
|
2440
2429
|
def self.normalize_path(path)
|
2441
2430
|
# Section 5.2.4 of RFC 3986
|
2442
2431
|
|
2443
|
-
return
|
2432
|
+
return if path.nil?
|
2444
2433
|
normalized_path = path.dup
|
2445
|
-
|
2446
|
-
mod = nil
|
2434
|
+
loop do
|
2447
2435
|
mod ||= normalized_path.gsub!(RULE_2A, SLASH)
|
2448
2436
|
|
2449
2437
|
pair = normalized_path.match(RULE_2B_2C)
|
2450
|
-
|
2438
|
+
if pair
|
2439
|
+
parent = pair[1]
|
2440
|
+
current = pair[2]
|
2441
|
+
else
|
2442
|
+
parent = nil
|
2443
|
+
current = nil
|
2444
|
+
end
|
2445
|
+
|
2446
|
+
regexp = "/#{Regexp.escape(parent.to_s)}/\\.\\./|"
|
2447
|
+
regexp += "(/#{Regexp.escape(current.to_s)}/\\.\\.$)"
|
2448
|
+
|
2451
2449
|
if pair && ((parent != SELF_REF && parent != PARENT) ||
|
2452
2450
|
(current != SELF_REF && current != PARENT))
|
2453
|
-
mod ||= normalized_path.gsub!(
|
2454
|
-
Regexp.new(
|
2455
|
-
"/#{Regexp.escape(parent.to_s)}/\\.\\./|" +
|
2456
|
-
"(/#{Regexp.escape(current.to_s)}/\\.\\.$)"
|
2457
|
-
), SLASH
|
2458
|
-
)
|
2451
|
+
mod ||= normalized_path.gsub!(Regexp.new(regexp), SLASH)
|
2459
2452
|
end
|
2460
2453
|
|
2461
2454
|
mod ||= normalized_path.gsub!(RULE_2D, EMPTY_STR)
|
2462
2455
|
# Non-standard, removes prefixed dotted segments from path.
|
2463
2456
|
mod ||= normalized_path.gsub!(RULE_PREFIXED_PARENT, SLASH)
|
2464
|
-
|
2457
|
+
break if mod.nil?
|
2458
|
+
end
|
2465
2459
|
|
2466
|
-
|
2460
|
+
normalized_path
|
2467
2461
|
end
|
2468
2462
|
|
2469
2463
|
##
|
@@ -2552,5 +2546,15 @@ module Addressable
|
|
2552
2546
|
remove_instance_variable(:@uri_string) if defined?(@uri_string)
|
2553
2547
|
remove_instance_variable(:@hash) if defined?(@hash)
|
2554
2548
|
end
|
2549
|
+
|
2550
|
+
##
|
2551
|
+
# Converts the string to be UTF-8 if it is not already UTF-8
|
2552
|
+
#
|
2553
|
+
# @api private
|
2554
|
+
def force_utf8_encoding_if_needed(str)
|
2555
|
+
if str && str.encoding != Encoding::UTF_8
|
2556
|
+
str.force_encoding(Encoding::UTF_8)
|
2557
|
+
end
|
2558
|
+
end
|
2555
2559
|
end
|
2556
2560
|
end
|
data/lib/addressable/version.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# encoding:utf-8
|
4
3
|
#--
|
5
4
|
# Copyright (C) Bob Aman
|
6
5
|
#
|
@@ -24,7 +23,7 @@ if !defined?(Addressable::VERSION)
|
|
24
23
|
module VERSION
|
25
24
|
MAJOR = 2
|
26
25
|
MINOR = 8
|
27
|
-
TINY =
|
26
|
+
TINY = 1
|
28
27
|
|
29
28
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
30
29
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# coding: utf-8
|
4
3
|
# Copyright (C) Bob Aman
|
5
4
|
#
|
6
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -78,6 +77,15 @@ describe "==" do
|
|
78
77
|
end
|
79
78
|
end
|
80
79
|
|
80
|
+
describe "#to_regexp" do
|
81
|
+
it "does not match the first line of multiline strings" do
|
82
|
+
uri = "https://www.example.com/bar"
|
83
|
+
template = Addressable::Template.new(uri)
|
84
|
+
expect(template.match(uri)).not_to be_nil
|
85
|
+
expect(template.match("#{uri}\ngarbage")).to be_nil
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
81
89
|
describe "Type conversion" do
|
82
90
|
subject {
|
83
91
|
{
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# coding: utf-8
|
4
3
|
# Copyright (C) Bob Aman
|
5
4
|
#
|
6
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -999,6 +998,72 @@ describe Addressable::URI, "when frozen" do
|
|
999
998
|
end
|
1000
999
|
end
|
1001
1000
|
|
1001
|
+
describe Addressable::URI, "when normalized and then deeply frozen" do
|
1002
|
+
before do
|
1003
|
+
@uri = Addressable::URI.parse(
|
1004
|
+
"http://user:password@example.com:8080/path?query=value#fragment"
|
1005
|
+
).normalize!
|
1006
|
+
|
1007
|
+
@uri.instance_variables.each do |var|
|
1008
|
+
@uri.instance_variable_set(var, @uri.instance_variable_get(var).freeze)
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
@uri.freeze
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
it "#normalized_scheme should not error" do
|
1015
|
+
expect { @uri.normalized_scheme }.not_to raise_error
|
1016
|
+
end
|
1017
|
+
|
1018
|
+
it "#normalized_user should not error" do
|
1019
|
+
expect { @uri.normalized_user }.not_to raise_error
|
1020
|
+
end
|
1021
|
+
|
1022
|
+
it "#normalized_password should not error" do
|
1023
|
+
expect { @uri.normalized_password }.not_to raise_error
|
1024
|
+
end
|
1025
|
+
|
1026
|
+
it "#normalized_userinfo should not error" do
|
1027
|
+
expect { @uri.normalized_userinfo }.not_to raise_error
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
it "#normalized_host should not error" do
|
1031
|
+
expect { @uri.normalized_host }.not_to raise_error
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
it "#normalized_authority should not error" do
|
1035
|
+
expect { @uri.normalized_authority }.not_to raise_error
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
it "#normalized_port should not error" do
|
1039
|
+
expect { @uri.normalized_port }.not_to raise_error
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
it "#normalized_site should not error" do
|
1043
|
+
expect { @uri.normalized_site }.not_to raise_error
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
it "#normalized_path should not error" do
|
1047
|
+
expect { @uri.normalized_path }.not_to raise_error
|
1048
|
+
end
|
1049
|
+
|
1050
|
+
it "#normalized_query should not error" do
|
1051
|
+
expect { @uri.normalized_query }.not_to raise_error
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
it "#normalized_fragment should not error" do
|
1055
|
+
expect { @uri.normalized_fragment }.not_to raise_error
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
it "should be frozen" do
|
1059
|
+
expect(@uri).to be_frozen
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
it "should not allow destructive operations" do
|
1063
|
+
expect { @uri.normalize! }.to raise_error(RuntimeError)
|
1064
|
+
end
|
1065
|
+
end
|
1066
|
+
|
1002
1067
|
describe Addressable::URI, "when created from string components" do
|
1003
1068
|
before do
|
1004
1069
|
@uri = Addressable::URI.new(
|
@@ -5993,6 +6058,11 @@ describe Addressable::URI, "when unencoding a multibyte string" do
|
|
5993
6058
|
expect(Addressable::URI.unencode_component("ski=%BA%DAɫ")).to eq("ski=\xBA\xDAɫ")
|
5994
6059
|
end
|
5995
6060
|
|
6061
|
+
it "should not fail with UTF-8 incompatible string" do
|
6062
|
+
url = "/M%E9/\xE9?p=\xFC".b
|
6063
|
+
expect(Addressable::URI.unencode_component(url)).to eq("/M\xE9/\xE9?p=\xFC")
|
6064
|
+
end
|
6065
|
+
|
5996
6066
|
it "should result in correct percent encoded sequence as a URI" do
|
5997
6067
|
expect(Addressable::URI.unencode(
|
5998
6068
|
"/path?g%C3%BCnther", ::Addressable::URI
|
@@ -6663,3 +6733,13 @@ describe Addressable::URI, "when initializing a subclass of Addressable::URI" do
|
|
6663
6733
|
expect(@uri.class).to eq(@uri.join('path').class)
|
6664
6734
|
end
|
6665
6735
|
end
|
6736
|
+
|
6737
|
+
describe Addressable::URI, "when initialized in a non-main `Ractor`" do
|
6738
|
+
it "should have the same value as if used in the main `Ractor`" do
|
6739
|
+
pending("Ruby 3.0+ for `Ractor` support") unless defined?(Ractor)
|
6740
|
+
main = Addressable::URI.parse("http://example.com")
|
6741
|
+
expect(
|
6742
|
+
Ractor.new { Addressable::URI.parse("http://example.com") }.take
|
6743
|
+
).to eq(main)
|
6744
|
+
end
|
6745
|
+
end
|
data/tasks/gem.rake
CHANGED
@@ -19,9 +19,9 @@ namespace :gem do
|
|
19
19
|
exit(1)
|
20
20
|
end
|
21
21
|
|
22
|
-
s.required_ruby_version = ">= 2.
|
22
|
+
s.required_ruby_version = ">= 2.2"
|
23
23
|
|
24
|
-
s.add_runtime_dependency "public_suffix", ">= 2.0.2", "<
|
24
|
+
s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 6.0"
|
25
25
|
s.add_development_dependency "bundler", ">= 1.0", "< 3.0"
|
26
26
|
|
27
27
|
s.require_path = "lib"
|
@@ -30,6 +30,9 @@ namespace :gem do
|
|
30
30
|
s.email = "bob@sporkmonger.com"
|
31
31
|
s.homepage = "https://github.com/sporkmonger/addressable"
|
32
32
|
s.license = "Apache-2.0"
|
33
|
+
s.metadata = {
|
34
|
+
"changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md"
|
35
|
+
}
|
33
36
|
end
|
34
37
|
|
35
38
|
Gem::PackageTask.new(GEM_SPEC) do |p|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: addressable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Aman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: public_suffix
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 2.0.2
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 2.0.2
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,7 +65,6 @@ files:
|
|
65
65
|
- LICENSE.txt
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
|
-
- addressable.gemspec
|
69
68
|
- data/unicode.data
|
70
69
|
- lib/addressable.rb
|
71
70
|
- lib/addressable/idna.rb
|
@@ -90,8 +89,9 @@ files:
|
|
90
89
|
homepage: https://github.com/sporkmonger/addressable
|
91
90
|
licenses:
|
92
91
|
- Apache-2.0
|
93
|
-
metadata:
|
94
|
-
|
92
|
+
metadata:
|
93
|
+
changelog_uri: https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md
|
94
|
+
post_install_message:
|
95
95
|
rdoc_options:
|
96
96
|
- "--main"
|
97
97
|
- README.md
|
@@ -101,15 +101,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '2.
|
104
|
+
version: '2.2'
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
111
|
+
rubygems_version: 3.3.7
|
112
|
+
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: URI Implementation
|
115
115
|
test_files: []
|
data/addressable.gemspec
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: addressable 2.8.0 ruby lib
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "addressable".freeze
|
6
|
-
s.version = "2.8.0"
|
7
|
-
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
|
-
s.require_paths = ["lib".freeze]
|
10
|
-
s.authors = ["Bob Aman".freeze]
|
11
|
-
s.date = "2021-07-03"
|
12
|
-
s.description = "Addressable is an alternative implementation to the URI implementation that is\npart of Ruby's standard library. It is flexible, offers heuristic parsing, and\nadditionally provides extensive support for IRIs and URI templates.\n".freeze
|
13
|
-
s.email = "bob@sporkmonger.com".freeze
|
14
|
-
s.extra_rdoc_files = ["README.md".freeze]
|
15
|
-
s.files = ["CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "addressable.gemspec".freeze, "data/unicode.data".freeze, "lib/addressable.rb".freeze, "lib/addressable/idna.rb".freeze, "lib/addressable/idna/native.rb".freeze, "lib/addressable/idna/pure.rb".freeze, "lib/addressable/template.rb".freeze, "lib/addressable/uri.rb".freeze, "lib/addressable/version.rb".freeze, "spec/addressable/idna_spec.rb".freeze, "spec/addressable/net_http_compat_spec.rb".freeze, "spec/addressable/security_spec.rb".freeze, "spec/addressable/template_spec.rb".freeze, "spec/addressable/uri_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tasks/clobber.rake".freeze, "tasks/gem.rake".freeze, "tasks/git.rake".freeze, "tasks/metrics.rake".freeze, "tasks/profile.rake".freeze, "tasks/rspec.rake".freeze, "tasks/yard.rake".freeze]
|
16
|
-
s.homepage = "https://github.com/sporkmonger/addressable".freeze
|
17
|
-
s.licenses = ["Apache-2.0".freeze]
|
18
|
-
s.rdoc_options = ["--main".freeze, "README.md".freeze]
|
19
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
|
20
|
-
s.rubygems_version = "3.0.3".freeze
|
21
|
-
s.summary = "URI Implementation".freeze
|
22
|
-
|
23
|
-
if s.respond_to? :specification_version then
|
24
|
-
s.specification_version = 4
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
|
28
|
-
s.add_development_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
|
29
|
-
else
|
30
|
-
s.add_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
|
31
|
-
s.add_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
|
32
|
-
end
|
33
|
-
else
|
34
|
-
s.add_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
|
35
|
-
s.add_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
|
36
|
-
end
|
37
|
-
end
|