power_stencil 0.5.0 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/doc/builds.md +10 -1
  3. data/doc/entities.md +51 -42
  4. data/doc/plugins.md +59 -6
  5. data/doc/templates.md +1 -0
  6. data/etc/base_commands_definition.yml +14 -1
  7. data/etc/meta_templates/plugin_seed/etc/plugin_capabilities.yaml +2 -1
  8. data/etc/meta_templates/plugin_seed/psplugin_{entity}.gemspec +3 -1
  9. data/etc/templates/plugin_definition/etc/plugin_capabilities.yaml +2 -1
  10. data/etc/templates/plugin_definition/psplugin_{entity}.gemspec +3 -1
  11. data/lib/power_stencil/command_processors/build.rb +16 -3
  12. data/lib/power_stencil/command_processors/check.rb +12 -0
  13. data/lib/power_stencil/command_processors/create.rb +1 -1
  14. data/lib/power_stencil/command_processors/delete.rb +5 -5
  15. data/lib/power_stencil/command_processors/init.rb +2 -2
  16. data/lib/power_stencil/command_processors/plugin.rb +15 -5
  17. data/lib/power_stencil/command_processors/root.rb +1 -1
  18. data/lib/power_stencil/engine/build_handling.rb +1 -2
  19. data/lib/power_stencil/engine/directory_processor.rb +6 -1
  20. data/lib/power_stencil/engine/entities_definitions.rb +16 -7
  21. data/lib/power_stencil/engine/project_engine.rb +12 -5
  22. data/lib/power_stencil/initializer.rb +4 -7
  23. data/lib/power_stencil/plugins/base.rb +19 -9
  24. data/lib/power_stencil/plugins/capabilities.rb +10 -8
  25. data/lib/power_stencil/plugins/command_line.rb +1 -4
  26. data/lib/power_stencil/plugins/config.rb +1 -5
  27. data/lib/power_stencil/plugins/dsl.rb +24 -5
  28. data/lib/power_stencil/plugins/entity_definitions.rb +15 -0
  29. data/lib/power_stencil/plugins/gem.rb +14 -35
  30. data/lib/power_stencil/plugins/paths.rb +38 -0
  31. data/lib/power_stencil/plugins/require.rb +10 -16
  32. data/lib/power_stencil/plugins/templates.rb +1 -1
  33. data/lib/power_stencil/project/base.rb +12 -0
  34. data/lib/power_stencil/project/config.rb +3 -2
  35. data/lib/power_stencil/project/info.rb +14 -1
  36. data/lib/power_stencil/project/paths.rb +5 -25
  37. data/lib/power_stencil/project/plugins.rb +17 -22
  38. data/lib/power_stencil/system_entity_definitions/all.rb +1 -0
  39. data/lib/power_stencil/system_entity_definitions/entity_override.rb +1 -0
  40. data/lib/power_stencil/system_entity_definitions/entity_project_common.rb +1 -1
  41. data/lib/power_stencil/system_entity_definitions/project_entity.rb +1 -0
  42. data/lib/power_stencil/system_entity_definitions/simple_exec.rb +1 -1
  43. data/lib/power_stencil/system_entity_definitions/source_provider.rb +15 -0
  44. data/lib/power_stencil/utils/gem_utils.rb +22 -2
  45. data/lib/power_stencil/version.rb +1 -1
  46. data/power_stencil.gemspec +1 -1
  47. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 925c1cdc265fdddbe244699558bfe8e89bdf28a7
4
- data.tar.gz: 66b36b54757cc3593ce06d9da5c608485839b2bf
3
+ metadata.gz: 40a1c784720fe14e0e62ee24a66c24d0780d6165
4
+ data.tar.gz: 4eabaf0235839fe34f87ca9d2c3b59cd9c078b00
5
5
  SHA512:
6
- metadata.gz: e253fbedf2d8a29458168238a7b55dc8eb46a2f7c84b2f61cbed7653fc0a6e795f17c47ddf5cd8b4aa7a1a5ba389d3a86c36d55e5b18552350fd73399be4edc8
7
- data.tar.gz: cfc7fc77bcbb74cab625c3b8bca40b9502943701e12509810eb41945f2390f7a7f528a1e8f6cec6be84434b55ae64b71ef0a39691fe7e4425b8403fc0a617390
6
+ metadata.gz: 352caf7d55a27af71ad39a8e5c1a201943216ae8a685bb32b8592431a7fdccb9365fdc9f0ef636e06a59636c2941e19c1ec42f861a23bf7231b2a1401e2fc1bc
7
+ data.tar.gz: 97a20691531c85b72e243b8cc6376da7142924546209fe6713f9a5393c4885f8105c6d48fe3b2d2dcd07e1fabc1c37cc0c62ecb8d2ad3778e6e624d28ec345c9
@@ -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 can be applied to any entity, 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_.
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
 
@@ -58,8 +58,8 @@ $ power_stencil info
58
58
  PROJECT REPORT
59
59
  --------------------------------------------------------------------------------
60
60
  General information:
61
- - Project required version: 0.2.18
62
- - PowerStencil version: 0.2.18
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.2.18/etc/templates/plugin_definition')
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.2.18/etc/templates/simple_exec')
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
- - Status : Valid
183
- - Buildable : false
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
- - Status : Valid
187
- - Buildable : false
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
- - Status : Valid
191
- - Buildable : false
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
- - Status : Valid
208
- - Buildable : false
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
- - Status : Valid
212
- - Buildable : false
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
- - Status : Valid
222
- - Buildable : false
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
- - Status : Valid
226
- - Buildable : false
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
- - Status : Valid
341
- - Buildable : false
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.2.18/etc/templates/plugin_definition')
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.2.18/etc/templates/simple_exec')
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
- - Status : Valid
508
- - Buildable : false
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
@@ -15,6 +15,7 @@ Plugins
15
15
  - [Providing entity types and templates](#providing-entity-types-and-templates)
16
16
  - [Providing custom build process](#providing-custom-build-process)
17
17
  - [Plugin capabilities and structure](#plugin-capabilities-and-structure)
18
+ - [Using plugins available as gems](#using-plugins-available-as-gems)
18
19
  - [Conclusion](#conclusion)
19
20
 
20
21
  <!-- /TOC -->
@@ -97,7 +98,7 @@ If you do a `power_stencil info` you see a new part appeared in the report
97
98
  - command_line: true
98
99
  - processors: true
99
100
  - build: true
100
- - dsl: false
101
+ - dsl: true
101
102
  - entity_definitions: true
102
103
  - templates: true
103
104
  ```
@@ -123,7 +124,7 @@ Or with the capabilities information:
123
124
  command_line: true
124
125
  processors: true
125
126
  build: true
126
- dsl: false
127
+ dsl: true
127
128
  entity_definitions: true
128
129
  templates: true
129
130
  ```
@@ -205,6 +206,7 @@ we can check using `power_stencil check myplugin_entity/test`:
205
206
  $ power_stencil check myplugin_entity/test
206
207
  'myplugin_entity/test':
207
208
  - Storage path : '/tmp/demo/.ps_project/entities/myplugin_entity/test.yaml'
209
+ - Provided by : plugin 'myplugin'
208
210
  - Templates path : '/tmp/demo/myplugin_entity/test'
209
211
  - Status : Valid
210
212
  - Buildable : true
@@ -336,7 +338,8 @@ But this is not mandatory. Actually the only mandatory file for a plugin to be v
336
338
  :build: post_build_hook
337
339
 
338
340
  # If a dsl module is declared it will be injected in the DSL available in the shell or templates
339
- :dsl: null
341
+ :dsl:
342
+ - Myplugin::Dsl::MypluginDsl
340
343
 
341
344
  # These are the files (array) defining entity types. These files should not be already
342
345
  # required by the plugin as they will be required by the framework when needed.
@@ -349,7 +352,11 @@ But this is not mandatory. Actually the only mandatory file for a plugin to be v
349
352
  - etc/templates
350
353
  ```
351
354
 
352
- As it is quite self-documented, I won't too much elaborate on the meaning of each of the fields. But actually a plugin can actually provide ... nothing.
355
+ As it is quite self-documented, I won't too much elaborate on the meaning of each of the fields.
356
+
357
+ So you see that the plugin generated by the `power_stencil plugin --create` command is actually fully featured, providing all possible extras, in order to demonstrate the possibilities as well as ease your job, as you just have to fill the blanks or remove things you don't wan't.create
358
+
359
+ But a plugin could also actually provide ... nothing.
353
360
 
354
361
  Let's create a plugin fully manually instead of using the `power_stencil plugin --create`. From the root of the project, let's create the directory:
355
362
 
@@ -375,7 +382,7 @@ Bam ! We just created a more than useless yet valid plugin ! You can check that
375
382
  - command_line: false
376
383
  - processors: false
377
384
  - build: false
378
- - dsl: false
385
+ - dsl: true
379
386
  - entity_definitions: false
380
387
  - templates: false
381
388
  ```
@@ -421,12 +428,58 @@ MinimalPlugin::Minimal:
421
428
 
422
429
  All of this to demonstrate that a plugin can be almost anything, even something very minimalistic, but nevertheless you should keep on using the `power_stencil plugin --create` command and benefit from the structure it brings, as well as the possibility to become a stand-alone plugin gem...
423
430
 
431
+ # Using plugins available as gems
432
+
433
+ Any plugin you have created using the `power_stencil plugin --create` command is directly eligible to become a gem.
434
+
435
+ **If you release a plugin you created within a project as a gem (by doing `bundle exec rake release` from within the plugin directory, like for any standard gem :+1:), you can then re-use your plugin from any other `PowerStencil` project !**
436
+
437
+ All you have to do for that is to declare it in the `.ps_project/versioned-config.yaml` config file by adding an array `:project_plugins`:
438
+
439
+ ```yaml
440
+ ...
441
+ :project_plugins:
442
+ - my_awesome_plugin1
443
+ - my_awesome_plugin2
444
+ - my_awesome_plugin3
445
+ ...
446
+ ```
447
+
448
+ Now if you try to run power_stencil you may face an error if the gem is not locally installed:
449
+
450
+ ```
451
+ ▶ power_stencil info
452
+ --------------------------------------------------------------------------------
453
+ PROJECT REPORT
454
+ --------------------------------------------------------------------------------
455
+ General information:
456
+ Program aborted with message: 'Cannot find plugin 'my_awesome_plugin1'. Try 'power_stencil plugin --install''.
457
+ Use --debug option for more detail (see --help).
458
+
459
+ ```
460
+ Here you have the choice to either manually install each of your plugins manually by using the regular gem program:
461
+
462
+ $ gem install my_awesome_plugin1 my_awesome_plugin2 my_awesome_plugin3
463
+
464
+ But `PowerStencil` provides a convenient command to install/update your plugins:
465
+
466
+ ```
467
+ $ power_stencil plugin --install
468
+ Fetching: my_awesome_plugin1-0.1.0.gem (100%)
469
+ Fetching: my_awesome_plugin2-0.1.1.gem (100%)
470
+ Fetching: my_awesome_plugin3-1.2.3.gem (100%)
471
+ Installed plugin 'my_awesome_plugin1' (version: 0.1.0)
472
+ Installed plugin 'my_awesome_plugin2' (version: 0.1.1)
473
+ Installed plugin 'my_awesome_plugin3' (version: 1.2.3)
474
+ ```
475
+
476
+ **:star2: ::+1: You can now verify using `power_stencil info` or `power_stencil plugin --list`, that the plugins have been installed and that any feature they provide is now available to your project.**
424
477
 
425
478
  # Conclusion
426
479
 
427
480
  The documentation for plugins is not fully complete, so you are encouraged to read the code. Some official plugins are under development, and the documentation will be improved along their development...
428
481
 
429
- **:warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen. This will be the case once `PowerStencil` turns 1.0.0.** Yet now _local_ plugins are almost in their final stage. Gem plugins will soon be released and then `PowerStencil` will turn 1.0.0.
482
+ **:warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen. This will be the case once `PowerStencil` turns 1.0.0.** but plugins are close to their final release, and anything above version 0.6 is already really usable.
430
483
 
431
484
 
432
485
  [:back:][Documentation root]
@@ -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
@@ -104,13 +104,26 @@
104
104
  :options:
105
105
  create:
106
106
  :type: bool
107
- :summary: Generates a fully working although useless plugin skeleton.
107
+ :summary: Scaffolds a fully working plugin skeleton.
108
108
  :long_aliases:
109
109
  - new
110
110
  - scaffold
111
+ :incompatibilities:
112
+ - list
113
+ - install
111
114
  list:
112
115
  :type: bool
113
116
  :summary: List currently used plugins in this project.
117
+ :incompatibilities:
118
+ - create
119
+ - install
120
+ install:
121
+ :type: bool
122
+ :summary: Install gem plugins.
123
+ :incompatibilities:
124
+ - create
125
+ - list
126
+
114
127
  get:
115
128
  :banner: |
116
129
  Query entities from repository.
@@ -19,7 +19,8 @@
19
19
  :build: post_build_hook
20
20
 
21
21
  # If a dsl module is declared it will be injected in the DSL available in the shell or templates
22
- :dsl: null
22
+ :dsl:
23
+ - <%= plugin_module_name %>::Dsl::<%= plugin_module_name %>Dsl
23
24
 
24
25
  # These are the files (array) defining entity types. These files should not be already
25
26
  # required by the plugin as they will be required by the framework when needed.
@@ -18,8 +18,10 @@ Gem::Specification.new do |spec|
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
19
  if spec.respond_to?(:metadata)
20
20
  spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # This metadata is mandatory for PowerStencil !!
22
+ spec.metadata['plugin_name'] = '<%= plugin_name %>'
21
23
  else
22
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes and PowerStencil plugin mechanism !'
23
25
  end
24
26
 
25
27
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -19,7 +19,8 @@
19
19
  :build: post_build_hook
20
20
 
21
21
  # If a dsl module is declared it will be injected in the DSL available in the shell or templates
22
- :dsl: null
22
+ :dsl:
23
+ - <%= plugin_module_name %>::Dsl::<%= plugin_module_name %>Dsl
23
24
 
24
25
  # These are the files (array) defining entity types. These files should not be already
25
26
  # required by the plugin as they will be required by the framework when needed.
@@ -18,8 +18,10 @@ Gem::Specification.new do |spec|
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
19
  if spec.respond_to?(:metadata)
20
20
  spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # This metadata is mandatory for PowerStencil !!
22
+ spec.metadata['plugin_name'] = '<%= plugin_name %>'
21
23
  else
22
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes and PowerStencil plugin mechanism !'
23
25
  end
24
26
 
25
27
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -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
- puts " - '#{entity_type}'"
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
@@ -37,7 +50,7 @@ module PowerStencil
37
50
  if entity_report == ['Ok']
38
51
  puts " - '#{entity_full_name}' has been correctly built"
39
52
  else
40
- puts " - Failed to build '#{entity_full_name}' because ", entity_report
53
+ puts_and_logs " - Failed to build '#{entity_full_name}' because #{entity_report.join}", logs_as: :error, check_verbose: false
41
54
  end
42
55
  end
43
56
 
@@ -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?}"