alephant 0.1.2-java → 0.1.3-java

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: 9b1da928aad5de8cf8dd8b35e18dc0bd0ade980b
4
- data.tar.gz: cc8bb2abf9b9626eef58d1e9ca5ea60f76f20db9
3
+ metadata.gz: e72700e6917515c80a087583d03959aa71164f7e
4
+ data.tar.gz: 620ee389c45aceac3fdfdaafe13aebc235a01c1e
5
5
  SHA512:
6
- metadata.gz: 67eaebb9049850eb6a770c32044964a8a0dd6919fb462fa8ecde3b0fb88cc410fc23381eef25558061911809634f9520df3b9a2cd9ca48119bf06f92db8930d9
7
- data.tar.gz: a7bc6d12dcbaa367ac5ef5b83bdd189d645acd01ed6fe4d488da32b83724e36e1767467db1b37e68ce6cb3c83f7622af300b825ffe01a6babe974e41782a28bf
6
+ metadata.gz: 4f0ba3cbc62f8b7b70ebe4a9684d629151613da876bdfe990cf528ad036ad72c4c4bf41b1aab56d22ad675f3d50b06b61e02785c2992fb33346871c4233ba081
7
+ data.tar.gz: 65d6cda5eb86d37e454265ad98a0c8e450f5023696a4c79bc3afb47d06e43421961e0dcea8ccc38e60a1b515be8e7cf02db7e9f3ca1be5d60597d48fb9f9b9de
data/alephant.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.add_runtime_dependency 'mustache', '>= 0.99.5'
37
37
  s.add_runtime_dependency 'jsonpath'
38
38
 
39
+ s.add_runtime_dependency 'crimp'
39
40
  s.add_runtime_dependency 'alephant-sequencer'
40
41
  s.add_runtime_dependency 'alephant-logger'
41
42
  s.add_runtime_dependency 'alephant-cache'
@@ -1,4 +1,5 @@
1
1
  require 'alephant/models/jsonpath_lookup'
2
+ require 'crimp'
2
3
 
3
4
  module Alephant
4
5
  class Writer
@@ -21,12 +22,18 @@ module Alephant
21
22
 
22
23
  def write(data, version = nil)
23
24
  mapper.generate(data).each do |id, r|
24
- store(id, r.render, location_for(id, version), data[:options])
25
+ store(id, r.render, data[:options], version)
25
26
  end
26
27
  end
27
28
 
28
29
  private
29
- def store(id, content, location, options)
30
+ def store(id, content, options, version)
31
+ location = location_for(
32
+ id,
33
+ Crimp.signature(options),
34
+ version
35
+ )
36
+
30
37
  cache.put(location, content)
31
38
  lookup(id).write(options, location)
32
39
  end
@@ -35,8 +42,8 @@ module Alephant
35
42
  Lookup.create(@lookup_table_name, component_id)
36
43
  end
37
44
 
38
- def location_for(component_id, version = nil)
39
- base_name = "#{@renderer_id}/#{component_id}"
45
+ def location_for(component_id, options_hash, version = nil)
46
+ base_name = "#{@renderer_id}/#{component_id}/#{options_hash}"
40
47
  version ? "#{base_name}/#{version}" : base_name
41
48
  end
42
49
 
@@ -1,3 +1,3 @@
1
1
  module Alephant
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/spec/writer_spec.rb CHANGED
@@ -35,7 +35,7 @@ describe Alephant::Writer do
35
35
  .stub(:initialize)
36
36
  Alephant::Lookup::Lookup.any_instance
37
37
  .should_receive(:write)
38
- .with(options, 'renderer_id/component_id/0')
38
+ .with(options, 'renderer_id/component_id/42de5e5c6f74b9fe4d956704a6d9e1c7/0')
39
39
 
40
40
  subject.write(data, 0)
41
41
  end
@@ -44,7 +44,7 @@ describe Alephant::Writer do
44
44
  Alephant::Lookup::Lookup.any_instance.stub(:initialize)
45
45
  Alephant::Lookup::Lookup.any_instance.stub(:write)
46
46
  Alephant::Cache.any_instance
47
- .should_receive(:put).with('renderer_id/component_id/0', 'content')
47
+ .should_receive(:put).with('renderer_id/component_id/35589a1cc0b3ca90fc52d0e711c0c434/0', 'content')
48
48
 
49
49
  subject.write({}, 0)
50
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Kenny
@@ -206,6 +206,20 @@ dependencies:
206
206
  version: '0'
207
207
  prerelease: false
208
208
  type: :runtime
209
+ - !ruby/object:Gem::Dependency
210
+ name: crimp
211
+ version_requirements: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - '>='
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ requirement: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - '>='
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ prerelease: false
222
+ type: :runtime
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: alephant-sequencer
211
225
  version_requirements: !ruby/object:Gem::Requirement