mamiya 0.0.1.alpha11 → 0.0.1.alpha12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mamiya/storages/s3_proxy.rb +8 -7
- data/lib/mamiya/version.rb +1 -1
- data/spec/storages/s3_proxy_spec.rb +4 -4
- 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: 66d419e18130df7899ed0f57d0f5f01acbfe5df6
|
4
|
+
data.tar.gz: e1664b735172d18580fe8412bd966cd9da959978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 938ce1cb1d082428a06207111fcd3d51cb71ef1b108ebc01bb6e0388c49ff75ea3de0811fd18912d7e62cdc5539970be2de57ba48a7ef172d85d8985be77dcb1
|
7
|
+
data.tar.gz: 22158b345ff85c46390302277540cd5e8b733214cd4a0a56ee232549a543edec79dcb1b080afb50dc1c300e6edc392c4b352a93c1448a4c896d0c35c81f10593
|
@@ -70,14 +70,15 @@ module Mamiya
|
|
70
70
|
|
71
71
|
def proxy_get(key, target)
|
72
72
|
connect_proxy do |http|
|
73
|
-
|
74
|
-
|
73
|
+
http.request_get("#{proxy_host_uri.path}/#{@config[:bucket]}/#{key}") do |response|
|
74
|
+
response.value
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
if block_given?
|
77
|
+
yield(response)
|
78
|
+
else
|
79
|
+
response.read_body do |chunk|
|
80
|
+
target.write chunk
|
81
|
+
end
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
data/lib/mamiya/version.rb
CHANGED
@@ -29,27 +29,27 @@ describe Mamiya::Storages::S3Proxy do
|
|
29
29
|
allow(http).to receive(:use_ssl=).with(false)
|
30
30
|
allow(http).to receive(:start).and_yield(http)
|
31
31
|
|
32
|
-
allow(http).to receive(:
|
32
|
+
allow(http).to receive(:request_get).with('/_/testbucket/myapp/test.tar.gz').and_yield(
|
33
33
|
double('tarball response').tap do |resp|
|
34
34
|
allow(resp).to receive(:value).and_return(200)
|
35
35
|
allow(resp).to receive(:read_body).and_yield("{}\n")
|
36
36
|
end
|
37
37
|
)
|
38
38
|
|
39
|
-
allow(http).to receive(:
|
39
|
+
allow(http).to receive(:request_get).with('/_/testbucket/myapp/test.json').and_yield(
|
40
40
|
double('json response').tap do |resp|
|
41
41
|
allow(resp).to receive(:value).and_return(200)
|
42
42
|
allow(resp).to receive(:read_body).and_yield("{}\n")
|
43
43
|
end
|
44
44
|
)
|
45
45
|
|
46
|
-
allow(http).to receive(:
|
46
|
+
allow(http).to receive(:request_get).with('/_/testbucket/myapp/not-found.tar.gz').and_yield(
|
47
47
|
double('tarball 404 response').tap do |resp|
|
48
48
|
allow(resp).to receive(:value).and_raise(Net::HTTPServerException.new('404 "Not Found"',''))
|
49
49
|
end
|
50
50
|
)
|
51
51
|
|
52
|
-
allow(http).to receive(:
|
52
|
+
allow(http).to receive(:request_get).with('/_/testbucket/myapp/not-found.json').and_yield(
|
53
53
|
double('json 404 response').tap do |resp|
|
54
54
|
allow(resp).to receive(:value).and_raise(Net::HTTPServerException.new('404 "Not Found"',''))
|
55
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mamiya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.alpha12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Fukumori (sora_h)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|