protocol-url 0.3.0 → 0.4.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/url/reference.rb +0 -8
- data/lib/protocol/url/relative.rb +24 -0
- data/lib/protocol/url/version.rb +1 -1
- data/readme.md +12 -0
- data/releases.md +12 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff6accb882e5c993ee454290f6d282d67df6b4d13ee01bdd24b042ea764ee03c
|
|
4
|
+
data.tar.gz: abc0495ee011bccd902d3f60bebcf4d8231e3559b14305fe5594d62df285eeae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a1852872d62c65b0d78f8cd698deaaca69ceea65b79fb2e9d04b0b1b347cf6555ba41c27b0c836e2b963981f0c9be9a8feeec55622cdede7018a01321d7bca6
|
|
7
|
+
data.tar.gz: 4c6a01694dda0e059d944e5155f365c27c00c244e8e5ea7310288b875f2f307e4ef0c610dd8ea906e30fd5338d13f33fb1d2b83dcd5c076d57e34a60eb515b3b
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -95,14 +95,6 @@ module Protocol
|
|
|
95
95
|
[@path, @query, @fragment, @parameters]
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
# Compare two references.
|
|
99
|
-
#
|
|
100
|
-
# @parameter other [Reference] The other reference to compare.
|
|
101
|
-
# @returns [Integer] -1, 0, 1 if the reference is less than, equal to, or greater than the other reference.
|
|
102
|
-
def <=> other
|
|
103
|
-
to_ary <=> other.to_ary
|
|
104
|
-
end
|
|
105
|
-
|
|
106
98
|
# @returns [Boolean] Whether the reference has parameters.
|
|
107
99
|
def parameters?
|
|
108
100
|
@parameters and !@parameters.empty?
|
|
@@ -135,14 +135,38 @@ module Protocol
|
|
|
135
135
|
[@path, @query, @fragment]
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
def hash
|
|
139
|
+
to_ary.hash
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def equal?(other)
|
|
143
|
+
to_ary == other.to_ary
|
|
144
|
+
end
|
|
145
|
+
|
|
138
146
|
def <=>(other)
|
|
139
147
|
to_ary <=> other.to_ary
|
|
140
148
|
end
|
|
141
149
|
|
|
150
|
+
def ==(other)
|
|
151
|
+
to_ary == other.to_ary
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def ===(other)
|
|
155
|
+
to_s === other
|
|
156
|
+
end
|
|
157
|
+
|
|
142
158
|
def to_s
|
|
143
159
|
append
|
|
144
160
|
end
|
|
145
161
|
|
|
162
|
+
def as_json(...)
|
|
163
|
+
to_s
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def to_json(...)
|
|
167
|
+
as_json.to_json(...)
|
|
168
|
+
end
|
|
169
|
+
|
|
146
170
|
def inspect
|
|
147
171
|
"#<#{self.class} #{to_s}>"
|
|
148
172
|
end
|
data/lib/protocol/url/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -34,6 +34,18 @@ 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.4.0
|
|
38
|
+
|
|
39
|
+
- Add comparison methods to `Protocol::URL::Relative` (and by inheritance to `Protocol::URL::Absolute`):
|
|
40
|
+
- `#==` for structural equality comparison (compares path, query, fragment components).
|
|
41
|
+
- `#===` for string equality comparison (enables case statement matching).
|
|
42
|
+
- `#<=>` for ordering and sorting.
|
|
43
|
+
- `#hash` for hash key support.
|
|
44
|
+
- `#equal?` for component-based equality checking.
|
|
45
|
+
- Add JSON serialization support to `Protocol::URL::Relative`:
|
|
46
|
+
- `#as_json` returns the string representation.
|
|
47
|
+
- `#to_json` returns a JSON-encoded string.
|
|
48
|
+
|
|
37
49
|
### v0.3.0
|
|
38
50
|
|
|
39
51
|
- Add `relative(target, from)` for computing relative paths between URLs.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.4.0
|
|
4
|
+
|
|
5
|
+
- Add comparison methods to `Protocol::URL::Relative` (and by inheritance to `Protocol::URL::Absolute`):
|
|
6
|
+
- `#==` for structural equality comparison (compares path, query, fragment components).
|
|
7
|
+
- `#===` for string equality comparison (enables case statement matching).
|
|
8
|
+
- `#<=>` for ordering and sorting.
|
|
9
|
+
- `#hash` for hash key support.
|
|
10
|
+
- `#equal?` for component-based equality checking.
|
|
11
|
+
- Add JSON serialization support to `Protocol::URL::Relative`:
|
|
12
|
+
- `#as_json` returns the string representation.
|
|
13
|
+
- `#to_json` returns a JSON-encoded string.
|
|
14
|
+
|
|
3
15
|
## v0.3.0
|
|
4
16
|
|
|
5
17
|
- Add `relative(target, from)` for computing relative paths between URLs.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|