uri-builder 0.1.4 → 0.1.6

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: d90c9dfcbf3a15504e21d45d26a2c61878aebcd7571d18e07ad8782370011195
4
- data.tar.gz: d25487607b08a42ae363681724ac0190fef6a522771ad06ba686c908e65529ea
3
+ metadata.gz: 544ce8ea2cb50a4f72aa039ef2c56966300f6cd2c67dddc02739ba9b6e3f3bf6
4
+ data.tar.gz: 97aca8b3c2bacfbc3707d0f43f935ee67e75c07baa913aeda955a3d6441d4733
5
5
  SHA512:
6
- metadata.gz: 661d6acf1e0d8e37543d0bf8a02c7a7964e453c9e55e074c03aed13010bb51ca236b846a6eb017bf8831ea09d866e16cfbf0084b6525bf8e23e930d2df59bac7
7
- data.tar.gz: ef46b356e3770bd5ccf7e1eea45d02eb700b913e1b019c7fc0bd651238b1d5b0c7a760775d1f6ca581081714597702fe3cc1609258ce167a2c3989c4e519ee02
6
+ metadata.gz: a4c9d7c4925fce0b341529c232475dfd749125bb6b83e08c99876fd08e5f8e2af58eb451c2ffb2cbfb1ab8ee1d929a5d362253f116adf9fb5d088e3f9980f1fd
7
+ data.tar.gz: 030f8126cdb7db9f0204f88ff8f3fd20274b90c9ca5812b35439cdbba9cf0d759bc1e68502d40039cd5b4d40c25217e8c8050acac95cc5c9badbe8328a4282ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uri-builder (0.1.4)
4
+ uri-builder (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -6,6 +6,12 @@ URI builder makes working with URLs in Ruby a little less awkward by chaining me
6
6
  URI.build("https://www.example.com/api/v1").path("/api/v2").query(search: "great books").uri
7
7
  ```
8
8
 
9
+ Or if you prefer a block format that automatically converts back to an URI object after the transformation.
10
+
11
+ ```ruby
12
+ URI.build("https://www.example.com/api/v1") { _1.path("/api/v2").query search: "great books" }
13
+ ```
14
+
9
15
  Compare that to:
10
16
 
11
17
  ```ruby
@@ -50,4 +56,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
50
56
 
51
57
  ## Contributing
52
58
 
53
- Bug reports and pull requests are welcome on GitHub at https://github.com/rocketshipio/uri-builder.
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rubymonolith/uri-builder.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  module Build
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
data/lib/uri/builder.rb CHANGED
@@ -34,6 +34,7 @@ module URI
34
34
  end
35
35
  @uri = uri
36
36
  end
37
+ self
37
38
  end
38
39
 
39
40
  def query(value)
@@ -69,7 +70,13 @@ module URI
69
70
  end
70
71
 
71
72
  def self.build(value)
72
- URI(value).build
73
+ if block_given?
74
+ URI(value).build.tap do |uri|
75
+ yield uri
76
+ end.uri
77
+ else
78
+ URI(value).build
79
+ end
73
80
  end
74
81
 
75
82
  def self.env(key, default = nil)
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Build URIs via chains"
12
12
  spec.description = spec.summary
13
- spec.homepage = "https://github.com/rocketshipio/url-builder"
13
+ spec.homepage = "https://github.com/rubymonolith/url-builder"
14
14
  spec.required_ruby_version = ">= 2.6.0"
15
15
 
16
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
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
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-23 00:00:00.000000000 Z
11
+ date: 2023-11-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build URIs via chains
14
14
  email:
@@ -27,13 +27,13 @@ files:
27
27
  - lib/uri/builder/version.rb
28
28
  - sig/uri/transform.rbs
29
29
  - uri-transform.gemspec
30
- homepage: https://github.com/rocketshipio/url-builder
30
+ homepage: https://github.com/rubymonolith/url-builder
31
31
  licenses: []
32
32
  metadata:
33
33
  allowed_push_host: https://rubygems.org
34
- homepage_uri: https://github.com/rocketshipio/url-builder
35
- source_code_uri: https://github.com/rocketshipio/url-builder
36
- changelog_uri: https://github.com/rocketshipio/url-builder
34
+ homepage_uri: https://github.com/rubymonolith/url-builder
35
+ source_code_uri: https://github.com/rubymonolith/url-builder
36
+ changelog_uri: https://github.com/rubymonolith/url-builder
37
37
  post_install_message:
38
38
  rdoc_options: []
39
39
  require_paths:
@@ -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.4.6
52
+ rubygems_version: 3.4.10
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: Build URIs via chains