hyperion_http 0.1.3 → 0.1.4
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 +4 -4
- data/lib/hyperion/aux/version.rb +1 -1
- data/lib/hyperion/requestor.rb +2 -1
- data/spec/lib/superion_spec.rb +9 -0
- 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: d9d372cf4d4619f6f072bc380c17063ecb5fe855
|
4
|
+
data.tar.gz: 26f3f857b2e7c95172957dbaed57c63daa4528a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38a45cf7bf55934c47dfd23bb1516fbd489751f32a74ed78bc3171e1e68b7ee7fa38eb0d856ee0809a816aed593538ebb1c092c79367e4251a3423e18730145
|
7
|
+
data.tar.gz: a80a5552f4a2419ab751806a4f6b3aeb4f26790ee2390bcbbb52906442c00019f639b86d8bcdc74505162225e91aa2edec1bb8e96651ca04817cc82364741951
|
data/lib/hyperion/aux/version.rb
CHANGED
data/lib/hyperion/requestor.rb
CHANGED
@@ -19,11 +19,12 @@ class Hyperion
|
|
19
19
|
Hyperion::Util.guard_param(opts, 'an options hash', Hash)
|
20
20
|
|
21
21
|
body = opts[:body]
|
22
|
+
headers = opts[:headers] || {}
|
22
23
|
additional_handler_hash = opts[:also_handle] || {}
|
23
24
|
render = opts[:render] || Proc.identity
|
24
25
|
project = project || Proc.identity
|
25
26
|
|
26
|
-
Hyperion.request(route, body) do |result|
|
27
|
+
Hyperion.request(route, body, headers) do |result|
|
27
28
|
all_handlers = [hash_handler(additional_handler_hash),
|
28
29
|
handler_from_including_class,
|
29
30
|
built_in_handler(project, render)]
|
data/spec/lib/superion_spec.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
require 'hyperion_test'
|
3
3
|
|
4
|
+
# TODO: rename this file to something appropriate. superion became Hyperion::Requestor
|
5
|
+
|
4
6
|
class ClassWithHyperionHandlers
|
5
7
|
include Hyperion::Requestor
|
6
8
|
|
@@ -37,6 +39,13 @@ describe Hyperion::Requestor do
|
|
37
39
|
assert_result({'a' => 'b'})
|
38
40
|
end
|
39
41
|
|
42
|
+
it 'makes requests with additional headers' do
|
43
|
+
headers = {'X-my-header' => 'value'}
|
44
|
+
arrange(:get, {'a' => 'b'})
|
45
|
+
expect(Hyperion).to receive(:request).with(@route, nil, headers)
|
46
|
+
@result = request(@route, headers: headers)
|
47
|
+
end
|
48
|
+
|
40
49
|
it 'makes requests with payload bodies' do
|
41
50
|
arrange(:put, {'a' => 'b'})
|
42
51
|
@result = request(@route, body: {'the' => 'body'})
|
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.4
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|