uri-builder 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e06f8d4bcafa879c5e15eca5eea2465375d069f45dff718f3cb2d2639370ad64
4
- data.tar.gz: 2fb08af317f38650f039793e95a8d02ef01ec56029dc899190e79342ea500006
3
+ metadata.gz: 2c35a6790d4fa14b69e8dbe73f2ce8f5b7814fd4f125aff996cdbb228d417375
4
+ data.tar.gz: 20e34111ccfc4a4440f4a4c0ffb126e4a9109aeb24decc9fe825af0942ad6195
5
5
  SHA512:
6
- metadata.gz: 5715d70198f6cc9bff67b5f51aac33b6d28966ae4c85909b0b34f890ec8102d5a960691093b554237bc6aef571812b730c93a131268844454013254313f4daad
7
- data.tar.gz: 8331306c424006462e51f310903e67c9f9f6c41987788e6e917302633ab9eda1d661978615341499c588ddc566012468ba2105878691e48c411f700cb0e8fbf7
6
+ metadata.gz: f9c635ee513fe5f7e9854185e2d8e8d346560a9165fbbbda30f9b465c8bb6c6d7939137632ed2a7546ee1876736bc36f42299c4e84451bed44b57fae0651c061
7
+ data.tar.gz: 5263fa6e147a0e8c23a57fc3401b7ba95ba47d8aa65b280c8145bd55b8d6d69208b2f5d5c07668cea90a10a5562352c57a9939378f5c64b22fe7d329a722d610
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uri-builder (0.1.11)
4
+ uri-builder (0.1.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  module Build
5
- VERSION = "0.1.11"
5
+ VERSION = "0.1.12"
6
6
  end
7
7
  end
data/lib/uri/builder.rb CHANGED
@@ -14,12 +14,16 @@ module URI
14
14
  @uri = uri.clone
15
15
  end
16
16
 
17
- [:host, :query, :fragment, :port].each do |property|
17
+ [:host, :fragment, :port].each do |property|
18
18
  define_method property do |value|
19
19
  wrap property, value
20
20
  end
21
21
  end
22
22
 
23
+ def clear_fragment
24
+ wrap :fragment, nil
25
+ end
26
+
23
27
  def scheme(value)
24
28
  if @uri.scheme
25
29
  # Handles URLs without schemes, like https://example.com/foo
@@ -48,16 +52,24 @@ module URI
48
52
  wrap :query, value
49
53
  end
50
54
 
55
+ def clear_query
56
+ wrap :query, nil
57
+ end
58
+
51
59
  def path(*segments)
52
60
  # Make sure there's a leading / if a non leading / is given.
53
61
  wrap :path, ::File.join(*segments.compact.map(&:to_s).prepend("/"))
54
62
  end
55
63
 
64
+ def clear_path
65
+ path "/"
66
+ end
67
+
56
68
  def trailing_slash
57
69
  wrap :path, @uri.path + "/" unless @uri.path.end_with?("/")
58
70
  end
59
71
 
60
- def remove_trailing_slash
72
+ def clear_trailing_slash
61
73
  wrap :path, @uri.path.chomp("/") if @uri.path.end_with?("/") and @uri.path != "/"
62
74
  end
63
75
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-11 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build URIs via chains
14
14
  email: