hyperion_http 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hyperion/aux/version.rb +1 -1
- data/lib/hyperion/formats.rb +2 -0
- data/lib/hyperion/types/multipart.rb +1 -0
- data/spec/lib/hyperion/formats_spec.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a79b181774b51de90a86b8e92af8e2283428362
|
4
|
+
data.tar.gz: 86b80d5e03d10455cd04332e139d5d0df54f7f71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8eabe59299e06d096b2dd248f18970d614ca6aae862098c89dfa2f53b6c90c564b932e278514ca7d02ad4ccab86ec4fbbb3b9d1fa7d282fc14f9cc176b613ce
|
7
|
+
data.tar.gz: 8c439f16af5b3bf31e34d81eeb74bc32630c2f7b08a303292e7c6dfce9737c83fe6caedaf07b60eec7e4524dda44ca7e5d7695e9c74bce0a383c836d896e8c91
|
data/lib/hyperion/aux/version.rb
CHANGED
data/lib/hyperion/formats.rb
CHANGED
@@ -2,6 +2,7 @@ require 'oj'
|
|
2
2
|
require 'stringio'
|
3
3
|
require 'hyperion/aux/logger'
|
4
4
|
require 'abstractivator/enum'
|
5
|
+
require 'hyperion/types/multipart'
|
5
6
|
|
6
7
|
class Hyperion
|
7
8
|
module Formats
|
@@ -13,6 +14,7 @@ class Hyperion
|
|
13
14
|
define_enum :Known, :json, :protobuf
|
14
15
|
|
15
16
|
def write(obj, format)
|
17
|
+
return obj.body if obj.is_a?(Multipart)
|
16
18
|
return obj if obj.is_a?(String) || obj.nil? || format.nil?
|
17
19
|
|
18
20
|
case Formats.get_from(format)
|
@@ -0,0 +1 @@
|
|
1
|
+
Multipart = Struct.new(:body)
|
@@ -21,6 +21,10 @@ class Hyperion
|
|
21
21
|
descriptor = double(format: :json)
|
22
22
|
expect(write({'a' => 1}, descriptor)).to eql '{"a":1}'
|
23
23
|
end
|
24
|
+
it 'returns the body of a Multipart data request' do
|
25
|
+
data = Multipart.new(test: 'data')
|
26
|
+
expect(write(data, nil)).to eql data.body
|
27
|
+
end
|
24
28
|
|
25
29
|
context 'formats' do
|
26
30
|
context 'when writing json' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperion_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Indigo BioAutomation, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -229,6 +229,7 @@ files:
|
|
229
229
|
- lib/hyperion/types/hyperion_result.rb
|
230
230
|
- lib/hyperion/types/hyperion_status.rb
|
231
231
|
- lib/hyperion/types/hyperion_uri.rb
|
232
|
+
- lib/hyperion/types/multipart.rb
|
232
233
|
- lib/hyperion/types/payload_descriptor.rb
|
233
234
|
- lib/hyperion/types/response_descriptor.rb
|
234
235
|
- lib/hyperion/types/rest_route.rb
|