power_stencil 0.9.1 → 0.9.2

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: f8ef665f1ce87e962192d7725c2dbd851759bc00
4
- data.tar.gz: 65d6b440a419dddc9a3f0c46c2b7c80db9d78d90
3
+ metadata.gz: 26cb59d7fdc8d324704956de580c938d9fb22f80
4
+ data.tar.gz: 0ad6c0e26e6e47bbd7d37959f09e389056bd9094
5
5
  SHA512:
6
- metadata.gz: 8e39368e94c8710dba97db574916017d9a30ce45468d5674787daef4f2ad915af8dba03235d60988a2f887a96020f151dabccd160b32baef0d4421a576339284
7
- data.tar.gz: 7a7ba9f93020d3d92954ef997d46d5724ff11e79deec6270e1a283009faf00df56762435532aa8762dbad93ea062af4931b21fb76941fa04ec59cc0b141de69d
6
+ metadata.gz: 7391eacdb19ef569ba482275c91f0d6cb048ad58a77de8f177fa6068577f1ba72ac83db11e56fa61da065de093141f50c62755cbe74104fc6e471e12fcd47512
7
+ data.tar.gz: 228e549dbc115c384b01e8b7d1f24398d3c833e10754a202d6e72d491e00d12d01b8c442fe897b827217d32015efdd9b41aa60fad9f7231eab256c3988c7171e
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.idea/
10
+ # rspec failure tracking
11
+ .rspec_status
@@ -0,0 +1,11 @@
1
+ image: "ruby:2.3"
2
+
3
+ before_script:
4
+ - gem install bundler --no-document
5
+ - bundle install --jobs $(nproc) "${FLAGS[@]}"
6
+ - git config --global user.email "noone@nowhere.org"
7
+ - git config --global user.name "Testman"
8
+
9
+ rspec:
10
+ script:
11
+ - bundle exec rspec
@@ -11,6 +11,8 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{<%= plugin_name %> is a plugin for the PowerStencil framework.}
13
13
  spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ # For official plugins
15
+ # spec.homepage = "https://powerstencil.brizone.org/#plugins"
14
16
  spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
17
  spec.license = 'MIT'
16
18
 
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ /.idea/
10
10
  # rspec failure tracking
11
11
  .rspec_status
@@ -0,0 +1,11 @@
1
+ image: "ruby:2.3"
2
+
3
+ before_script:
4
+ - gem install bundler --no-document
5
+ - bundle install --jobs $(nproc) "${FLAGS[@]}"
6
+ - git config --global user.email "noone@nowhere.org"
7
+ - git config --global user.name "Testman"
8
+
9
+ rspec:
10
+ script:
11
+ - bundle exec rspec
@@ -11,6 +11,8 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{<%= plugin_name %> is a plugin for the PowerStencil framework.}
13
13
  spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ # For official plugins
15
+ # spec.homepage = "https://powerstencil.brizone.org/#plugins"
14
16
  spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
17
  spec.license = 'MIT'
16
18
 
@@ -17,8 +17,17 @@ module PowerStencil
17
17
  unless config[:property].nil?
18
18
  config[:property].each do |property_def|
19
19
  if md = property_def.match(/^\s*(?<prop_name>[^:=]+)\s*[:=]\s*(?<prop_val>.*)\s*$/)
20
- logger.debug "Using extra properties from command line '#{md['prop_name']}' = '#{md['prop_val']}'"
21
- entity_as_hash[md['prop_name'].to_sym] = md['prop_val']
20
+ property_value = md['prop_val']
21
+ logger.debug "Using extra properties from command line '#{md['prop_name']}' = '#{property_value}'"
22
+ if pmd = property_value.match(/^\s*!entity\s+(?<entity_type>[^\/]+)\/(?<entity_name>.*)\s*$/)
23
+ type = pmd['entity_type'].to_sym
24
+ name = pmd['entity_name']
25
+ referenced_entity = project.engine.entity(type, name)
26
+ property_value = referenced_entity.to_reference unless referenced_entity.nil?
27
+ puts_and_logs "Could not find entity '#{type.to_s}/#{name}' !", logs_as: :error, check_verbose: false if referenced_entity.nil?
28
+ end
29
+
30
+ entity_as_hash[md['prop_name'].to_sym] = property_value
22
31
  else
23
32
  raise PowerStencil::Error, "Invalid command line property definition: '#{property_def}'"
24
33
  end
@@ -35,6 +44,8 @@ module PowerStencil
35
44
  new_entity = edit_before_save new_entity
36
45
  end
37
46
 
47
+ new_entity.resolve_fields_references!
48
+
38
49
  new_entity.valid? raise_error: true
39
50
  project.track_action_with_git("Created '#{new_entity.as_path}' (and potential dependencies).") do
40
51
  new_entity.save
@@ -63,7 +74,6 @@ module PowerStencil
63
74
  modifications_valid? modified_path, entity
64
75
  end
65
76
  project.engine.root_universe.replace entity, modified_entity
66
- modified_entity.resolve_fields_references!
67
77
  modified_entity
68
78
  end
69
79
 
@@ -1,3 +1,3 @@
1
1
  module PowerStencil
2
- VERSION = '0.9.1'.freeze
2
+ VERSION = '0.9.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: power_stencil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Briais
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-11 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -168,6 +168,8 @@ files:
168
168
  - doc/plugins.md
169
169
  - doc/templates.md
170
170
  - etc/base_commands_definition.yml
171
+ - etc/meta_templates/plugin_seed/.gitignore
172
+ - etc/meta_templates/plugin_seed/.gitlab-ci.yml
171
173
  - etc/meta_templates/plugin_seed/README.md
172
174
  - etc/meta_templates/plugin_seed/etc/command_line.yaml
173
175
  - etc/meta_templates/plugin_seed/etc/plugin_capabilities.yaml
@@ -188,6 +190,7 @@ files:
188
190
  - etc/meta_templates/plugin_seed/spec/{entity}_spec.rb
189
191
  - etc/power_stencil.yaml
190
192
  - etc/templates/plugin_definition/.gitignore
193
+ - etc/templates/plugin_definition/.gitlab-ci.yml
191
194
  - etc/templates/plugin_definition/.rspec
192
195
  - etc/templates/plugin_definition/.travis.yml
193
196
  - etc/templates/plugin_definition/CODE_OF_CONDUCT.md
@@ -323,7 +326,7 @@ metadata:
323
326
  documentation_uri: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md
324
327
  source_code_uri: https://gitlab.com/tools4devops/power_stencil
325
328
  homepage_uri: https://powerstencil.brizone.org/
326
- post_install_message: "\nThank you for installing PowerStencil 0.9.1 !\nFrom the command
329
+ post_install_message: "\nThank you for installing PowerStencil 0.9.2 !\nFrom the command
327
330
  line you can run `power_stencil --help`\nIf your shell is not completing the command:\n
328
331
  \ If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nOfficial Website
329
332
  \ : https://powerstencil.brizone.org/\nFull documentation here : https://gitlab.com/tools4devops/power_stencil/blob/master/README.md\nFeel