shrine-url 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/shrine/storage/url.rb +5 -7
- data/shrine-url.gemspec +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: f4f3a92060828b60ded518a3b4b1413c3682851d
|
4
|
+
data.tar.gz: 756dcbadd24b79466452c81a3c226b0212505ed5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b80cf29c41b9072e6aae47d3845edf7910b1b6eba8ad71b1182318520eacc4c94c5007587bf056d7fd09cebe07b29bdf8312072315026420470e5ebbc2e5444
|
7
|
+
data.tar.gz: c06953325cc2c20bd4d4bed5e2641ab1b2d6739d07989fc8a925c0dc9cdbdfc5785ce54488f942a1b6142c6af61333c09f30982e42fc018470fa5f26fe81bb4b
|
data/README.md
CHANGED
@@ -98,3 +98,4 @@ you'll need to have Docker installed and running.
|
|
98
98
|
[shrine-cloudinary]: https://github.com/janko-m/shrine-cloudinary
|
99
99
|
[shrine-uploadcare]: https://github.com/janko-m/shrine-uploadcare
|
100
100
|
[Down]: https://github.com/janko-m/down
|
101
|
+
[kennethreitz/httpbin]: https://github.com/kennethreitz/httpbin
|
data/lib/shrine/storage/url.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "shrine"
|
2
|
-
require "net/
|
2
|
+
require "net/https"
|
3
3
|
|
4
4
|
class Shrine
|
5
5
|
module Storage
|
@@ -44,16 +44,14 @@ class Shrine
|
|
44
44
|
private
|
45
45
|
|
46
46
|
def request(method, url)
|
47
|
-
|
48
|
-
|
47
|
+
uri = URI.parse(url)
|
48
|
+
use_ssl = uri.is_a?(URI::HTTPS)
|
49
49
|
|
50
|
-
Net::HTTP.start(uri.host, uri.port) do |http|
|
50
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: use_ssl) do |http|
|
51
51
|
request = Net::HTTP.const_get(method.to_s.capitalize).new(uri.request_uri)
|
52
52
|
yield request if block_given?
|
53
|
-
|
53
|
+
http.request(request)
|
54
54
|
end
|
55
|
-
|
56
|
-
response
|
57
55
|
end
|
58
56
|
end
|
59
57
|
end
|
data/shrine-url.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-url
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|