chef_data_region 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/lib/chef/data_region.rb +9 -8
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5e9f06ec25d60c83e3d30b3a729b18ff52c4466
|
4
|
+
data.tar.gz: 2048067a46f9b4c0260c565c98f67e0757db264e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6466cc6c4580b1a57ef5586feda01988f1848f69e6db32186be5a7de58962fa7b76351aca5173b9854b45d9f447a9e74726665264bc9067015c5fe53e1ba1c7
|
7
|
+
data.tar.gz: e16a8028a06bbf3da1d35d1537746a827ca7f4cde35e786e7b33748ae5029e236caf1769f23d1f8f736f8e7cd064dc21debdbf5aa4143fac37c882a5183d6b8a
|
data/lib/chef/data_region.rb
CHANGED
@@ -7,7 +7,7 @@ class Chef
|
|
7
7
|
# DataRegion class
|
8
8
|
class DataRegion
|
9
9
|
NAME = 'chef_data_region'.freeze
|
10
|
-
VERSION = '1.0.
|
10
|
+
VERSION = '1.0.4'.freeze
|
11
11
|
|
12
12
|
# This class variable maps data bags to expansion patterns
|
13
13
|
@bags = {}
|
@@ -72,13 +72,14 @@ class Chef
|
|
72
72
|
# @return [String] the expanded bag name
|
73
73
|
def expand_bag_name(bag_name)
|
74
74
|
if bags.include?(bag_name)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
75
|
+
lambda do |definition|
|
76
|
+
format(
|
77
|
+
definition[:pattern],
|
78
|
+
attribute: definition[:attribute].reduce(node) do |hash, index|
|
79
|
+
hash.fetch(index)
|
80
|
+
end
|
81
|
+
)
|
82
|
+
end.call(Chef::DataRegion.bags.fetch(bag_name))
|
82
83
|
else
|
83
84
|
bag_name
|
84
85
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_data_region
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Someone
|
@@ -53,7 +53,13 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '11'
|
55
55
|
description: |
|
56
|
-
# Chef Data Region
|
56
|
+
# Chef Data Region
|
57
|
+
|
58
|
+
## Description
|
59
|
+
|
60
|
+
Chef Data Region extends the `Chef::DSL::DataQuery` module's
|
61
|
+
`data_bag_item` method with the ability to dynamically expand the data
|
62
|
+
bag name in a configurable, environment-specific manner.
|
57
63
|
|
58
64
|
## Motivation
|
59
65
|
|