orchparty 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f89243d6fae72722e405faaebd5474333b809fe7
4
- data.tar.gz: f91105683995435802fd753a8898e70dc5ecc280
3
+ metadata.gz: d0658e519783142f1e2400bb52fef05cc610197d
4
+ data.tar.gz: ff53d6024885289562d0e6358963c86894096075
5
5
  SHA512:
6
- metadata.gz: 817fbaaa5bfed13ca75119641c50f30c59acfeb96d4570628595406bec6d2b1932ca8f45d960034954132d8f889e52b65befe96c601534e974d6aa6ee18f9d77
7
- data.tar.gz: c9d8e7430128f01d17623e509ad5896892a6a2105fec115f1a84f4f6d2853307e6547aa85c87a6986ca5e372500799a79a1d0d566248914fc702629e70bc9729
6
+ metadata.gz: c3d992b77c8fbd7179610d7757e756977a949b957068452cd2dbee0e48dc604533a1926fd23c6c8c1fb8e825d8ae839f2628f32331529bd8cd204b97a726fa99
7
+ data.tar.gz: 18d0691bbc8f99ab0862c6d83eaef60a96b63a7b614c9db9d78ce6765d9f35a452b6c083f6be10edc3045bd217aa114ded9da4020bca2d24b274ade172b8586e
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Orchparty
2
2
 
3
3
  [![Build Status](https://travis-ci.org/jannishuebl/orchparty.svg?branch=master)](https://travis-ci.org/jannishuebl/orchparty)
4
+ [![Gem Version](https://badge.fury.io/rb/orchparty.svg)](https://badge.fury.io/rb/orchparty)
4
5
 
5
6
  Write your orchestration configuration with a Ruby DSL that allows you to have mixins, imports and variables.
6
7
 
@@ -18,18 +18,31 @@ module Orchparty
18
18
  def transform_application(application, ast)
19
19
  application.services = application.services.transform_values! do |service|
20
20
  current = AST::Service.new
21
- service.delete(:_mix).each do |mixin|
22
- if mixin.include? "."
23
- mixin_name, mixin_service_name = mixin.split(".")
24
- current = current.deep_merge_concat(ast.mixins[mixin_name].services[mixin_service_name])
25
- else
26
- current = current.deep_merge_concat(application.mixins[mixin])
27
- end
21
+ service.delete(:_mix).each do |mix|
22
+ mixin = transform_mixin(resolve_mixin(mix, application, ast), application, ast)
23
+ current = current.deep_merge_concat(mixin)
28
24
  end
29
25
  current.deep_merge_concat(service)
30
26
  end
31
27
  application
32
28
  end
29
+
30
+ def resolve_mixin(mix, application, ast)
31
+ if mix.include? "."
32
+ mixin_name, mixin_service_name = mix.split(".")
33
+ ast.mixins[mixin_name].services[mixin_service_name]
34
+ else
35
+ application.mixins[mix]
36
+ end
37
+ end
38
+
39
+ def transform_mixin(mixin, application, ast)
40
+ current = AST::Service.new
41
+ mixin[:_mix].each do |mix|
42
+ current = current.deep_merge_concat(resolve_mixin(mix, application, ast))
43
+ end
44
+ current.deep_merge_concat(mixin)
45
+ end
33
46
  end
34
47
  end
35
48
  end
@@ -1,3 +1,3 @@
1
1
  module Orchparty
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Huebl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-26 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie