api-blueprint 0.3.0 → 0.4.0

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: 690bfec6246875178ddab86cb4b39c78543a689c
4
- data.tar.gz: ea236a3bdd43e5ab463573d072f43d6bca9751a8
3
+ metadata.gz: df6ecb25a5ab69c7b15ca05cc4e4c529f7758fbf
4
+ data.tar.gz: dedd52941d8666ee9e2ca1cb95f357c72815e47a
5
5
  SHA512:
6
- metadata.gz: c9f5f9c9bba8fe2d8081cc2fbea82d8e8bb3e9fc48d6a720d1df88ec424fb3e5e70a4462e2a2d2d60ca41b97fdbd5725cc8cdcdbe41479bbd484ac0d67dbf620
7
- data.tar.gz: f7b52ca2dac76e595625a3e4aec9e9ed68a9cf8f144c7979ae699e8a832e9e32380fdda2935ef6b0d1e43f46836d0eb09213599cfa155a699419e08db0166df5
6
+ metadata.gz: de025ec5d1d92bb6cc9a182cdedccf4f11fc2eef8c19e92dd81475dd7f4220bff4f5cbd7866a1d70209da013b21752c71ab9bc0b9ae75fd49bc74179ea0b327d
7
+ data.tar.gz: 3eb72f7030802241df6fc5dcd4704a55dafb165b6adc46edd9f2bec2af35c2f472a2b5dfe2ea62939de0a7c22fd176abbdf36e0562c8f9020431622f1ab20b18
@@ -16,10 +16,10 @@ module ApiBlueprint
16
16
  data
17
17
  end
18
18
 
19
- def generate_cache_key(options)
19
+ def generate_cache_key(klass, options)
20
20
  options = options.clone.except :body
21
21
  options_digest = Digest::MD5.hexdigest Marshal::dump(options.to_s.chars.sort.join)
22
- "#{key}:#{options_digest}"
22
+ "#{key}:#{klass&.name}:#{options_digest}"
23
23
  end
24
24
 
25
25
  end
@@ -25,13 +25,13 @@ module ApiBlueprint
25
25
  request_options = blueprint.all_request_options(runner_options)
26
26
 
27
27
  if cache.present?
28
- cache_key = cache.generate_cache_key request_options
28
+ cache_key = cache.generate_cache_key blueprint.creates, request_options
29
29
  return cache.read cache_key if cache.exist? cache_key
30
30
  end
31
31
 
32
32
  blueprint.run(runner_options, self).tap do |result|
33
33
  if cache.present?
34
- cache_key = cache.generate_cache_key request_options
34
+ cache_key = cache.generate_cache_key blueprint.creates, request_options
35
35
  cache.write cache_key, result, cache_options
36
36
  end
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module ApiBlueprint
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-blueprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Timewell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types