alephant-broker 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: 9a36a769bdcdf55a7d30a2a03ab526156e30e502
4
- data.tar.gz: 1c90dbea823ff9b130243656d1a7793b655a9ca2
3
+ metadata.gz: 7410ac49baac4bf594eabcfde56e669343902682
4
+ data.tar.gz: 1ab7c48a49eb1e41182d4968c9cfe14a736032ce
5
5
  SHA512:
6
- metadata.gz: ffbc90911c6f6ae85b4abe80698502df8ef6566e49ed6ccc39be0c87966e724837fbad3dd9bcd8f885bc1e8f3cd042809d3131add28668d750eecd2b61dbd5b5
7
- data.tar.gz: a246df510ef5152a13576f7e087506fce3cca76b86051bbc29a7d7c1e87cb2b723f86df28a1055ef49937b1738004c8f29a89ae0e6951bae6494948b61f1d489
6
+ metadata.gz: 197a8602b01a878fd66154c23e4a783f4cc1fc7603c351ac016a55d6df5b9ab87bc07a12ece82a7dbeda6c0ab3f25f76912ce0e2befed2a730525f8bad39e251
7
+ data.tar.gz: a5f6f485240d886380682631df0b558377a46b8d65838b87d9c4aa5216d4b5cb39bfb3cf2a2d483b51648585ddc5683d956c3aa74a9d0e609972031d46e476be
@@ -23,12 +23,14 @@ module Alephant
23
23
 
24
24
  def json
25
25
  get_components.peach do |component|
26
+ thread_local_request = @request.clone
27
+
26
28
  id = component['component']
27
29
  options = set_keys_to_symbols component.fetch('options', {})
28
30
 
29
- @request.set_component(id, options)
31
+ thread_local_request.set_component(id, options)
30
32
 
31
- asset = AssetResponse.new(@request, @config)
33
+ asset = AssetResponse.new(thread_local_request, @config)
32
34
  component.store('status', asset.status)
33
35
  component.store('body', asset.content) if valid_status_for asset
34
36
  end
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Broker
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ describe Alephant::Broker::BatchResponse do
24
24
  { 'component' => 'foo1', 'options' => { 'variant' => 'bar1' } },
25
25
  { 'component' => 'foo2', 'options' => { 'variant' => 'bar2' } }
26
26
  ]}
27
- )
27
+ ).as_null_object
28
28
  }
29
29
 
30
30
  before do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Alephant::Broker::ResponseFactory do
4
4
  describe "#response_from(request)" do
5
5
  let (:request) { double("Alephant::Broker::Request") }
6
- let (:post_request) { double("Alephant::Broker::PostRequest") }
6
+ let (:post_request) { double("Alephant::Broker::PostRequest").as_null_object }
7
7
 
8
8
  it "should return asset response" do
9
9
  instance = Alephant::Broker::ResponseFactory.new({})
@@ -34,7 +34,6 @@ describe Alephant::Broker::ResponseFactory do
34
34
  Alephant::Broker::AssetResponse
35
35
  .any_instance
36
36
  .stub(:initialize)
37
- .with(post_request, {})
38
37
 
39
38
  expect(instance.response_from(post_request))
40
39
  .to be_a Alephant::Broker::BatchResponse
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-broker
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
  - Steven Jack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec