mamiya 0.0.1.alpha11 → 0.0.1.alpha12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72fe2e5902f669e48c73a5b62ed1aec2f4b55e2e
4
- data.tar.gz: 1135c8729f2c67847a9a736f447d2bf77e386e44
3
+ metadata.gz: 66d419e18130df7899ed0f57d0f5f01acbfe5df6
4
+ data.tar.gz: e1664b735172d18580fe8412bd966cd9da959978
5
5
  SHA512:
6
- metadata.gz: ace24e5310616ea9bc045d9a7dc74498bec6caef2425c0f29d6641488e036976a12d6766b1e3c33f67700a7a0b8035f0b0842315430418d684633cdab7224a56
7
- data.tar.gz: ddad6f309a018a1db82f0f04e2db9478bcfefb04adc1592331d117f0d64c4373c8d7541e64d95378156333b18f170c94537fc7a39b6ae26e9f1340b40fe67d3f
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
- response = http.get("#{proxy_host_uri.path}/#{@config[:bucket]}/#{key}")
74
- response.value
73
+ http.request_get("#{proxy_host_uri.path}/#{@config[:bucket]}/#{key}") do |response|
74
+ response.value
75
75
 
76
- if block_given?
77
- yield(response)
78
- else
79
- response.read_body do |chunk|
80
- target.write chunk
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
@@ -1,3 +1,3 @@
1
1
  module Mamiya
2
- VERSION = "0.0.1.alpha11"
2
+ VERSION = "0.0.1.alpha12"
3
3
  end
@@ -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(:get).with('/_/testbucket/myapp/test.tar.gz').and_return(
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(:get).with('/_/testbucket/myapp/test.json').and_return(
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(:get).with('/_/testbucket/myapp/not-found.tar.gz').and_return(
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(:get).with('/_/testbucket/myapp/not-found.json').and_return(
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.alpha11
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-15 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor