uri-builder 0.1.2 → 0.1.3

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: 2ecd15fc5e3de3f5fb700759eaba92a5db8731c144a3e1335b7c3ecd8a4dcb5c
4
- data.tar.gz: 604d547bfedf9127efb57c674ea7f99bb9f8a0ad2f64dfbcde5d3f29fd351df6
3
+ metadata.gz: bfc6aae28ed080b625a086509de8d8f540c7b96ae18fd44ac5e9206a116160c4
4
+ data.tar.gz: 55094b5b4f3e05475b9fea762c6abad86a8665c3e817b0ba17ed264f795b5b06
5
5
  SHA512:
6
- metadata.gz: e1a497fe06a2838a4bec7ea091c47fd770e0a67e05325e230e81bb26dc4b75cbb0f0f460ba5cc968cdc2b4b2e07fa050fe7d77bfb9cd20da05d4f994d446ead0
7
- data.tar.gz: 051ab649d2c481a8a9991339c810331ad7aede03e56de45933880e2a093f4fcfbbde8ac8506c8f0c0e9b150fb7da2208816ca2a8e56041c04b00a0be0817f61b
6
+ metadata.gz: 120a8ea8dbd40db58885acbd69aa2dd7c6a53f1dab53facc44d3e7415efb9568470e83798156359bccc8a87a5d289426d94fefca7f62fb7aff73d010bb8079a4
7
+ data.tar.gz: 4284aa8a800bd0f92156ee916dd087c1194f776291afdfc7204e17f532bb96efc97414ab72fba4193101b8a5e7816ce391218dcd80a4465c8eadb7ae95dbe94c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uri-builder (0.1.2)
4
+ uri-builder (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -24,6 +24,7 @@ GEM
24
24
 
25
25
  PLATFORMS
26
26
  arm64-darwin-21
27
+ arm64-darwin-22
27
28
  x86_64-darwin-20
28
29
 
29
30
  DEPENDENCIES
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  module Build
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/uri/builder.rb CHANGED
@@ -14,12 +14,18 @@ module URI
14
14
  @uri = uri.clone
15
15
  end
16
16
 
17
- [:host, :scheme, :query, :fragment, :port].each do |property|
17
+ [:host, :query, :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 scheme(value)
24
+ target_scheme = URI.scheme_list[value.upcase]
25
+ args = Hash[target_scheme.component.map { |attr| [ attr, @uri.send(attr) ] }]
26
+ @uri = target_scheme.build(**args)
27
+ end
28
+
23
29
  def query(value)
24
30
  value = case value
25
31
  when Hash
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2023-07-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build URIs via chains
14
14
  email:
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.3.7
52
+ rubygems_version: 3.4.6
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: Build URIs via chains