addressable 2.3.2 → 2.8.7

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 62b62e368b9dffbec4c9aaf879257067698b83daff1cc13542352da419f3f88e
4
+ data.tar.gz: 7f3231aecc91ef0c3087ff2325d78e9a1f4c9f05a752f2c35c8f0bb740fd5996
5
+ SHA512:
6
+ metadata.gz: 670e1aeddc5a4f62ad39040007cef7371107237b2e4064755355dfbc43cfc62a956f78358c95793a9f55cd325b7b46ce532003bdd9711b1bc3c79b35e0d3cbf6
7
+ data.tar.gz: d7aed8469d926b0bcdd19202593f8bfa162d9dafb38dabca632ccee8af3fd26920dfbce3f18b674d583f5aaa2e7c51717ccf46fab3a1a4fb4a8dfbd74a80da16
data/CHANGELOG.md CHANGED
@@ -1,56 +1,217 @@
1
- # Addressable 2.3.2
1
+ # Addressable 2.8.7 <a name="v2.8.7">
2
+ - Allow `public_suffix` 6 ([#535])
3
+
4
+ [#535]: https://github.com/sporkmonger/addressable/pull/535
5
+
6
+ # Addressable 2.8.6 <a name="v2.8.6">
7
+ - Memoize regexps for common character classes ([#524])
8
+
9
+ [#524]: https://github.com/sporkmonger/addressable/pull/524
10
+
11
+ # Addressable 2.8.5 <a name="v2.8.5">
12
+ - Fix thread safety issue with encoding tables ([#515])
13
+ - Define URI::NONE as a module to avoid serialization issues ([#509])
14
+ - Fix YAML serialization ([#508])
15
+
16
+ [#508]: https://github.com/sporkmonger/addressable/pull/508
17
+ [#509]: https://github.com/sporkmonger/addressable/pull/509
18
+ [#515]: https://github.com/sporkmonger/addressable/pull/515
19
+
20
+ # Addressable 2.8.4 <a name="v2.8.4">
21
+ - Restore `Addressable::IDNA.unicode_normalize_kc` as a deprecated method ([#504])
22
+
23
+ [#504]: https://github.com/sporkmonger/addressable/pull/504
24
+
25
+ # Addressable 2.8.3 <a name="v2.8.3">
26
+ - Fix template expand level 2 hash support for non-string objects ([#499], [#498])
27
+
28
+ [#499]: https://github.com/sporkmonger/addressable/pull/499
29
+ [#498]: https://github.com/sporkmonger/addressable/pull/498
30
+
31
+ # Addressable 2.8.2 <a name="v2.8.2">
32
+ - Improve cache hits and JIT friendliness ([#486](https://github.com/sporkmonger/addressable/pull/486))
33
+ - Improve code style and test coverage ([#482](https://github.com/sporkmonger/addressable/pull/482))
34
+ - Ensure reset of deferred validation ([#481](https://github.com/sporkmonger/addressable/pull/481))
35
+ - Resolve normalization differences between `IDNA::Native` and `IDNA::Pure` ([#408](https://github.com/sporkmonger/addressable/issues/408), [#492])
36
+ - Remove redundant colon in `Addressable::URI::CharacterClasses::AUTHORITY` regex ([#438](https://github.com/sporkmonger/addressable/pull/438)) (accidentally reverted by [#449] merge but [added back](https://github.com/sporkmonger/addressable/pull/492#discussion_r1105125280) in [#492])
37
+
38
+ [#492]: https://github.com/sporkmonger/addressable/pull/492
39
+
40
+ # Addressable 2.8.1 <a name="v2.8.1">
41
+ - refactor `Addressable::URI.normalize_path` to address linter offenses ([#430](https://github.com/sporkmonger/addressable/pull/430))
42
+ - update gemspec to reflect supported Ruby versions ([#466], [#464], [#463])
43
+ - compatibility w/ public_suffix 5.x ([#466], [#465], [#460])
44
+ - fixes "invalid byte sequence in UTF-8" exception when unencoding URLs containing non UTF-8 characters ([#459](https://github.com/sporkmonger/addressable/pull/459))
45
+ - `Ractor` compatibility ([#449])
46
+ - use the whole string instead of a single line for template match ([#431](https://github.com/sporkmonger/addressable/pull/431))
47
+ - force UTF-8 encoding only if needed ([#341](https://github.com/sporkmonger/addressable/pull/341))
48
+
49
+ [#449]: https://github.com/sporkmonger/addressable/pull/449
50
+ [#460]: https://github.com/sporkmonger/addressable/pull/460
51
+ [#463]: https://github.com/sporkmonger/addressable/pull/463
52
+ [#464]: https://github.com/sporkmonger/addressable/pull/464
53
+ [#465]: https://github.com/sporkmonger/addressable/pull/465
54
+ [#466]: https://github.com/sporkmonger/addressable/pull/466
55
+
56
+ # Addressable 2.8.0 <a name="v2.8.0">
57
+ - fixes ReDoS vulnerability in Addressable::Template#match
58
+ - no longer replaces `+` with spaces in queries for non-http(s) schemes
59
+ - fixed encoding ipv6 literals
60
+ - the `:compacted` flag for `normalized_query` now dedupes parameters
61
+ - fix broken `escape_component` alias
62
+ - dropping support for Ruby 2.0 and 2.1
63
+ - adding Ruby 3.0 compatibility for development tasks
64
+ - drop support for `rack-mount` and remove Addressable::Template#generate
65
+ - performance improvements
66
+ - switch CI/CD to GitHub Actions
67
+
68
+ # Addressable 2.7.0 <a name="v2.7.0">
69
+ - added `:compacted` flag to `normalized_query`
70
+ - `heuristic_parse` handles `mailto:` more intuitively
71
+ - dropped explicit support for JRuby 9.0.5.0
72
+ - compatibility w/ public_suffix 4.x
73
+ - performance improvements
74
+
75
+ # Addressable 2.6.0 <a name="v2.6.0">
76
+ - added `tld=` method to allow assignment to the public suffix
77
+ - most `heuristic_parse` patterns are now case-insensitive
78
+ - `heuristic_parse` handles more `file://` URI variations
79
+ - fixes bug in `heuristic_parse` when uri starts with digit
80
+ - fixes bug in `request_uri=` with query strings
81
+ - fixes template issues with `nil` and `?` operator
82
+ - `frozen_string_literal` pragmas added
83
+ - minor performance improvements in regexps
84
+ - fixes to eliminate warnings
85
+
86
+ # Addressable 2.5.2 <a name="v2.5.2">
87
+ - better support for frozen string literals
88
+ - fixed bug w/ uppercase characters in scheme
89
+ - IDNA errors w/ emoji URLs
90
+ - compatibility w/ public_suffix 3.x
91
+
92
+ # Addressable 2.5.1 <a name="v2.5.1">
93
+ - allow unicode normalization to be disabled for URI Template expansion
94
+ - removed duplicate test
95
+
96
+ # Addressable 2.5.0 <a name="v2.5.0">
97
+ - dropping support for Ruby 1.9
98
+ - adding support for Ruby 2.4 preview
99
+ - add support for public suffixes and tld; first runtime dependency
100
+ - hostname escaping should match RFC; underscores in hostnames no longer escaped
101
+ - paths beginning with // and missing an authority are now considered invalid
102
+ - validation now also takes place after setting a path
103
+ - handle backslashes in authority more like a browser for `heuristic_parse`
104
+ - unescaped backslashes in host now raise an `InvalidURIError`
105
+ - `merge!`, `join!`, `omit!` and `normalize!` don't disable deferred validation
106
+ - `heuristic_parse` now trims whitespace before parsing
107
+ - host parts longer than 63 bytes will be ignored and not passed to libidn
108
+ - normalized values always encoded as UTF-8
109
+
110
+ # Addressable 2.4.0 <a name="v2.4.0">
111
+ - support for 1.8.x dropped
112
+ - double quotes in a host now raises an error
113
+ - newlines in host will no longer get unescaped during normalization
114
+ - stricter handling of bogus scheme values
115
+ - stricter handling of encoded port values
116
+ - calling `require 'addressable'` will now load both the URI and Template files
117
+ - assigning to the `hostname` component with an `IPAddr` object is now supported
118
+ - assigning to the `origin` component is now supported
119
+ - fixed minor bug where an exception would be thrown for a missing ACE suffix
120
+ - better partial expansion of URI templates
121
+
122
+ # Addressable 2.3.8 <a name="v2.3.8">
123
+ - fix warnings
124
+ - update dependency gems
125
+ - support for 1.8.x officially deprecated
126
+
127
+ # Addressable 2.3.7 <a name="v2.3.7">
128
+ - fix scenario in which invalid URIs don't get an exception until inspected
129
+ - handle hostnames with two adjacent periods correctly
130
+ - upgrade of RSpec
131
+
132
+ # Addressable 2.3.6 <a name="v2.3.6">
133
+ - normalization drops empty query string
134
+ - better handling in template extract for missing values
135
+ - template modifier for `'?'` now treated as optional
136
+ - fixed issue where character class parameters were modified
137
+ - templates can now be tested for equality
138
+ - added `:sorted` option to normalization of query strings
139
+ - fixed issue with normalization of hosts given in `'example.com.'` form
140
+
141
+ # Addressable 2.3.5 <a name="v2.3.5">
142
+ - added Addressable::URI#empty? method
143
+ - Addressable::URI#hostname methods now strip square brackets from IPv6 hosts
144
+ - compatibility with Net::HTTP in Ruby 2.0.0
145
+ - Addressable::URI#route_from should always give relative URIs
146
+
147
+ # Addressable 2.3.4 <a name="v2.3.4">
148
+ - fixed issue with encoding altering its inputs
149
+ - query string normalization now leaves ';' characters alone
150
+ - FakeFS is detected before attempting to load unicode tables
151
+ - additional testing to ensure frozen objects don't cause problems
152
+
153
+ # Addressable 2.3.3 <a name="v2.3.3">
154
+ - fixed issue with converting common primitives during template expansion
155
+ - fixed port encoding issue
156
+ - removed a few warnings
157
+ - normalize should now ignore %2B in query strings
158
+ - the IDNA logic should now be handled by libidn in Ruby 1.9
159
+ - no template match should now result in nil instead of an empty MatchData
160
+ - added license information to gemspec
161
+
162
+ # Addressable 2.3.2 <a name="v2.3.2">
2
163
  - added Addressable::URI#default_port method
3
164
  - fixed issue with Marshalling Unicode data on Windows
4
165
  - improved heuristic parsing to better handle IPv4 addresses
5
166
 
6
- # Addressable 2.3.1
167
+ # Addressable 2.3.1 <a name="v2.3.1">
7
168
  - fixed missing unicode data file
8
169
 
9
- # Addressable 2.3.0
170
+ # Addressable 2.3.0 <a name="v2.3.0">
10
171
  - updated Addressable::Template to use RFC 6570, level 4
11
172
  - fixed compatibility problems with some versions of Ruby
12
173
  - moved unicode tables into a data file for performance reasons
13
174
  - removing support for multiple query value notations
14
175
 
15
- # Addressable 2.2.8
176
+ # Addressable 2.2.8 <a name="v2.2.8">
16
177
  - fixed issues with dot segment removal code
17
178
  - form encoding can now handle multiple values per key
18
179
  - updated development environment
19
180
 
20
- # Addressable 2.2.7
181
+ # Addressable 2.2.7 <a name="v2.2.7">
21
182
  - fixed issues related to Addressable::URI#query_values=
22
183
  - the Addressable::URI.parse method is now polymorphic
23
184
 
24
- # Addressable 2.2.6
185
+ # Addressable 2.2.6 <a name="v2.2.6">
25
186
  - changed the way ambiguous paths are handled
26
187
  - fixed bug with frozen URIs
27
188
  - https supported in heuristic parsing
28
189
 
29
- # Addressable 2.2.5
190
+ # Addressable 2.2.5 <a name="v2.2.5">
30
191
  - 'parsing' a pre-parsed URI object is now a dup operation
31
192
  - introduced conditional support for libidn
32
193
  - fixed normalization issue on ampersands in query strings
33
194
  - added additional tests around handling of query strings
34
195
 
35
- # Addressable 2.2.4
196
+ # Addressable 2.2.4 <a name="v2.2.4">
36
197
  - added origin support from draft-ietf-websec-origin-00
37
198
  - resolved issue with attempting to navigate below root
38
199
  - fixed bug with string splitting in query strings
39
200
 
40
- # Addressable 2.2.3
201
+ # Addressable 2.2.3 <a name="v2.2.3">
41
202
  - added :flat_array notation for query strings
42
203
 
43
- # Addressable 2.2.2
204
+ # Addressable 2.2.2 <a name="v2.2.2">
44
205
  - fixed issue with percent escaping of '+' character in query strings
45
206
 
46
- # Addressable 2.2.1
207
+ # Addressable 2.2.1 <a name="v2.2.1">
47
208
  - added support for application/x-www-form-urlencoded.
48
209
 
49
- # Addressable 2.2.0
210
+ # Addressable 2.2.0 <a name="v2.2.0">
50
211
  - added site methods
51
212
  - improved documentation
52
213
 
53
- # Addressable 2.1.2
214
+ # Addressable 2.1.2 <a name="v2.1.2">
54
215
  - added HTTP request URI methods
55
216
  - better handling of Windows file paths
56
217
  - validation_deferred boolean replaced with defer_validation block
@@ -58,14 +219,14 @@
58
219
  - fixed issue with constructing URIs with relative paths
59
220
  - fixed warnings
60
221
 
61
- # Addressable 2.1.1
222
+ # Addressable 2.1.1 <a name="v2.1.1">
62
223
  - more type checking changes
63
224
  - fixed issue with unicode normalization
64
225
  - added method to find template defaults
65
226
  - symbolic keys are now allowed in template mappings
66
227
  - numeric values and symbolic values are now allowed in template mappings
67
228
 
68
- # Addressable 2.1.0
229
+ # Addressable 2.1.0 <a name="v2.1.0">
69
230
  - refactored URI template support out into its own class
70
231
  - removed extract method due to being useless and unreliable
71
232
  - removed Addressable::URI.expand_template
@@ -79,15 +240,15 @@
79
240
  - worked around issue with freezing URIs
80
241
  - improved specs
81
242
 
82
- # Addressable 2.0.2
243
+ # Addressable 2.0.2 <a name="v2.0.2">
83
244
  - fixed issue with URI template expansion
84
245
  - fixed issue with percent escaping characters 0-15
85
246
 
86
- # Addressable 2.0.1
247
+ # Addressable 2.0.1 <a name="v2.0.1">
87
248
  - fixed issue with query string assignment
88
249
  - fixed issue with improperly encoded components
89
250
 
90
- # Addressable 2.0.0
251
+ # Addressable 2.0.0 <a name="v2.0.0">
91
252
  - the initialize method now takes an options hash as its only parameter
92
253
  - added query_values method to URI class
93
254
  - completely replaced IDNA implementation with pure Ruby
@@ -102,20 +263,20 @@
102
263
  - updated URI Template code to match v 03 of the draft spec
103
264
  - added a bunch of new specifications
104
265
 
105
- # Addressable 1.0.4
266
+ # Addressable 1.0.4 <a name="v1.0.4">
106
267
  - switched to using RSpec's pending system for specs that rely on IDN
107
268
  - fixed issue with creating URIs with paths that are not prefixed with '/'
108
269
 
109
- # Addressable 1.0.3
270
+ # Addressable 1.0.3 <a name="v1.0.3">
110
271
  - implemented a hash method
111
272
 
112
- # Addressable 1.0.2
273
+ # Addressable 1.0.2 <a name="v1.0.2">
113
274
  - fixed minor bug with the extract_mapping method
114
275
 
115
- # Addressable 1.0.1
276
+ # Addressable 1.0.1 <a name="v1.0.1">
116
277
  - fixed minor bug with the extract_mapping method
117
278
 
118
- # Addressable 1.0.0
279
+ # Addressable 1.0.0 <a name="v1.0.0">
119
280
  - heuristic parse method added
120
281
  - parsing is slightly more strict
121
282
  - replaced to_h with to_hash
@@ -124,16 +285,16 @@
124
285
  - improved heckle rake task
125
286
  - no surviving heckle mutations
126
287
 
127
- # Addressable 0.1.2
288
+ # Addressable 0.1.2 <a name="v0.1.2">
128
289
  - improved normalization
129
290
  - fixed bug in joining algorithm
130
291
  - updated specifications
131
-
132
- # Addressable 0.1.1
292
+
293
+ # Addressable 0.1.1 <a name="v0.1.1">
133
294
  - updated documentation
134
295
  - added URI Template variable extraction
135
-
136
- # Addressable 0.1.0
296
+
297
+ # Addressable 0.1.0 <a name="v0.1.0">
137
298
  - initial release
138
299
  - implementation based on RFC 3986, 3987
139
300
  - support for IRIs via libidn
data/Gemfile CHANGED
@@ -1,17 +1,31 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
5
+ gemspec
6
+
7
+ group :test do
8
+ gem 'bigdecimal' if RUBY_VERSION > '2.4'
9
+ gem 'rspec', '~> 3.8'
10
+ gem 'rspec-its', '~> 1.3'
11
+ end
12
+
13
+ group :coverage do
14
+ gem "coveralls", "> 0.7", require: false, platforms: :mri
15
+ gem "simplecov", require: false
16
+ end
17
+
3
18
  group :development do
4
- gem 'launchy'
19
+ gem 'launchy', '~> 2.4', '>= 2.4.3'
20
+ gem 'redcarpet', :platform => :mri_19
5
21
  gem 'yard'
6
- gem 'redcarpet'
7
- gem 'rubyforge'
8
22
  end
9
23
 
10
24
  group :test, :development do
11
- gem 'rake', '>= 0.7.3'
12
- gem 'rspec', '>= 2.9.0'
25
+ gem 'memory_profiler'
26
+ gem "rake", ">= 12.3.3"
13
27
  end
14
28
 
15
- gem 'idn', :platform => :mri_18
16
-
17
- gemspec
29
+ unless ENV["IDNA_MODE"] == "pure"
30
+ gem "idn-ruby", platform: :mri
31
+ end
data/README.md CHANGED
@@ -1,87 +1,121 @@
1
1
  # Addressable
2
2
 
3
3
  <dl>
4
- <dt>Homepage</dt><dd><a href="http://addressable.rubyforge.org/">addressable.rubyforge.org</a></dd>
4
+ <dt>Homepage</dt><dd><a href="https://github.com/sporkmonger/addressable">github.com/sporkmonger/addressable</a></dd>
5
5
  <dt>Author</dt><dd><a href="mailto:bob@sporkmonger.com">Bob Aman</a></dd>
6
- <dt>Copyright</dt><dd>Copyright © 2010 Bob Aman</dd>
6
+ <dt>Copyright</dt><dd>Copyright © Bob Aman</dd>
7
7
  <dt>License</dt><dd>Apache 2.0</dd>
8
8
  </dl>
9
9
 
10
- [![Build Status](https://secure.travis-ci.org/sporkmonger/addressable.png)](http://travis-ci.org/sporkmonger/addressable)
11
- [![Dependency Status](https://gemnasium.com/sporkmonger/addressable.png)](https://gemnasium.com/sporkmonger/addressable)
10
+ [![Gem Version](https://img.shields.io/gem/dt/addressable.svg)][gem]
11
+ [![Build Status](https://github.com/sporkmonger/addressable/workflows/CI/badge.svg)][actions]
12
+ [![Test Coverage Status](https://img.shields.io/coveralls/sporkmonger/addressable.svg)][coveralls]
13
+ [![Documentation Coverage Status](https://inch-ci.org/github/sporkmonger/addressable.svg?branch=master)][inch]
14
+
15
+ [gem]: https://rubygems.org/gems/addressable
16
+ [actions]: https://github.com/sporkmonger/addressable/actions
17
+ [coveralls]: https://coveralls.io/r/sporkmonger/addressable
18
+ [inch]: https://inch-ci.org/github/sporkmonger/addressable
12
19
 
13
20
  # Description
14
21
 
15
- Addressable is a replacement for the URI implementation that is part of
16
- Ruby's standard library. It more closely conforms to RFC 3986, RFC 3987, and
17
- RFC 6570 (level 4), providing support for IRIs and URI templates.
22
+ Addressable is an alternative implementation to the URI implementation
23
+ that is part of Ruby's standard library. It is flexible, offers heuristic
24
+ parsing, and additionally provides extensive support for IRIs and URI templates.
25
+
26
+ Addressable closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4).
18
27
 
19
28
  # Reference
20
29
 
21
30
  - {Addressable::URI}
22
31
  - {Addressable::Template}
23
- - {Addressable::UriTemplate}
24
32
 
25
33
  # Example usage
26
34
 
27
- require "addressable/uri"
28
-
29
- uri = Addressable::URI.parse("http://example.com/path/to/resource/")
30
- uri.scheme
31
- #=> "http"
32
- uri.host
33
- #=> "example.com"
34
- uri.path
35
- #=> "/path/to/resource/"
36
-
37
- uri = Addressable::URI.parse("http://www.詹姆斯.com/")
38
- uri.normalize
39
- #=> #<Addressable::URI:0xc9a4c8 URI:http://www.xn--8ws00zhy3a.com/>
40
-
41
- require "addressable/template"
42
-
43
- template = Addressable::Template.new("http://example.com/{-list|+|query}/")
44
- template.expand({
45
- "query" => "an example query".split(" ")
46
- })
47
- #=> #<Addressable::URI:0xc9d95c URI:http://example.com/an+example+query/>
48
-
49
- template = Addressable::Template.new(
50
- "http://example.com/{-join|&|one,two,three}/"
51
- )
52
- template.partial_expand({"one" => "1", "three" => 3}).pattern
53
- #=> "http://example.com/?one=1{-prefix|&two=|two}&three=3"
54
-
55
- template = Addressable::Template.new(
56
- "http://{host}/{-suffix|/|segments}?{-join|&|one,two,bogus}\#{fragment}"
57
- )
58
- template2 = Addressable::UriTemplate.new(
59
- "http://{host}{/segments}/{?one,two,bogus}{#fragment}"
60
- )
61
- uri = Addressable::URI.parse(
62
- "http://example.com/a/b/c/?one=1&two=2#foo"
63
- )
64
- template.extract(uri)
65
- template2.extract(uri)
66
- #=>
67
- # {
68
- # "host" => "example.com",
69
- # "segments" => ["a", "b", "c"],
70
- # "one" => "1",
71
- # "two" => "2",
72
- # "fragment" => "foo"
73
- # }
35
+ ```ruby
36
+ require "addressable/uri"
37
+
38
+ uri = Addressable::URI.parse("http://example.com/path/to/resource/")
39
+ uri.scheme
40
+ #=> "http"
41
+ uri.host
42
+ #=> "example.com"
43
+ uri.path
44
+ #=> "/path/to/resource/"
45
+
46
+ uri = Addressable::URI.parse("http://www.詹姆斯.com/")
47
+ uri.normalize
48
+ #=> #<Addressable::URI:0xc9a4c8 URI:http://www.xn--8ws00zhy3a.com/>
49
+ ```
50
+
51
+
52
+ # URI Templates
53
+
54
+ For more details, see [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.txt).
55
+
56
+
57
+ ```ruby
58
+
59
+ require "addressable/template"
60
+
61
+ template = Addressable::Template.new("http://example.com/{?query*}")
62
+ template.expand({
63
+ "query" => {
64
+ 'foo' => 'bar',
65
+ 'color' => 'red'
66
+ }
67
+ })
68
+ #=> #<Addressable::URI:0xc9d95c URI:http://example.com/?foo=bar&color=red>
69
+
70
+ template = Addressable::Template.new("http://example.com/{?one,two,three}")
71
+ template.partial_expand({"one" => "1", "three" => 3}).pattern
72
+ #=> "http://example.com/?one=1{&two}&three=3"
73
+
74
+ template = Addressable::Template.new(
75
+ "http://{host}{/segments*}/{?one,two,bogus}{#fragment}"
76
+ )
77
+ uri = Addressable::URI.parse(
78
+ "http://example.com/a/b/c/?one=1&two=2#foo"
79
+ )
80
+ template.extract(uri)
81
+ #=>
82
+ # {
83
+ # "host" => "example.com",
84
+ # "segments" => ["a", "b", "c"],
85
+ # "one" => "1",
86
+ # "two" => "2",
87
+ # "fragment" => "foo"
88
+ # }
89
+ ```
74
90
 
75
91
  # Install
76
92
 
77
- $ sudo gem install addressable
93
+ ```console
94
+ $ gem install addressable
95
+ ```
78
96
 
79
97
  You may optionally turn on native IDN support by installing libidn and the
80
98
  idn gem:
81
99
 
82
- $ sudo apt-get install idn # Debian/Ubuntu
83
- $ sudo brew install libidn # OS X
84
- $ sudo gem install idn
100
+ ```console
101
+ $ sudo apt-get install libidn11-dev # Debian/Ubuntu
102
+ $ brew install libidn # OS X
103
+ $ gem install idn-ruby
104
+ ```
105
+
106
+ # Semantic Versioning
107
+
108
+ This project uses [Semantic Versioning](https://semver.org/). You can (and should) specify your
109
+ dependency using a pessimistic version constraint covering the major and minor
110
+ values:
111
+
112
+ ```ruby
113
+ spec.add_dependency 'addressable', '~> 2.7'
114
+ ```
115
+
116
+ If you need a specific bug fix, you can also specify minimum tiny versions
117
+ without preventing updates to the latest minor release:
85
118
 
86
- **NOTE:** Native IDN support appears to be broken in Ruby 1.9.x. The IDN gem
87
- hasn't been updated in years.
119
+ ```ruby
120
+ spec.add_dependency 'addressable', '~> 2.3', '>= 2.3.7'
121
+ ```
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'rake'
3
5
 
@@ -10,28 +12,26 @@ PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
10
12
 
11
13
  RELEASE_NAME = "REL #{PKG_VERSION}"
12
14
 
13
- RUBY_FORGE_PROJECT = PKG_NAME
14
- RUBY_FORGE_USER = "sporkmonger"
15
- RUBY_FORGE_PATH = "/var/www/gforge-projects/#{RUBY_FORGE_PROJECT}"
16
- RUBY_FORGE_URL = "http://#{RUBY_FORGE_PROJECT}.rubyforge.org/"
17
-
18
15
  PKG_SUMMARY = "URI Implementation"
19
16
  PKG_DESCRIPTION = <<-TEXT
20
- Addressable is a replacement for the URI implementation that is part of
21
- Ruby's standard library. It more closely conforms to the relevant RFCs and
22
- adds support for IRIs and URI templates.
17
+ Addressable is an alternative implementation to the URI implementation that is
18
+ part of Ruby's standard library. It is flexible, offers heuristic parsing, and
19
+ additionally provides extensive support for IRIs and URI templates.
23
20
  TEXT
24
21
 
25
22
  PKG_FILES = FileList[
26
- "lib/**/*", "spec/**/*", "vendor/**/*", "data/**/*",
27
- "tasks/**/*", "website/**/*",
28
- "[A-Z]*", "Rakefile"
29
- ].exclude(/database\.yml/).exclude(/Gemfile\.lock/).exclude(/[_\.]git$/)
23
+ "data/**/*",
24
+ "lib/**/*.rb",
25
+ "spec/**/*.rb",
26
+ "tasks/**/*.rake",
27
+ "addressable.gemspec",
28
+ "CHANGELOG.md",
29
+ "Gemfile",
30
+ "LICENSE.txt",
31
+ "README.md",
32
+ "Rakefile",
33
+ ]
30
34
 
31
- RCOV_ENABLED = (RUBY_PLATFORM != "java" && RUBY_VERSION =~ /^1\.8/)
32
35
  task :default => "spec"
33
36
 
34
- WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
35
- SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
36
-
37
37
  Dir['tasks/**/*.rake'].each { |rake| load rake }
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # stub: addressable 2.8.7 ruby lib
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "addressable".freeze
6
+ s.version = "2.8.7".freeze
7
+
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.metadata = { "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v2.8.7" } if s.respond_to? :metadata=
10
+ s.require_paths = ["lib".freeze]
11
+ s.authors = ["Bob Aman".freeze]
12
+ s.date = "2024-06-21"
13
+ 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
14
+ s.email = "bob@sporkmonger.com".freeze
15
+ s.extra_rdoc_files = ["README.md".freeze]
16
+ 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]
17
+ s.homepage = "https://github.com/sporkmonger/addressable".freeze
18
+ s.licenses = ["Apache-2.0".freeze]
19
+ s.rdoc_options = ["--main".freeze, "README.md".freeze]
20
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
21
+ s.rubygems_version = "3.5.11".freeze
22
+ s.summary = "URI Implementation".freeze
23
+
24
+ s.specification_version = 4
25
+
26
+ s.add_runtime_dependency(%q<public_suffix>.freeze, [">= 2.0.2".freeze, "< 7.0".freeze])
27
+ s.add_development_dependency(%q<bundler>.freeze, [">= 1.0".freeze, "< 3.0".freeze])
28
+ end