protocol-url 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b1993c620685f91b17b6a707eace1ff03219c1d6e2eace3d272e8ec8c723680
4
- data.tar.gz: 8969a20bccae90e49a5d541ea9f384127aaf817e7df12b1ac8b16a27ba450b1a
3
+ metadata.gz: 67f58bb48277d53b3817bb38b2b7c4546a8a8e1f3df62cea531c577705c4c833
4
+ data.tar.gz: 55bcfd924be9ae1eada0b2e5f8ee93fcd4a1a24c0693986ed3f8818b26072fd1
5
5
  SHA512:
6
- metadata.gz: 46b12bedaa0fca57e658677545a09ea2839ce6496c149eaa30c10b5cd213d3abbc517f850ddffce5cc159a8c5a73cb99be10c1737e06ed75974ace4448beca70
7
- data.tar.gz: 513ab9374d04bf04512d11f8610dbae6a14deea9c27a70b1d7a813df569c6642ca1eb679a5f51ad4b99319980f0b5f6c178d895c12de0c2037726337261dbce2
6
+ metadata.gz: 7df97ce90f4ce934023217fbedf9cbf864febeee311b9b25e3ee952e647d75d8cc041f16665b84884fec1e1d2dad859f9f3d21a0bfdccf40f832938158a21924
7
+ data.tar.gz: bb2c1f9fece1eda9cb5ee8b96d216b28e0e15c6fe9605c6ec0d43a615b5b9a247f9bc299553e1d46778d9e6c5971e34d56bbd77f172202002ad63d7be89b53c3
checksums.yaml.gz.sig CHANGED
Binary file
@@ -15,8 +15,8 @@ module Protocol
15
15
  # @parameter scheme [String] The URL scheme (e.g., "https", "http").
16
16
  # @parameter authority [String] The authority component (e.g., "example.com", "user@host:port").
17
17
  # @parameter path [String | Path] The encoded path component (defaults to "/").
18
- # @parameter query [String, nil] The query string.
19
- # @parameter fragment [String, nil] The fragment identifier.
18
+ # @parameter query [String | Nil] The query string.
19
+ # @parameter fragment [String | Nil] The fragment identifier.
20
20
  def initialize(scheme, authority, path = "/", query = nil, fragment = nil)
21
21
  @scheme = scheme
22
22
  @authority = authority
@@ -36,11 +36,11 @@ module Protocol
36
36
  return super
37
37
  end
38
38
 
39
- # @attribute [String] The URL scheme.
40
- attr :scheme
39
+ # @attribute [String | Nil] The URL scheme.
40
+ attr_accessor :scheme
41
41
 
42
- # @attribute [String] The authority component.
43
- attr :authority
42
+ # @attribute [String | Nil] The authority component.
43
+ attr_accessor :authority
44
44
 
45
45
  # Check if the URL has a non-empty scheme.
46
46
  #
@@ -122,11 +122,11 @@ module Protocol
122
122
 
123
123
  # Create a new Absolute URL with modified components.
124
124
  #
125
- # @parameter scheme [String, nil] The scheme to use (nil to remove scheme).
126
- # @parameter authority [String, nil] The authority to use (nil to remove authority).
127
- # @parameter path [String, nil] The path to merge with the current path.
128
- # @parameter query [String, nil] The query string to use.
129
- # @parameter fragment [String, nil] The fragment to use.
125
+ # @parameter scheme [String | Nil] The scheme to use (nil to remove scheme).
126
+ # @parameter authority [String | Nil] The authority to use (nil to remove authority).
127
+ # @parameter path [String | Nil] The path to merge with the current path.
128
+ # @parameter query [String | Nil] The query string to use.
129
+ # @parameter fragment [String | Nil] The fragment to use.
130
130
  # @parameter pop [Boolean] Whether to pop the last path component before merging.
131
131
  # @returns [Absolute] A new Absolute URL with the modified components.
132
132
  #
@@ -102,8 +102,8 @@ module Protocol
102
102
  @parameters = parameters
103
103
  end
104
104
 
105
- # @attribute [Hash] User supplied parameters that will be appended to the query part.
106
- attr :parameters
105
+ # @attribute [Hash | Nil] User supplied parameters that will be appended to the query part.
106
+ attr_accessor :parameters
107
107
 
108
108
  # Freeze the reference.
109
109
  #
@@ -15,8 +15,8 @@ module Protocol
15
15
  # Initialize a new relative URL.
16
16
  #
17
17
  # @parameter path [String | Path] The encoded path component.
18
- # @parameter query [String, nil] The query string.
19
- # @parameter fragment [String, nil] The fragment identifier.
18
+ # @parameter query [String | Nil] The query string.
19
+ # @parameter fragment [String | Nil] The fragment identifier.
20
20
  def initialize(path, query = nil, fragment = nil)
21
21
  @path = Path[path]
22
22
  @query = query
@@ -38,11 +38,18 @@ module Protocol
38
38
  # @attribute [Path] The path component of the URL.
39
39
  attr :path
40
40
 
41
- # @attribute [String, nil] The query string component.
42
- attr :query
41
+ # Replace the path component of this URL.
42
+ # @parameter path [String | Path] The encoded path component.
43
+ # @returns [Path] The assigned path component.
44
+ def path=(path)
45
+ @path = Path[path]
46
+ end
47
+
48
+ # @attribute [String | Nil] The query string component.
49
+ attr_accessor :query
43
50
 
44
- # @attribute [String, nil] The fragment identifier.
45
- attr :fragment
51
+ # @attribute [String | Nil] The fragment identifier.
52
+ attr_accessor :fragment
46
53
 
47
54
  # Resolve the URL path beneath a local filesystem root.
48
55
  #
@@ -104,9 +111,9 @@ module Protocol
104
111
 
105
112
  # Create a new Relative URL with modified components.
106
113
  #
107
- # @parameter path [String, nil] The path to merge with the current path.
108
- # @parameter query [String, nil] The query string to use.
109
- # @parameter fragment [String, nil] The fragment to use.
114
+ # @parameter path [String | Nil] The path to merge with the current path.
115
+ # @parameter query [String | Nil] The query string to use.
116
+ # @parameter fragment [String | Nil] The fragment to use.
110
117
  # @parameter pop [Boolean] Whether to pop the last path component before merging.
111
118
  # @returns [Relative] A new Relative URL with the modified components.
112
119
  #
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module URL
10
- VERSION = "0.11.0"
10
+ VERSION = "0.12.0"
11
11
  end
12
12
  end
data/readme.md CHANGED
@@ -34,6 +34,55 @@ bundle exec sus
34
34
 
35
35
  Please see the [project releases](https://socketry.github.io/protocol-url/releases/index) for all releases.
36
36
 
37
+ ### v0.12.0
38
+
39
+ - Allow unfrozen relative and absolute URLs to replace their components.
40
+
41
+ ### v0.10.0
42
+
43
+ - Rename `Protocol::URL::FormData::Parser::CONTENT_TYPE` to `MEDIA_TYPE`.
44
+
45
+ ### v0.9.0
46
+
47
+ - Add `Protocol::URL::LimitError` for configured processing limits.
48
+
49
+ ### v0.8.0
50
+
51
+ - Use consistent limit naming for form data parser constraints.
52
+
53
+ ### v0.7.0
54
+
55
+ - Allow `Protocol::URL::FormData::Parser#parse` to populate a supplied result object.
56
+
57
+ ### v0.6.0
58
+
59
+ - Add `Protocol::URL::FormData::Parser` for incremental, limited parsing of `application/x-www-form-urlencoded` form data.
60
+ - Add `Protocol::URL::FormData::Nested` for consistently building nested form data while preserving absent and empty values.
61
+
62
+ ### v0.5.0
63
+
64
+ - Add `Protocol::URL::Encoding.decode_www_form` for decoding HTML form data where `+` represents a space.
65
+
66
+ ### v0.4.0
67
+
68
+ - Add comparison methods to `Protocol::URL::Relative` (and by inheritance to `Protocol::URL::Absolute`):
69
+ - `#==` for structural equality comparison (compares path, query, fragment components).
70
+ - `#===` for string equality comparison (enables case statement matching).
71
+ - `#<=>` for ordering and sorting.
72
+ - `#hash` for hash key support.
73
+ - `#equal?` for component-based equality checking.
74
+ - Add JSON serialization support to `Protocol::URL::Relative`:
75
+ - `#as_json` returns the string representation.
76
+ - `#to_json` returns a JSON-encoded string.
77
+
78
+ ### v0.3.0
79
+
80
+ - Add `relative(target, from)` for computing relative paths between URLs.
81
+
82
+ ### v0.2.0
83
+
84
+ - Move `Protocol::URL::PATTERN` to `protocol/url/pattern.rb` so it can be shared more easily.
85
+
37
86
  ### v0.10.0
38
87
 
39
88
  - Rename `Protocol::URL::FormData::Parser::CONTENT_TYPE` to `MEDIA_TYPE`.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.12.0
4
+
5
+ - Allow unfrozen relative and absolute URLs to replace their components.
6
+
3
7
  ## v0.10.0
4
8
 
5
9
  - Rename `Protocol::URL::FormData::Parser::CONTENT_TYPE` to `MEDIA_TYPE`.
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.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file