furi 0.2.6 → 0.2.8

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: 8522bcc3d1b7e9982f6ccca4bd91a97df9fd3c7ca0ec45c40ae345dadf6b5f63
4
- data.tar.gz: e7f046f02b324bbd940b85cf4c061e951828561791bfba1a8b487eb53caa5695
3
+ metadata.gz: 28c6de657a741c4c62ac676e81317f2e617d11d4f694545898fd9125fb203503
4
+ data.tar.gz: 69e7ae9549a184162029248bef0c700e7587d2eeb6dbb5fc4c53dc055f3cd00a
5
5
  SHA512:
6
- metadata.gz: dc5a921d62aceec5937b8f409a065252fe7a80f2c5ffc282f9d7a20f605445a86bd6047f103815b383af6ee63c66966af8aeff6a313da6d7c97fe640119728e5
7
- data.tar.gz: 057a89a20fa245d2f93757e9b963f21d763c380836627cf3a2061f37e8fcbc5e61091cf1025537abcde23858275fa2fdd9f7000aa97800359e998b84c47ad57a
6
+ metadata.gz: d81ad22779d9b940820e9af740e99095776cd1565e5e093c90514e428640dfee689d33cc163eaa7a5f7b5e6ae45c9d4857ad47b1ecab4a8bda967d214a0e12e2
7
+ data.tar.gz: fcca9bac6df451646952725e7ad3ca913a636798e81cf6cce124cb8f251930e9c093cedcb6fa46968460a879a13b92ac5af2c3dd14716fd8c74b8acaa56ef92d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.2.8
2
+
3
+ * Add `endpoint` part (location + path, without query string and anchor)
4
+
5
+ ```ruby
6
+ Furi.parse("http://gusiev.com/articles/index.html?a=1#top").endpoint
7
+ # => "http://gusiev.com/articles/index.html"
8
+
9
+ Furi.replace("http://gusiev.com/index.html?a=1#top", endpoint: "http://gusiev.com/blog.html")
10
+ # => "http://gusiev.com/blog.html?a=1#top"
11
+ ```
12
+
1
13
  # v0.2.6
2
14
 
3
15
  * Support `filename` part replacement and extraction
data/lib/furi/uri.rb CHANGED
@@ -207,6 +207,18 @@ module Furi
207
207
  end
208
208
  end
209
209
 
210
+ def endpoint
211
+ [location, path].join
212
+ end
213
+
214
+ def endpoint=(string)
215
+ string ||= ""
216
+ string = parse_protocol(string)
217
+ authority, path = string.split("/", 2)
218
+ self.authority = authority
219
+ self.path = path ? "/#{path}" : nil
220
+ end
221
+
210
222
  def location=(string)
211
223
  string ||= ""
212
224
  string = string.gsub(%r(/\Z), '')
data/lib/furi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Furi
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.8"
3
3
  end
data/lib/furi.rb CHANGED
@@ -15,7 +15,7 @@ module Furi
15
15
 
16
16
  COMBINED_PARTS = [
17
17
  :hostinfo, :userinfo, :authority, :ssl, :domain, :domainname,
18
- :domainzone, :request, :location, :query,
18
+ :domainzone, :request, :location, :endpoint, :query,
19
19
  :directory, :extension, :file
20
20
  ]
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Gusiev