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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c24c3452a5f16a5347b6d0ab930e01744a27e9fc
4
- data.tar.gz: 80d605302f41e1872f745cab3563657e183cdfb8
3
+ metadata.gz: 8a79b181774b51de90a86b8e92af8e2283428362
4
+ data.tar.gz: 86b80d5e03d10455cd04332e139d5d0df54f7f71
5
5
  SHA512:
6
- metadata.gz: b83b365370c05091223d03c430aa2d998b629313644ece52dec7f95d0fa7e6c13e32e2299bb97b2dadf3f8499aa8cbe80d59c64225301b094a4cde5bb735922a
7
- data.tar.gz: 66b8e4a08fbd601368020ecc199d7be76616316cb0b36dbc38aa7839ea5ba2be7f65ccad2673b7818c4ae06ae1856f22a103cbc13aa00abbe13927dbc3b1e0c9
6
+ metadata.gz: e8eabe59299e06d096b2dd248f18970d614ca6aae862098c89dfa2f53b6c90c564b932e278514ca7d02ad4ccab86ec4fbbb3b9d1fa7d282fc14f9cc176b613ce
7
+ data.tar.gz: 8c439f16af5b3bf31e34d81eeb74bc32630c2f7b08a303292e7c6dfce9737c83fe6caedaf07b60eec7e4524dda44ca7e5d7695e9c74bce0a383c836d896e8c91
@@ -1,3 +1,3 @@
1
1
  class Hyperion
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -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.5
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-13 00:00:00.000000000 Z
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