dapp 0.5.5 → 0.5.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 736bd0b9c90721b086654095099165858735d7b7
4
- data.tar.gz: b35661d57687c80f77b802895e1b1266c03e0604
3
+ metadata.gz: ae5353ff9630589b96b901a1a154bd340bc54866
4
+ data.tar.gz: de780b94214808fe3d156d07d2563efd5dbb5bbd
5
5
  SHA512:
6
- metadata.gz: 46ccabca9ea0395b300257d38b010e9b0f00a158a403f8142b4c53c25c643520d88c2d080c6ea0d30f3b01e91136f4dfd304685cbd04ba81b71f942c8ba69d6c
7
- data.tar.gz: 4009d71698dddb250b37bc0d14dccbd2632bcc28a207920aed6520b3830f5054f9f61474e21a4741ee26a31ec871beacf08b28e5588bfe3469ad09aeefdefaf0
6
+ metadata.gz: 6852b64b7e5001053136398325d8af8120925505b4610c4b65a5a61553ca9f81088075926879c5919169c109d3a54dc0126943f0f9c5d7795ca6ce1168c03fad
7
+ data.tar.gz: 9eef518c4c08935d9907488f4c0b784db6fe9736b9b587ad0b5ca9c8a1194f152d67b716db54174659da32a951cc20f299b621fc599060bb570f4b5e89f3c036
@@ -208,14 +208,14 @@ module Dapp
208
208
 
209
209
  # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
210
210
  def install_stage_cookbooks(stage)
211
- common_paths = proc do |cookbook_path|
212
- [['metadata.json', 'metadata.json'],
213
- ['attributes/common', 'attributes'],
214
- ["attributes/#{stage}", 'attributes'],
215
- ["files/#{stage}", 'files/default'],
216
- ["templates/#{stage}", 'templates/default']].select { |from, _| cookbook_path.join(from).exist? }
211
+ select_existing_paths = ->(cookbook_path, paths) do
212
+ paths.select { |from, _| cookbook_path.join(from).exist? }
217
213
  end
218
214
 
215
+ common_paths = [['metadata.json', 'metadata.json'],
216
+ ["files/#{stage}", 'files/default'],
217
+ ["templates/#{stage}", 'templates/default']]
218
+
219
219
  install_paths = Dir[cookbooks_vendor_path('*')]
220
220
  .map(&Pathname.method(:new))
221
221
  .map do |cookbook_path|
@@ -230,18 +230,30 @@ module Dapp
230
230
  .map { |recipe| ["recipes/#{stage}/#{recipe}.rb", "recipes/#{recipe}.rb"] }
231
231
  .select { |from, _| cookbook_path.join(from).exist? }
232
232
 
233
+ common_project_paths = select_existing_paths.call(
234
+ cookbook_path, [*common_paths,
235
+ ['attributes/common', 'attributes'],
236
+ ["attributes/#{stage}", 'attributes']]
237
+ )
238
+
233
239
  if recipe_paths.any?
234
- [*recipe_paths, *common_paths[cookbook_path]]
240
+ [*recipe_paths, *common_project_paths]
235
241
  else
236
- [nil, *common_paths[cookbook_path]]
242
+ [nil, *common_project_paths]
237
243
  end
238
244
  elsif is_mdapp && mdapp_enabled
239
245
  recipe_path = "recipes/#{stage}.rb"
240
246
 
247
+ common_mdapp_paths = select_existing_paths.call(
248
+ cookbook_path, [*common_paths,
249
+ ['attributes/common.rb', 'attributes/common.rb'],
250
+ ["attributes/#{stage}.rb", "attributes/#{stage}.rb"]]
251
+ )
252
+
241
253
  if cookbook_path.join(recipe_path).exist?
242
- [[recipe_path, recipe_path], *common_paths[cookbook_path]]
254
+ [[recipe_path, recipe_path], *common_mdapp_paths]
243
255
  else
244
- [nil, *common_paths[cookbook_path]]
256
+ [nil, *common_mdapp_paths]
245
257
  end
246
258
  else
247
259
  [['.', '.']]
@@ -252,7 +264,7 @@ module Dapp
252
264
 
253
265
  _stage_cookbooks_path(stage).mkpath
254
266
  install_paths.each do |cookbook_path, paths|
255
- cookbook = cookbook_path.basename
267
+ cookbook = cookbook_path.basename.to_s
256
268
 
257
269
  paths.each do |from, to|
258
270
  if from.nil?
@@ -1,5 +1,5 @@
1
1
  # Version
2
2
  module Dapp
3
- VERSION = '0.5.5'.freeze
3
+ VERSION = '0.5.6'.freeze
4
4
  BUILD_CACHE_VERSION = 3
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout