protocol-url 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85a50d979d385fbef9e8defa4e94f98832aca156dc86f79352a4b62673f30e2e
4
- data.tar.gz: 71ea54c2460fc94773c13c8cc334f66fef89974efd71bd89537487f0833b844e
3
+ metadata.gz: efcdbe6f1de1ec7c6bdadf70824bdd62e0b351c768896e52c34234e982a3527d
4
+ data.tar.gz: 3687c0ff3fe5723b3df989d929326062120307e199b801395faf7026dd49606b
5
5
  SHA512:
6
- metadata.gz: '0903cee8e33682b465b633a7bbdb2b34e52800b476cf550a06c2fec5cc328532cfd1dac820cfafe31a76500982f92cbbd566af9168ede9cd1e6ccdd9d9b72887'
7
- data.tar.gz: 7c12517bafaa34bae712abacfe299231a858a12d9f9b37dd188f3275e20008bf116fab85bb53843a55834978866365444d210b93d51ea2e05b7a2d2a9a35ae1a
6
+ metadata.gz: cb62cd371a93e7fadf9b51823382d06034365301470336733c3870798c29839a5c8d550706dc1e69fb5de964d442192299f1f8fdd351df836b8852bc0e730fd9
7
+ data.tar.gz: e4bee5e0cf8ee2aac01942418e0045cd233b0a901535891933bc274eff4bb9c0fff9edb2164eedbd99dda633a68fd91ce45dc823dabb5f5516d5818752301587
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
6
+ module Protocol
7
+ module URL
8
+ # RFC 3986 URI pattern with named capture groups.
9
+ # Matches: [scheme:][//authority][path][?query][#fragment]
10
+ # Rejects strings containing whitespace or control characters (matching standard URI behavior).
11
+ PATTERN = %r{
12
+ \A
13
+ (?:(?<scheme>[a-z][a-z0-9+.-]*):)? # scheme (optional)
14
+ (?://(?<authority>[^/?#\s]*))? # authority (optional, without //, no whitespace)
15
+ (?<path>[^?#\s]*) # path (no whitespace)
16
+ (?:\?(?<query>[^#\s]*))? # query (optional, no whitespace)
17
+ (?:\#(?<fragment>[^\s]*))? # fragment (optional, no whitespace)
18
+ \z
19
+ }ix
20
+ end
21
+ end
@@ -3,6 +3,7 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2025, by Samuel Williams.
5
5
 
6
+ require_relative "pattern"
6
7
  require_relative "encoding"
7
8
  require_relative "relative"
8
9
 
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module URL
10
- VERSION = "0.1.0"
10
+ VERSION = "0.2.0"
11
11
  end
12
12
  end
data/lib/protocol/url.rb CHANGED
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  require_relative "url/version"
7
+ require_relative "url/pattern"
7
8
  require_relative "url/encoding"
8
9
  require_relative "url/reference"
9
10
  require_relative "url/relative"
@@ -11,20 +12,6 @@ require_relative "url/absolute"
11
12
 
12
13
  module Protocol
13
14
  module URL
14
- # RFC 3986 URI pattern with named capture groups.
15
- # Matches: [scheme:][//authority][path][?query][#fragment]
16
- # Rejects strings containing whitespace or control characters (matching standard URI behavior).
17
- PATTERN = %r{
18
- \A
19
- (?:(?<scheme>[a-z][a-z0-9+.-]*):)? # scheme (optional)
20
- (?://(?<authority>[^/?#\s]*))? # authority (optional, without //, no whitespace)
21
- (?<path>[^?#\s]*) # path (no whitespace)
22
- (?:\?(?<query>[^#\s]*))? # query (optional, no whitespace)
23
- (?:\#(?<fragment>[^\s]*))? # fragment (optional, no whitespace)
24
- \z
25
- }ix
26
- private_constant :PATTERN
27
-
28
15
  # Coerce a value into an appropriate URL type (Absolute or Relative).
29
16
  #
30
17
  # @parameter value [String, Absolute, Relative, nil] The value to coerce.
data/readme.md CHANGED
@@ -34,6 +34,10 @@ This project is best served by a collaborative and respectful environment. Treat
34
34
 
35
35
  Please see the [project releases](https://github.com/socketry/protocol-urlreleases/index) for all releases.
36
36
 
37
+ ### v0.2.0
38
+
39
+ - Move `Protocol::URL::PATTERN` to `protocol/url/pattern.rb` so it can be shared more easily.
40
+
37
41
  ### v0.1.0
38
42
 
39
43
  - Initial implementation.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.2.0
4
+
5
+ - Move `Protocol::URL::PATTERN` to `protocol/url/pattern.rb` so it can be shared more easily.
6
+
3
7
  ## v0.1.0
4
8
 
5
9
  - Initial implementation.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -46,6 +46,7 @@ files:
46
46
  - lib/protocol/url/absolute.rb
47
47
  - lib/protocol/url/encoding.rb
48
48
  - lib/protocol/url/path.rb
49
+ - lib/protocol/url/pattern.rb
49
50
  - lib/protocol/url/reference.rb
50
51
  - lib/protocol/url/relative.rb
51
52
  - lib/protocol/url/version.rb
metadata.gz.sig CHANGED
Binary file