iri 0.11.1 → 0.11.2
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
- data/.github/workflows/copyrights.yml +4 -0
- data/.github/workflows/xcop.yml +4 -0
- data/iri.gemspec +1 -1
- data/lib/iri.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85b6c4103f0ea74aa2c3a24441bb5be82ef0236a1ef2ee2f31848b4f7e8b9156
|
4
|
+
data.tar.gz: 305382fc068d8fe5f3b1b081236296ff45b9c700ec87666a2c00e2f9558130d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0017afd7454f2c2ce1651a9d8d57209812e760aaa2b6582c183e9eb0142f66dd3ca464296c15aa8391d7947a5c39dd7ee172d8dd86285966df5e9a1e3ea255e2
|
7
|
+
data.tar.gz: 54d925acb96ba79905e2fd03ec2c300f1121b37923789a4054150e5e65c3c98b042117452121ce0567e368c596cee0c18628dace289d8f8947e4688e055889dc
|
data/.github/workflows/xcop.yml
CHANGED
data/iri.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
9
9
|
s.required_ruby_version = '>=2.2'
|
10
10
|
s.name = 'iri'
|
11
|
-
s.version = '0.11.
|
11
|
+
s.version = '0.11.2'
|
12
12
|
s.license = 'MIT'
|
13
13
|
s.summary = 'Simple Immutable Ruby URI Builder'
|
14
14
|
s.description = "Class Iri helps you build a URI and then modify its \
|
data/lib/iri.rb
CHANGED
@@ -217,7 +217,7 @@ class Iri
|
|
217
217
|
# @see #port
|
218
218
|
def scheme(val)
|
219
219
|
raise ArgumentError, "The scheme can't be nil" if val.nil?
|
220
|
-
|
220
|
+
val = val.to_s
|
221
221
|
raise ArgumentError, "The scheme can't be empty" if val.empty?
|
222
222
|
modify do |c|
|
223
223
|
c.scheme = val
|
@@ -236,7 +236,7 @@ class Iri
|
|
236
236
|
# @see #port
|
237
237
|
def host(val)
|
238
238
|
raise ArgumentError, "The host can't be nil" if val.nil?
|
239
|
-
|
239
|
+
val = val.to_s
|
240
240
|
raise ArgumentError, "The host can't be empty" if val.empty?
|
241
241
|
modify do |c|
|
242
242
|
c.host = val
|
@@ -255,7 +255,7 @@ class Iri
|
|
255
255
|
# @see #host
|
256
256
|
def port(val)
|
257
257
|
raise ArgumentError, "The port can't be nil" if val.nil?
|
258
|
-
|
258
|
+
val = val.to_i
|
259
259
|
raise ArgumentError, "The port can'be negative" if val.negative?
|
260
260
|
raise ArgumentError, "The port can'be zero" if val.zero?
|
261
261
|
raise ArgumentError, "The port can'be larger than 65536" if val > 65_536
|
@@ -276,7 +276,7 @@ class Iri
|
|
276
276
|
# @see #fragment
|
277
277
|
def path(val)
|
278
278
|
raise ArgumentError, "The path can't be nil" if val.nil?
|
279
|
-
|
279
|
+
val = val.to_s
|
280
280
|
raise ArgumentError, "The path can't be empty" if val.empty?
|
281
281
|
modify do |c|
|
282
282
|
c.path = val
|
@@ -317,7 +317,7 @@ class Iri
|
|
317
317
|
# @see #over
|
318
318
|
def query(val)
|
319
319
|
raise ArgumentError, "The query can't be nil" if val.nil?
|
320
|
-
|
320
|
+
val = val.to_s
|
321
321
|
modify do |c|
|
322
322
|
c.query = val
|
323
323
|
end
|
@@ -343,7 +343,7 @@ class Iri
|
|
343
343
|
# @see #fragment
|
344
344
|
def cut(path = '/')
|
345
345
|
raise ArgumentError, "The path can't be nil" if path.nil?
|
346
|
-
|
346
|
+
path = path.to_s
|
347
347
|
raise ArgumentError, "The path can't be empty" if path.empty?
|
348
348
|
modify do |c|
|
349
349
|
c.query = nil
|
@@ -374,7 +374,7 @@ class Iri
|
|
374
374
|
# @see #path
|
375
375
|
def append(part)
|
376
376
|
raise ArgumentError, "The part can't be nil" if part.nil?
|
377
|
-
|
377
|
+
part = part.to_s
|
378
378
|
raise ArgumentError, "The part can't be empty" if part.empty?
|
379
379
|
modify do |c|
|
380
380
|
tail = (c.path.end_with?('/') ? '' : '/') + CGI.escape(part.to_s)
|