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 +4 -4
- data/lib/micky/uri.rb +9 -2
- data/lib/micky/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 721a907e79c50e92d490a8b96a97670e06924b95
|
4
|
+
data.tar.gz: 5c8b7df74db496a0de1827d5e30335ed46d629e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|