micky 0.6.3 → 0.6.4

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: b8fdd250236158b1afe53841397614ac5b9de39b
4
- data.tar.gz: 0823a7c0003b881a1735a67ca122d2580a62e363
3
+ metadata.gz: 721a907e79c50e92d490a8b96a97670e06924b95
4
+ data.tar.gz: 5c8b7df74db496a0de1827d5e30335ed46d629e4
5
5
  SHA512:
6
- metadata.gz: 12c84ebc58840264e9150991883a2334917340670b256e70907fd26a0c8aae58b18bdb798a90169d0be4f663b80d4a044347a55b92371869e7242294cd811c1f
7
- data.tar.gz: 43ce8aeb60e53280cb163b2409edd4fbaf29d95459b23992247234bd661e2155d98942686dc8a564265e357e490275dfe22b6148d48fc6708489657dcf795b4b
6
+ metadata.gz: 8a02df545becb4cbc3d034c0d5b14b9df30aad4baa171e2a6221aa00b9001cb8df2fb1e8b90bdc2b2ccc1ee57f1bc93fc737e74d71357bc676ab1945f532e68c
7
+ data.tar.gz: 77e753ea7582296dca5f8ea32ed095b8a46c53452ab174985b330f96c2f9819f4dc163ecdaa0a6449f75b189286f41449e4811da1a77232e711139ade99d5552
data/lib/micky/uri.rb CHANGED
@@ -1,11 +1,18 @@
1
1
  require 'uri'
2
2
 
3
3
  module Micky
4
- HTTP_URI_REGEX = %r{\Ahttps?://}
4
+ HTTP_URI_REGEX = %r{\Ahttps?://?}
5
+ SINGLE_SLASH_HTTP_URI_REGEX = %r{\Ahttps?:/[^/]}
5
6
 
6
7
  def self.URI(uri)
7
8
  uri = uri.to_s.strip
8
- uri = "http://#{uri}" if uri !~ HTTP_URI_REGEX
9
+ if uri =~ HTTP_URI_REGEX
10
+ if uri =~ SINGLE_SLASH_HTTP_URI_REGEX
11
+ uri.sub! '/', '//'
12
+ end
13
+ else
14
+ uri = "http://#{uri}"
15
+ end
9
16
  begin
10
17
  ::URI.parse(uri)
11
18
  rescue ::URI::InvalidURIError
data/lib/micky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Micky
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafaël Blais Masson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-07 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler