chef_cached_app_info 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef_cached_app_info.rb +4 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0aea94c12a4de9089ba50e77ad2a0930f02dff78933669b2b49f50c1e70d905
4
- data.tar.gz: 9fb8f71bccb06b1d4c5803f27b2ccf665c58baeb97cfe0709502c73ebb73c1d3
3
+ metadata.gz: b0c4a142716d9ffc765f92c86f2ba043f4b2c2e213b3365248ca408e7087b8b4
4
+ data.tar.gz: a4d1cd2354426832f79038ddb01c8aefb0cdb71903ba41637c675599919e61c0
5
5
  SHA512:
6
- metadata.gz: 7be57ef00f6f08981fde0005befe2beb56122635337722afa3d91252cb6c4c1e128f7aad3ac860bf4c787f4f4913980810c5fec294d37faaff1e380f58235dad
7
- data.tar.gz: 6e3045f2f67d1762b2f3170d02dda0e42d7e6f92baab362a5a26382665faa1cb4b65f93bb763c0cbaa9bff1fba4ebdb3d979fba5490a133f826473073feb22a3
6
+ metadata.gz: 889351e3467e2e6523e3aa5bd8788f4c4fa668ed44e4b23b90e7420e36c1926ee927b2c0e8a5fea3f11f268f1acca59c2a422864502cb79ed774b3fce867f55b
7
+ data.tar.gz: c686b4f7b0eabeb2265e017cab25433f5ea353a8592e40719cddc363f8eace88c179f7cef71e4111164dc12009e12edf53f1b9bd1a8e7f8b66a2a8ccf4bca43e
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
 
3
+ # Provides a common interface for caching and accessing cached cookbook data
3
4
  class AppCache
4
5
  def self.for(cookbook_path, cache_file = nil)
5
6
  AppCache.new(cookbook_path, cache_file)
@@ -12,12 +13,12 @@ class AppCache
12
13
 
13
14
  def cache_versions(origin_file)
14
15
  cached_app_info('app_version', origin_file)
15
- cached_app_info('cookbook_version', origin_file, lambda { |x| x.gsub(/[^0-9.]/i, '') })
16
+ cached_app_info('cookbook_version', origin_file, ->(x) { x.gsub(/[^0-9.]/i, '') })
16
17
  end
17
18
 
18
- def cached_app_info(key, origin_file = nil, content_lambda = lambda { |x| x })
19
+ def cached_app_info(key, origin_file = nil, content_lambda = ->(x) { x })
19
20
  # Cache the original piece of info generated when building the app, so we have it when the app & infra are separated.
20
- write_info(key, content_lambda.call(IO.read(origin_file).strip)) if origin_file != nil && File.exist?(origin_file)
21
+ write_info(key, content_lambda.call(IO.read(origin_file).strip)) if !origin_file.nil? && File.exist?(origin_file)
21
22
  # Cached version must always exist
22
23
  value = cached_app_info_object[key]
23
24
  raise "The cached app information stored by #{key} could not be found." if value.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_cached_app_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - foxfire206