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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/uri/builder/version.rb +1 -1
- data/lib/uri/builder.rb +14 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c35a6790d4fa14b69e8dbe73f2ce8f5b7814fd4f125aff996cdbb228d417375
|
4
|
+
data.tar.gz: 20e34111ccfc4a4440f4a4c0ffb126e4a9109aeb24decc9fe825af0942ad6195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9c635ee513fe5f7e9854185e2d8e8d346560a9165fbbbda30f9b465c8bb6c6d7939137632ed2a7546ee1876736bc36f42299c4e84451bed44b57fae0651c061
|
7
|
+
data.tar.gz: 5263fa6e147a0e8c23a57fc3401b7ba95ba47d8aa65b280c8145bd55b8d6d69208b2f5d5c07668cea90a10a5562352c57a9939378f5c64b22fe7d329a722d610
|
data/Gemfile.lock
CHANGED
data/lib/uri/builder/version.rb
CHANGED
data/lib/uri/builder.rb
CHANGED
@@ -14,12 +14,16 @@ module URI
|
|
14
14
|
@uri = uri.clone
|
15
15
|
end
|
16
16
|
|
17
|
-
[:host, :
|
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
|
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.
|
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
|
+
date: 2024-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Build URIs via chains
|
14
14
|
email:
|