distributed-press-api-client 0.5.0rc0 → 0.5.0rc1

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: e19e26b40b8e66a49cd2ac91d688ffc0757fc83c7d19d6d3e7c59917d7cab652
4
- data.tar.gz: bea92fa0f42403e3c6eeffa5484f8224bbfc08236089be41aed7dd6900124f77
3
+ metadata.gz: dd36188ea41206127dc73adb68060bb2d597b108668e5d7735e01487b3fcca22
4
+ data.tar.gz: 79eb79b794953204f07574444d5d02d4678011005b7401873938094f24ab9f80
5
5
  SHA512:
6
- metadata.gz: 6df7cae6980256471a341c25d9ec34f60d38df59eded802959e210167157960376ef19e00d09be9b943cbf9f165046b7949de7824ea1dffbb7dd8824718c8f7b
7
- data.tar.gz: 846042442ce3c6720b5af695332d6140edacbe523e4fc7ad3f930938179672faffbd4a587e66ff45a44b1c8e796133188cc1e867770f4b9e4859d8f07e0c2fca
6
+ metadata.gz: e4e9175c76c9ecba06bfb2d00d7c5a55398cd71cb7819cade5f1a0158bffabe879aacdabf2cc09a06192f7a7096903c86d7cec91460d979f6472e83e91726a51
7
+ data.tar.gz: 74ccef6f5af3bc9b7c6d11c54ebc5df2501d940a1af8fc19690d95e9ffb918fa97b4c81c6de717863fb9d8a2dde07548be4bba10ea625ef6f140127e885d8642
@@ -174,7 +174,26 @@ class DistributedPress
174
174
  #
175
175
  # @return [String]
176
176
  def host
177
- @host ||= URI.parse(url).host
177
+ @host ||= uri.host
178
+ end
179
+
180
+ # If the endpoint is on a subdirectory, we need the absolute
181
+ # path for signing
182
+ #
183
+ # @param :endpoint [String]
184
+ # @return [String]
185
+ def absolute_endpoint(endpoint)
186
+ "#{uri.path}/#{endpoint}".squeeze('/')
187
+ end
188
+
189
+ # Absolute URL for an endpoint
190
+ #
191
+ # @param :endpoint [String]
192
+ # @return [String]
193
+ def absolute_url(endpoint)
194
+ uri.dup.tap do |u|
195
+ u.path = absolute_endpoint(endpoint)
196
+ end.to_s
178
197
  end
179
198
 
180
199
  private
@@ -254,15 +273,6 @@ class DistributedPress
254
273
  nil
255
274
  end
256
275
 
257
- # If the endpoint is on a subdirectory, we need the absolute
258
- # path for signing
259
- #
260
- # @param :endpoint [String]
261
- # @return [String]
262
- def absolute_endpoint(endpoint)
263
- "#{uri.path}/#{endpoint}".squeeze('/')
264
- end
265
-
266
276
  # Brotli available
267
277
  def brotli?
268
278
  begin
@@ -3,5 +3,5 @@
3
3
  # API client
4
4
  class DistributedPress
5
5
  # Version
6
- VERSION = '0.5.0rc0'
6
+ VERSION = '0.5.0rc1'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distributed-press-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0rc0
4
+ version: 0.5.0rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - f