uri-builder 0.1.5 → 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: da8233e96a3d1b8c30fc61af43c9154df26e360f355adda9754feb2d0d914404
4
- data.tar.gz: 4f5d81c728c9dd7ca9bc953da13e2f68391a7e635edcb5eae242475c676738c2
3
+ metadata.gz: 544ce8ea2cb50a4f72aa039ef2c56966300f6cd2c67dddc02739ba9b6e3f3bf6
4
+ data.tar.gz: 97aca8b3c2bacfbc3707d0f43f935ee67e75c07baa913aeda955a3d6441d4733
5
5
  SHA512:
6
- metadata.gz: d561a713974c5d45df2a6d160a45fa0f667d8f47b7e6f06435f97741e09b0462316e81e71bb0ae5efefd6df5eee4695ae6618c3c81e5171829fa2e233b7993f6
7
- data.tar.gz: 238ce133061497b430efc6f0f7ea1b73a20ea11243dd08c03af762839a28a6e0a372b66dcbce30194eea9d88b5010fb2e81ab340f84a35916658e93738fa760d
6
+ metadata.gz: a4c9d7c4925fce0b341529c232475dfd749125bb6b83e08c99876fd08e5f8e2af58eb451c2ffb2cbfb1ab8ee1d929a5d362253f116adf9fb5d088e3f9980f1fd
7
+ data.tar.gz: 030f8126cdb7db9f0204f88ff8f3fd20274b90c9ca5812b35439cdbba9cf0d759bc1e68502d40039cd5b4d40c25217e8c8050acac95cc5c9badbe8328a4282ae
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.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
data/lib/uri/builder.rb CHANGED
@@ -70,7 +70,13 @@ module URI
70
70
  end
71
71
 
72
72
  def self.build(value)
73
- 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
74
80
  end
75
81
 
76
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.5
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-24 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