power_stencil 0.6.1 → 0.6.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 +4 -4
- data/doc/builds.md +10 -1
- data/doc/entities.md +51 -42
- data/doc/plugins.md +1 -0
- data/doc/templates.md +1 -0
- data/lib/power_stencil/command_processors/build.rb +15 -2
- data/lib/power_stencil/command_processors/check.rb +12 -0
- data/lib/power_stencil/command_processors/plugin.rb +3 -3
- data/lib/power_stencil/engine/entities_definitions.rb +16 -7
- data/lib/power_stencil/engine/project_engine.rb +1 -1
- data/lib/power_stencil/initializer.rb +4 -0
- data/lib/power_stencil/plugins/entity_definitions.rb +15 -0
- data/lib/power_stencil/plugins/require.rb +1 -0
- data/lib/power_stencil/project/base.rb +4 -0
- data/lib/power_stencil/project/info.rb +14 -1
- data/lib/power_stencil/system_entity_definitions/all.rb +1 -0
- data/lib/power_stencil/system_entity_definitions/entity_override.rb +1 -0
- data/lib/power_stencil/system_entity_definitions/entity_project_common.rb +1 -1
- data/lib/power_stencil/system_entity_definitions/project_entity.rb +1 -0
- data/lib/power_stencil/system_entity_definitions/simple_exec.rb +1 -1
- data/lib/power_stencil/system_entity_definitions/source_provider.rb +15 -0
- data/lib/power_stencil/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab896eb3e63889b7f9a855ee1ae4a740fdafc73
|
4
|
+
data.tar.gz: cf42d440b67e74edcba8d9569fafc3d04d877757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 810213cbbb8dc1d9913031da7a90c77e9c2a7f2a453e5492bc051857ca33b9f8087f0d171991ae1d9a2ae147bead8dd25e3767dc81c6af9f5d0508e72918b992
|
7
|
+
data.tar.gz: a564943c393aac1c084afa0f8c8d0685cb7c0be204ed35545b622fe0b90d13fa82b329ef266ba5481ba18865daedcf595c64ef95f6d5993afaf2dbda257eff1e
|
data/doc/builds.md
CHANGED
@@ -20,6 +20,15 @@ Builds
|
|
20
20
|
|
21
21
|
You build a [buildable] entity by issuing `power_stencil build <entity_type>/<entity_name>`. If you try to build an entity which is not buildable, the process fail with an error message.
|
22
22
|
|
23
|
+
**:information_source: You can get the list of buildable entities in your repository by issuing a `power_stencil build --list`:**
|
24
|
+
|
25
|
+
```
|
26
|
+
$ power_stencil build --list
|
27
|
+
- 'simple_exec' (buildable by 'PowerStencil core' and provided by 'PowerStencil core').
|
28
|
+
```
|
29
|
+
|
30
|
+
We will see later in the [templates] part what to do with this `simple_exec` entity type.
|
31
|
+
|
23
32
|
Let's describe a bit more in detail what this build process is:
|
24
33
|
|
25
34
|
![entity-build-flow]
|
@@ -32,7 +41,7 @@ I guess you understood this is not a "real" _compilation_ process we are discuss
|
|
32
41
|
|
33
42
|
The mechanism of the compilation is coming from the [universe_compiler] Gem, but the two following features are the ones you really need to understand.
|
34
43
|
|
35
|
-
:information_source: The compilation process
|
44
|
+
:information_source: The compilation process is actually applied to all entities, ie it doesn't need to be [buildable] (see in next paragraph how to run the compilation). But an entity needs to be [buildable] to use `power_stencil build` which corresponds actually to _compilation_ + _detemplatization_.
|
36
45
|
|
37
46
|
## Extending an entity
|
38
47
|
|
data/doc/entities.md
CHANGED
@@ -58,8 +58,8 @@ $ power_stencil info
|
|
58
58
|
PROJECT REPORT
|
59
59
|
--------------------------------------------------------------------------------
|
60
60
|
General information:
|
61
|
-
- Project required version: 0.
|
62
|
-
- PowerStencil version: 0.
|
61
|
+
- Project required version: 0.6.1
|
62
|
+
- PowerStencil version: 0.6.1
|
63
63
|
--------------------------------------------------------------------------------
|
64
64
|
Paths:
|
65
65
|
- Project root path: '/tmp/tst2'
|
@@ -75,12 +75,12 @@ PROJECT REPORT
|
|
75
75
|
- project_config: 1
|
76
76
|
--------------------------------------------------------------------------------
|
77
77
|
Available entity types:
|
78
|
-
- Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity
|
79
|
-
- Type 'entity_override' --> UniverseCompiler::Entity::Override
|
80
|
-
- Type 'plugin_definition' --> PowerStencil::SystemEntityDefinitions::Plugin (template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.
|
81
|
-
- Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor
|
82
|
-
- Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig
|
83
|
-
- Type 'simple_exec' --> PowerStencil::SystemEntityDefinitions::SimpleExec (template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.
|
78
|
+
- Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity (provided by 'PowerStencil core')
|
79
|
+
- Type 'entity_override' --> UniverseCompiler::Entity::Override (provided by 'PowerStencil core')
|
80
|
+
- Type 'plugin_definition' --> PowerStencil::SystemEntityDefinitions::Plugin (provided by 'PowerStencil core') template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.6.1/etc/templates/plugin_definition'
|
81
|
+
- Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor (provided by 'PowerStencil core')
|
82
|
+
- Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig (provided by 'PowerStencil core')
|
83
|
+
- Type 'simple_exec' --> PowerStencil::SystemEntityDefinitions::SimpleExec (provided by 'PowerStencil core') template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.6.1/etc/templates/simple_exec'
|
84
84
|
```
|
85
85
|
|
86
86
|
It provides a lot of information about the project, but let's focus on the `Entities` and `Available entity types` parts of the report.
|
@@ -178,20 +178,23 @@ We have seen the `power_stencil info` returns (among other) the number of entiti
|
|
178
178
|
$ power_stencil check
|
179
179
|
RAW ENTITIES
|
180
180
|
'base_entity/my_1st_entity':
|
181
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
182
|
-
-
|
183
|
-
-
|
181
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
182
|
+
- Provided by : 'PowerStencil core'
|
183
|
+
- Status : Valid
|
184
|
+
- Buildable : false
|
184
185
|
'base_entity/my_2nd_entity':
|
185
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml'
|
186
|
-
-
|
187
|
-
-
|
186
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml'
|
187
|
+
- Provided by : 'PowerStencil core'
|
188
|
+
- Status : Valid
|
189
|
+
- Buildable : false
|
188
190
|
'project_config/Project Config':
|
189
|
-
- Storage path: ''
|
190
|
-
-
|
191
|
-
-
|
191
|
+
- Storage path : ''
|
192
|
+
- Provided by : 'PowerStencil core'
|
193
|
+
- Status : Valid
|
194
|
+
- Buildable : false
|
192
195
|
```
|
193
196
|
|
194
|
-
The goal of this command is normally to check the validity of entities, but it brings as well extra information like if the entity is _buildable_ or even where it is stored in the repository.
|
197
|
+
The goal of this command is normally to check the validity of entities, but it brings as well extra information like if the entity is _buildable_ or even where it is stored in the repository or if is provided by the core system (PowerStencil core) or a plugin.
|
195
198
|
|
196
199
|
:information_source: You can notice that the `project_config` entity has no storage path, the reason being [it is not persisted](#default-entity-types) in the entities repository (its content actually comes from config files outside of the repository).
|
197
200
|
|
@@ -203,13 +206,15 @@ By default `power_stencil check` will check all entities in the repository but y
|
|
203
206
|
$ power_stencil check base_entity/my_1st_entity 'project_config/Project Config'
|
204
207
|
RAW ENTITIES
|
205
208
|
'base_entity/my_1st_entity':
|
206
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
207
|
-
-
|
208
|
-
-
|
209
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
210
|
+
- Provided by : 'PowerStencil core'
|
211
|
+
- Status : Valid
|
212
|
+
- Buildable : false
|
209
213
|
'project_config/Project Config':
|
210
|
-
- Storage path: ''
|
211
|
-
-
|
212
|
-
-
|
214
|
+
- Storage path : ''
|
215
|
+
- Provided by : 'PowerStencil core'
|
216
|
+
- Status : Valid
|
217
|
+
- Buildable : false
|
213
218
|
```
|
214
219
|
Another possibility is to check a list of objects using a regular expression (applied to the ID of an entity, ie `<entity_type</<entity_name>`) by using the `--regexp` option:
|
215
220
|
|
@@ -217,13 +222,15 @@ Another possibility is to check a list of objects using a regular expression (ap
|
|
217
222
|
$ power_stencil check base_ --regexp
|
218
223
|
RAW ENTITIES
|
219
224
|
'base_entity/my_1st_entity':
|
220
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
221
|
-
-
|
222
|
-
-
|
225
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml'
|
226
|
+
- Provided by : 'PowerStencil core'
|
227
|
+
- Status : Valid
|
228
|
+
- Buildable : false
|
223
229
|
'base_entity/my_2nd_entity':
|
224
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml'
|
225
|
-
-
|
226
|
-
-
|
230
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml'
|
231
|
+
- Provided by : 'PowerStencil core'
|
232
|
+
- Status : Valid
|
233
|
+
- Buildable : false
|
227
234
|
```
|
228
235
|
|
229
236
|
## Querying and graphing entities
|
@@ -336,9 +343,10 @@ Created 'base_entity/dev_entity'
|
|
336
343
|
$ power_stencil check base_entity/dev_entity
|
337
344
|
RAW ENTITIES
|
338
345
|
'base_entity/dev_entity':
|
339
|
-
- Storage path: '/tmp/tst2/.ps_project/user_entities/base_entity/dev_entity.yaml'
|
340
|
-
-
|
341
|
-
-
|
346
|
+
- Storage path : '/tmp/tst2/.ps_project/user_entities/base_entity/dev_entity.yaml'
|
347
|
+
- Provided by : 'PowerStencil core'
|
348
|
+
- Status : Valid
|
349
|
+
- Buildable : false
|
342
350
|
```
|
343
351
|
You can notice where the YAML file has been created.
|
344
352
|
|
@@ -487,13 +495,13 @@ $ power_stencil info
|
|
487
495
|
.
|
488
496
|
--------------------------------------------------------------------------------
|
489
497
|
Available entity types:
|
490
|
-
- Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity
|
498
|
+
- Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity (provided by 'PowerStencil core')
|
491
499
|
- Type 'custom_entity' --> MyCustomEntity
|
492
|
-
- Type 'entity_override' --> UniverseCompiler::Entity::Override
|
493
|
-
- Type 'plugin_definition' --> PowerStencil::SystemEntityDefinitions::Plugin (template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.
|
494
|
-
- Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor
|
495
|
-
- Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig
|
496
|
-
- Type 'simple_exec' --> PowerStencil::SystemEntityDefinitions::SimpleExec (template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.
|
500
|
+
- Type 'entity_override' --> UniverseCompiler::Entity::Override (provided by 'PowerStencil core')
|
501
|
+
- Type 'plugin_definition' --> PowerStencil::SystemEntityDefinitions::Plugin (provided by 'PowerStencil core') template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.6.1/etc/templates/plugin_definition'
|
502
|
+
- Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor (provided by 'PowerStencil core')
|
503
|
+
- Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig (provided by 'PowerStencil core')
|
504
|
+
- Type 'simple_exec' --> PowerStencil::SystemEntityDefinitions::SimpleExec (provided by 'PowerStencil core') template-template path: '/opt/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/power_stencil-0.6.1/etc/templates/simple_exec'
|
497
505
|
```
|
498
506
|
You see that the `custom_entity` type appeared in the list. Need another proof ?
|
499
507
|
```shell
|
@@ -503,9 +511,10 @@ Created 'custom_entity/my_1st_custom_entity'
|
|
503
511
|
$ power_stencil check cust -r
|
504
512
|
RAW ENTITIES
|
505
513
|
'custom_entity/my_1st_custom_entity':
|
506
|
-
- Storage path: '/tmp/tst2/.ps_project/entities/custom_entity/my_1st_custom_entity.yaml'
|
507
|
-
-
|
508
|
-
-
|
514
|
+
- Storage path : '/tmp/tst2/.ps_project/entities/custom_entity/my_1st_custom_entity.yaml'
|
515
|
+
- Provided by : 'PowerStencil core'
|
516
|
+
- Status : Valid
|
517
|
+
- Buildable : false
|
509
518
|
|
510
519
|
$ power_stencil get custom_entity/my_1st_custom_entity --raw
|
511
520
|
--- !ruby/object:MyCustomEntity
|
data/doc/plugins.md
CHANGED
@@ -206,6 +206,7 @@ we can check using `power_stencil check myplugin_entity/test`:
|
|
206
206
|
$ power_stencil check myplugin_entity/test
|
207
207
|
'myplugin_entity/test':
|
208
208
|
- Storage path : '/tmp/demo/.ps_project/entities/myplugin_entity/test.yaml'
|
209
|
+
- Provided by : plugin 'myplugin'
|
209
210
|
- Templates path : '/tmp/demo/myplugin_entity/test'
|
210
211
|
- Status : Valid
|
211
212
|
- Buildable : true
|
data/doc/templates.md
CHANGED
@@ -43,6 +43,7 @@ $ power_stencil check simple_exec/demo_templates
|
|
43
43
|
RAW ENTITIES
|
44
44
|
'simple_exec/demo_templates':
|
45
45
|
- Storage path : '/tmp/tst3/.ps_project/entities/simple_exec/demo_templates.yaml'
|
46
|
+
- Provided by : 'PowerStencil core'
|
46
47
|
- Templates path : '/tmp/tst3/simple_exec/demo_templates'
|
47
48
|
- Status : Valid
|
48
49
|
- Buildable : true
|
@@ -15,8 +15,21 @@ module PowerStencil
|
|
15
15
|
if config[:'supported-builds']
|
16
16
|
project.engine.available_entities_hash.select do |_, klass|
|
17
17
|
klass.respond_to?(:buildable?) and klass.buildable?
|
18
|
-
end .each do |entity_type,
|
19
|
-
|
18
|
+
end .each do |entity_type, entity_class|
|
19
|
+
builder = entity_class.buildable_by.empty? ? "'#{PowerStencil.name}'" : "plugin '#{entity_class.buildable_by}'"
|
20
|
+
|
21
|
+
source_provider = entity_class.entity_type_source_provider
|
22
|
+
source_provider_display = if source_provider == PowerStencil
|
23
|
+
"'#{source_provider.name}'"
|
24
|
+
elsif source_provider == project
|
25
|
+
"project '#{source_provider.name}'"
|
26
|
+
elsif source_provider.is_a? PowerStencil::Plugins::Base
|
27
|
+
"plugin '#{source_provider.name}'"
|
28
|
+
else
|
29
|
+
raise PowerStencil::Error, "Unidentified source provider for #{entity_class} !"
|
30
|
+
end
|
31
|
+
|
32
|
+
puts " - '#{entity_type}' (buildable by #{builder} and provided by #{source_provider_display})."
|
20
33
|
end
|
21
34
|
return
|
22
35
|
end
|
@@ -23,6 +23,18 @@ module PowerStencil
|
|
23
23
|
sorted_targets.map do |entity|
|
24
24
|
entity_info = [" '#{entity.as_path}':"]
|
25
25
|
entity_info << " - Storage path : '#{entity.source_uri}'"
|
26
|
+
|
27
|
+
source_provider = entity.class.entity_type_source_provider
|
28
|
+
source_provider_display = if source_provider == PowerStencil
|
29
|
+
"'#{source_provider.name}'"
|
30
|
+
elsif source_provider == project
|
31
|
+
"project '#{source_provider.name}'"
|
32
|
+
elsif source_provider.is_a? PowerStencil::Plugins::Base
|
33
|
+
"plugin '#{source_provider.name}'"
|
34
|
+
else
|
35
|
+
raise PowerStencil::Error, "Unidentified source provider for #{entity.class} !"
|
36
|
+
end
|
37
|
+
entity_info << " - Provided by : #{source_provider_display}"
|
26
38
|
entity_info << " - Templates path : '#{entity.templates_path}'" if entity.respond_to? :templates_path
|
27
39
|
entity_info << " - Status : #{entity.valid? ? 'Valid' : 'INVALID !'} "
|
28
40
|
entity_info << " - Buildable : #{entity.buildable?}"
|
@@ -25,10 +25,10 @@ module PowerStencil
|
|
25
25
|
else
|
26
26
|
puts "#{project.plugins.size} plugin#{project.plugins.size == 1 ? '' : 's'} found to be used in this project."
|
27
27
|
end
|
28
|
-
project.plugins.each do |
|
29
|
-
puts " - #{
|
28
|
+
project.plugins.each do |_, plugin|
|
29
|
+
puts " - #{plugin.name} (in '#{plugin.plugin_path}')"
|
30
30
|
if config[:verbose]
|
31
|
-
|
31
|
+
plugin.capabilities.each do |name, value|
|
32
32
|
puts " #{name}: #{value}"
|
33
33
|
end
|
34
34
|
end
|
@@ -7,7 +7,7 @@ module PowerStencil
|
|
7
7
|
|
8
8
|
include PowerStencil::Utils::SecureRequire
|
9
9
|
|
10
|
-
def require_definition_files(files_or_dirs)
|
10
|
+
def require_definition_files(files_or_dirs, source)
|
11
11
|
required_files = []
|
12
12
|
files_or_dirs.each do |file_or_dir|
|
13
13
|
if File.directory? file_or_dir and File.readable? file_or_dir
|
@@ -21,21 +21,30 @@ module PowerStencil
|
|
21
21
|
next
|
22
22
|
end
|
23
23
|
# This is a ruby library or there is something wrong
|
24
|
-
|
25
|
-
|
26
|
-
# logger.warn "While trying to load definition files, found that '#{file_or_dir}' has a problem. Ignored..."
|
27
|
-
# end
|
24
|
+
securely_require_with_entity_class_detection file_or_dir, source
|
25
|
+
|
28
26
|
end
|
29
|
-
required_files.sort!.each {|file|
|
27
|
+
required_files.sort!.each { |file| securely_require_with_entity_class_detection file, source }
|
30
28
|
required_files
|
31
29
|
end
|
32
30
|
|
33
31
|
private
|
34
32
|
|
35
33
|
def load_system_entities_definition
|
36
|
-
require_definition_files [SYSTEM_ENTITY_DEFINITION_ENTRY_POINT]
|
34
|
+
require_definition_files [SYSTEM_ENTITY_DEFINITION_ENTRY_POINT], PowerStencil
|
37
35
|
end
|
38
36
|
|
37
|
+
def securely_require_with_entity_class_detection(entity_definition_file_path, source)
|
38
|
+
before = PowerStencil::Engine::EntitiesHandling.all_types
|
39
|
+
securely_require entity_definition_file_path, fail_on_error: true
|
40
|
+
after = PowerStencil::Engine::EntitiesHandling.all_types
|
41
|
+
after.reject { |k, _| before.keys.include? k }
|
42
|
+
.each do |_, plugin_entity_class|
|
43
|
+
plugin_entity_class.instance_eval do
|
44
|
+
@entity_type_source_provider = source
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
39
48
|
end
|
40
49
|
|
41
50
|
end
|
@@ -6,9 +6,24 @@ module PowerStencil
|
|
6
6
|
def require_plugin_entity_definitions
|
7
7
|
return unless capabilities[:entity_definitions]
|
8
8
|
logger.info "Requiring '#{self.name}' plugin entity definitions..."
|
9
|
+
securely_require_with_entity_class_detection
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def securely_require_with_entity_class_detection
|
16
|
+
before = PowerStencil::Engine::EntitiesHandling.all_types
|
9
17
|
plugin_definition[:entity_definitions].each do |entity_definition_file_path|
|
10
18
|
securely_require entity_definition_file_path, fail_on_error: true
|
11
19
|
end
|
20
|
+
after = PowerStencil::Engine::EntitiesHandling.all_types
|
21
|
+
after.reject { |k, _| before.keys.include? k }.each do |_, plugin_entity_class|
|
22
|
+
plugin = self
|
23
|
+
plugin_entity_class.instance_eval do
|
24
|
+
@entity_type_source_provider = plugin
|
25
|
+
end
|
26
|
+
end
|
12
27
|
end
|
13
28
|
|
14
29
|
end
|
@@ -21,6 +21,7 @@ module PowerStencil
|
|
21
21
|
$LOAD_PATH << plugin_root_path
|
22
22
|
securely_require entry_point_path unless plugin_definition[:plugin_module].nil?
|
23
23
|
rescue LoadError => e
|
24
|
+
@entry_point_path = nil
|
24
25
|
logger.warn "As plugin '#{name}' code is invalid, removing '#{plugin_root_path}' from LOAD_PATH"
|
25
26
|
$LOAD_PATH.delete plugin_root_path
|
26
27
|
end
|
@@ -60,7 +60,20 @@ module PowerStencil
|
|
60
60
|
.sort{ |a,b| a.first <=> b.first }
|
61
61
|
.each do |type, klass|
|
62
62
|
msg = "Type '#{type}' --> #{klass}"
|
63
|
-
|
63
|
+
|
64
|
+
source_provider = klass.entity_type_source_provider
|
65
|
+
source_provider_display = if source_provider == PowerStencil
|
66
|
+
"'#{source_provider.name}'"
|
67
|
+
elsif source_provider == self
|
68
|
+
"project '#{source_provider.name}'"
|
69
|
+
elsif source_provider.is_a? PowerStencil::Plugins::Base
|
70
|
+
"plugin '#{source_provider.name}'"
|
71
|
+
else
|
72
|
+
raise PowerStencil::Error, "Unidentified source provider for #{klass} !"
|
73
|
+
end
|
74
|
+
|
75
|
+
msg << " (provided by #{source_provider_display})"
|
76
|
+
msg << " template-template path: '#{entity_type_templates[type]}'" unless entity_type_templates[type].nil?
|
64
77
|
report << msg
|
65
78
|
end
|
66
79
|
report
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require 'power_stencil/system_entity_definitions/non_persistent'
|
5
5
|
require 'power_stencil/system_entity_definitions/has_associated_files'
|
6
|
+
require 'power_stencil/system_entity_definitions/source_provider'
|
6
7
|
require 'power_stencil/system_entity_definitions/buildable'
|
7
8
|
require 'power_stencil/system_entity_definitions/entity_project_common'
|
8
9
|
|
@@ -3,7 +3,7 @@ module PowerStencil
|
|
3
3
|
|
4
4
|
module EntityProjectCommon
|
5
5
|
|
6
|
-
|
6
|
+
def save(uri = source_uri, raise_error: true, force_save: false, force_files_generation: false )
|
7
7
|
super(source_uri, raise_error: raise_error, force_save: force_save)
|
8
8
|
unless PowerStencil.project.entity_type_templates[type].nil?
|
9
9
|
PowerStencil.project.generate_entity_dir_for_entity self, force: force_files_generation
|
@@ -3,6 +3,7 @@ module PowerStencil
|
|
3
3
|
|
4
4
|
class ProjectEntity < UniverseCompiler::Entity::Base
|
5
5
|
|
6
|
+
extend PowerStencil::SystemEntityDefinitions::SourceProvider
|
6
7
|
extend PowerStencil::SystemEntityDefinitions::Buildable
|
7
8
|
include PowerStencil::SystemEntityDefinitions::EntityProjectCommon
|
8
9
|
|
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.6.
|
4
|
+
version: 0.6.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-10-
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- lib/power_stencil/system_entity_definitions/project_config.rb
|
258
258
|
- lib/power_stencil/system_entity_definitions/project_entity.rb
|
259
259
|
- lib/power_stencil/system_entity_definitions/simple_exec.rb
|
260
|
+
- lib/power_stencil/system_entity_definitions/source_provider.rb
|
260
261
|
- lib/power_stencil/utils/directory_processor.rb
|
261
262
|
- lib/power_stencil/utils/file_edit.rb
|
262
263
|
- lib/power_stencil/utils/file_helper.rb
|
@@ -275,7 +276,7 @@ metadata:
|
|
275
276
|
documentation_uri: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md
|
276
277
|
source_code_uri: https://gitlab.com/tools4devops/power_stencil
|
277
278
|
homepage_uri: https://powerstencil.brizone.org/
|
278
|
-
post_install_message: "\nThank you for installing PowerStencil 0.6.
|
279
|
+
post_install_message: "\nThank you for installing PowerStencil 0.6.2 !\nFrom the command
|
279
280
|
line you can run `power_stencil --help`\nIf your shell is not completing the command:\n
|
280
281
|
\ If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nOfficial Website
|
281
282
|
\ : https://powerstencil.brizone.org/\nFull documentation here : https://gitlab.com/tools4devops/power_stencil/blob/master/README.md\nFeel
|