alephant-broker 2.1.1 → 2.1.2

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: c8260c3c562810f056f45d46d56a3d5456cf10ab
4
- data.tar.gz: b2d1e13aaf854e7c1b9ed76c0a8505d49bbc191c
3
+ metadata.gz: f12734f8ff334701dc9ab031b722e83b49bb937f
4
+ data.tar.gz: 89deb426d6b78a0ca792e3d66b27297ac166e0f3
5
5
  SHA512:
6
- metadata.gz: f73fff98e5832614f68af4473ec6d6b05faa2a346cc5de5e51c60784c09d4dbbf8cbf267b8152a6686ba82d3d948d19e4239ef6a8d555efc574c8300ad95c1bf
7
- data.tar.gz: 484cefb4a13f492438d7eab51c5bf9bf5a7603a46695846c1bb8187a8ca0bb8ff80464a14b5ff55f1dddc61ad226faab974198080c221f489125c35224ab8378
6
+ metadata.gz: 49f5c189eeb36135dab3df043f108f8352a9b403fc3c5cc109640814b231767afec33f6ca36e5dfaff520cc91b33b069716e703babca7477b6ae92afd42fd01d
7
+ data.tar.gz: 374f100401f6c9dc9cfafaff6220644b9bfd07b68139b6943f42c30c9fb2cc37bbe13b7ad06a4269994752ac114d44460cd42a8c9a963b463eab5594d7bc4176
@@ -7,7 +7,7 @@ module Alephant
7
7
  def initialize(id, batch_id, options)
8
8
  @id = id
9
9
  @batch_id = batch_id
10
- @options = options
10
+ @options = convert_keys(options || {})
11
11
  @cached = true
12
12
  end
13
13
 
@@ -31,6 +31,10 @@ module Alephant
31
31
 
32
32
  private
33
33
 
34
+ def convert_keys(hash)
35
+ Hash[ hash.map { |k, v| [k.to_sym, v] } ]
36
+ end
37
+
34
38
  def component_key
35
39
  "#{id}/#{opts_hash}"
36
40
  end
@@ -36,15 +36,11 @@ module Alephant
36
36
  end
37
37
 
38
38
  def options
39
- convert_keys Rack::Utils.parse_nested_query(query)
39
+ Rack::Utils.parse_nested_query query
40
40
  end
41
41
 
42
42
  private
43
43
 
44
- def convert_keys(hash)
45
- Hash[ hash.map { |k, v| [k.to_sym, v] } ]
46
- end
47
-
48
44
  def rack_input
49
45
  (settings['rack.input'].read).tap { settings['rack.input'].rewind }
50
46
  end
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Broker
3
- VERSION = "2.1.1"
3
+ VERSION = "2.1.2"
4
4
  end
5
5
  end
@@ -1,12 +1,14 @@
1
1
  require_relative 'spec_helper'
2
2
 
3
- describe Alephant::Broker::Environment do
4
- subject { described_class.new env }
5
- let(:env) do
3
+ describe Alephant::Broker::ComponentMeta do
4
+ let(:id) { "foo" }
5
+ let(:batch_id) { "bar" }
6
+ let(:options) do
6
7
  {
7
- 'QUERY_STRING' => 'variant=K03000001'
8
+ 'variant' => 'K03000001'
8
9
  }
9
10
  end
11
+ subject { described_class.new(id, batch_id, options) }
10
12
 
11
13
  describe '#options' do
12
14
  let(:expected) do
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: 2.1.1
4
+ version: 2.1.2
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-11-04 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -317,7 +317,7 @@ files:
317
317
  - lib/alephant/broker/response/factory.rb
318
318
  - lib/alephant/broker/response/multi.rb
319
319
  - lib/alephant/broker/version.rb
320
- - spec/environment_spec.rb
320
+ - spec/component_meta_spec.rb
321
321
  - spec/fixtures/json/batch.json
322
322
  - spec/fixtures/json/batch_compiled.json
323
323
  - spec/http_spec.rb
@@ -349,7 +349,7 @@ signing_key:
349
349
  specification_version: 4
350
350
  summary: Brokers requests for alephant components
351
351
  test_files:
352
- - spec/environment_spec.rb
352
+ - spec/component_meta_spec.rb
353
353
  - spec/fixtures/json/batch.json
354
354
  - spec/fixtures/json/batch_compiled.json
355
355
  - spec/http_spec.rb