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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51fe736ee6fcf6b7ebfccaa81445d0c75bdc69e50f3432e4969c583a26b6e35c
4
- data.tar.gz: 3e1e6e22ce620f52715093f9e3361b35c6ab361d2db1202d6fec75f439d52df6
3
+ metadata.gz: 85b6c4103f0ea74aa2c3a24441bb5be82ef0236a1ef2ee2f31848b4f7e8b9156
4
+ data.tar.gz: 305382fc068d8fe5f3b1b081236296ff45b9c700ec87666a2c00e2f9558130d9
5
5
  SHA512:
6
- metadata.gz: 65f40511dc0a68d6bed7976077fa13f78e1326ca8368ac9d5903cd1cc8897216f254aa70942d674e1197cd8c5b288d2dc658be8843c0cff99a59bb7826215843
7
- data.tar.gz: f3fd822bc96b215d366f36275afd07d84b4e2c942df0c20c0b76244bccb1bfac7d80869052f93d6a7d4ed67c5c6d7a40156ccde5eae2c609287c08bb9c0de931
6
+ metadata.gz: 0017afd7454f2c2ce1651a9d8d57209812e760aaa2b6582c183e9eb0142f66dd3ca464296c15aa8391d7947a5c39dd7ee172d8dd86285966df5e9a1e3ea255e2
7
+ data.tar.gz: 54d925acb96ba79905e2fd03ec2c300f1121b37923789a4054150e5e65c3c98b042117452121ce0567e368c596cee0c18628dace289d8f8947e4688e055889dc
@@ -5,7 +5,11 @@
5
5
  name: copyrights
6
6
  'on':
7
7
  push:
8
+ branches:
9
+ - master
8
10
  pull_request:
11
+ branches:
12
+ - master
9
13
  jobs:
10
14
  copyrights:
11
15
  timeout-minutes: 15
@@ -5,7 +5,11 @@
5
5
  name: xcop
6
6
  'on':
7
7
  push:
8
+ branches:
9
+ - master
8
10
  pull_request:
11
+ branches:
12
+ - master
9
13
  jobs:
10
14
  xcop:
11
15
  timeout-minutes: 15
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.1'
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
- raise ArgumentError, 'The scheme must be a String' unless val.is_a?(String)
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
- raise ArgumentError, 'The host must be a String' unless val.is_a?(String)
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
- raise ArgumentError, 'The port must be an Integer' unless val.is_a?(Integer)
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
- raise ArgumentError, 'The path must be a String' unless val.is_a?(String)
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
- raise ArgumentError, 'The query must be a String' unless val.is_a?(String)
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
- raise ArgumentError, 'The path must be a String' unless path.is_a?(String)
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
- raise ArgumentError, 'The part must be a String' unless part.is_a?(String)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko