anyfetch 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: abe33d8e99f0ccfbd0deb6f07a34bb1be0a9d70b
4
- data.tar.gz: 53d10c8664b9bfe872c1f89386125177731890eb
3
+ metadata.gz: 64448adfab299c1b4c89f9ab347e00412226cd19
4
+ data.tar.gz: 162903ef49a02492561791aa1a3ab2db3fcfd49e
5
5
  SHA512:
6
- metadata.gz: b72543ae099df71a7b286ce115759aab4d2e9d0720038e0fd65193549f9f902b4f7679df77a055cd39d1d065f2e11a976854227378a4e304503b81ce541a7ed8
7
- data.tar.gz: 81205b021492ab33bec4df7e7c21d9bf1b4ab627193633f0a4e96e16befbffbc31a45aef60a9b0f7462d29451a8d31b6c6d667c91bf4a1e6f6ff63e6cd766d52
6
+ metadata.gz: 440b8dee4e48bf7e74d272870778c1fb6d9747e58c3a61c12353e46777855fb95bafbbcfcc598150c3857a566ff39012734915f669301fd6274542a30b9ca083
7
+ data.tar.gz: 52b3be162cb4d24ffea775c9dfe7688e5ec6efc3ea4349a9c93ca4b6d538acdeae192a96b8c06ed5aeea57ec1d47e22cbb66457c86877fee077c72a99e0482ee
@@ -8,16 +8,15 @@ require "anyfetch/version"
8
8
 
9
9
  module Anyfetch extend self
10
10
  def open(uri, options = {})
11
- uri = URI.parse(uri.to_s)
11
+ uri = to_uri(uri)
12
12
  handler(uri, options).open
13
13
  end
14
14
 
15
15
  private
16
16
 
17
17
  def to_uri(uri)
18
- uri = uri.gsub('[', '%5B').gsub(']', '%5D').strip
19
- uri = ::URI.parse(::URI.encode(::URI.decode(uri)))
20
- URI.parse(uri)
18
+ encoded = URI.encode(URI.decode(uri.to_s))
19
+ URI.parse(encoded)
21
20
  end
22
21
 
23
22
  def handler(uri, options = {})
@@ -1,3 +1,3 @@
1
1
  module Anyfetch
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anyfetch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Szajbe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-06 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocaine