miasma-aws 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/miasma/contrib/aws/storage.rb +10 -6
- data/lib/miasma/contrib/aws.rb +2 -2
- data/lib/miasma-aws/version.rb +1 -1
- data/miasma-aws.gemspec +6 -1
- metadata +73 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c0c6ca7e79700a4062548c7c16393c315346b15
|
4
|
+
data.tar.gz: ac667b1d7c150e6f601aabd4dc5fbf0bc4c234bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07cfe373155d1416623386a7447661b6f1a65de1e8c0fc00d33a9329906f3775374786e129ad6207a1ad633dc144a99eb12e393ed68eb02c1bfe6e247615a992
|
7
|
+
data.tar.gz: df3a5cb492b0fd378af53baaa32e3008eef47541f915c60feda39e21e8359196bcee1e223b4cb8c14d1976062fa929e920de48b28f5d5320b9a6844ebb5e4e91
|
data/CHANGELOG.md
CHANGED
@@ -262,11 +262,13 @@ module Miasma
|
|
262
262
|
)
|
263
263
|
file.etag = result.get(:body, 'CompleteMultipartUploadResult', 'ETag')
|
264
264
|
else
|
265
|
-
if(file.attributes[:body].
|
265
|
+
if(file.attributes[:body].respond_to?(:readpartial))
|
266
266
|
args[:headers]['Content-Length'] = file.body.size.to_s
|
267
267
|
file.body.rewind
|
268
|
-
args[:body] = file.body.
|
268
|
+
args[:body] = file.body.readpartial(file.body.size)
|
269
269
|
file.body.rewind
|
270
|
+
else
|
271
|
+
args[:headers]['Content-Length'] = 0
|
270
272
|
end
|
271
273
|
result = request(
|
272
274
|
args.merge(
|
@@ -354,6 +356,7 @@ module Miasma
|
|
354
356
|
# @param file [Models::Storage::File]
|
355
357
|
# @return [IO, HTTP::Response::Body]
|
356
358
|
def file_body(file)
|
359
|
+
file_content = nil
|
357
360
|
if(file.persisted?)
|
358
361
|
result = request(
|
359
362
|
:path => file_path(file),
|
@@ -363,19 +366,20 @@ module Miasma
|
|
363
366
|
content = result[:body]
|
364
367
|
begin
|
365
368
|
if(content.is_a?(String))
|
366
|
-
StringIO.new(content)
|
369
|
+
file_content = StringIO.new(content)
|
367
370
|
else
|
368
371
|
if(content.respond_to?(:stream!))
|
369
372
|
content.stream!
|
370
373
|
end
|
371
|
-
content
|
374
|
+
file_content = content
|
372
375
|
end
|
373
376
|
rescue HTTP::StateError
|
374
|
-
StringIO.new(content.to_s)
|
377
|
+
file_content = StringIO.new(content.to_s)
|
375
378
|
end
|
376
379
|
else
|
377
|
-
StringIO.new('')
|
380
|
+
file_content = StringIO.new('')
|
378
381
|
end
|
382
|
+
File::Streamable.new(file_content)
|
379
383
|
end
|
380
384
|
|
381
385
|
# Simple callback to allow request option adjustments prior to
|
data/lib/miasma/contrib/aws.rb
CHANGED
@@ -30,7 +30,7 @@ module Miasma
|
|
30
30
|
list << content
|
31
31
|
end
|
32
32
|
set = result.get(*result_key.slice(0, 3))
|
33
|
-
if(set && set['NextToken'])
|
33
|
+
if(set.is_a?(Hash) && set['NextToken'])
|
34
34
|
list += all_result_pages(set['NextToken'], *result_key, &block)
|
35
35
|
end
|
36
36
|
list.compact
|
@@ -196,7 +196,7 @@ module Miasma
|
|
196
196
|
def generate_signature(http_method, path, opts)
|
197
197
|
to_sign = [
|
198
198
|
algorithm,
|
199
|
-
AwsApiCore.time_iso8601,
|
199
|
+
opts.to_smash.fetch(:headers, 'X-Amz-Date', AwsApiCore.time_iso8601),
|
200
200
|
credential_scope,
|
201
201
|
hashed_canonical_request(
|
202
202
|
can_req = build_canonical_request(http_method, path, opts)
|
data/lib/miasma-aws/version.rb
CHANGED
data/miasma-aws.gemspec
CHANGED
@@ -10,6 +10,11 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = 'Smoggy AWS API'
|
11
11
|
s.license = 'Apache 2.0'
|
12
12
|
s.require_path = 'lib'
|
13
|
-
s.
|
13
|
+
s.add_development_dependency 'miasma', '>= 0.2.12'
|
14
|
+
s.add_development_dependency 'pry'
|
15
|
+
s.add_development_dependency 'minitest'
|
16
|
+
s.add_development_dependency 'vcr'
|
17
|
+
s.add_development_dependency 'webmock'
|
18
|
+
s.add_development_dependency 'psych', '>= 2.0.8'
|
14
19
|
s.files = Dir['lib/**/*'] + %w(miasma-aws.gemspec README.md CHANGELOG.md LICENSE)
|
15
20
|
end
|
metadata
CHANGED
@@ -1,29 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: miasma
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.12
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.2.12
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
51
|
requirements:
|
17
52
|
- - ">="
|
18
53
|
- !ruby/object:Gem::Version
|
19
54
|
version: '0'
|
20
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
21
77
|
prerelease: false
|
22
78
|
version_requirements: !ruby/object:Gem::Requirement
|
23
79
|
requirements:
|
24
80
|
- - ">="
|
25
81
|
- !ruby/object:Gem::Version
|
26
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: psych
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.0.8
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.0.8
|
27
97
|
description: Smoggy AWS API
|
28
98
|
email: code@chrisroberts.org
|
29
99
|
executables: []
|