doc/entities.md in power_stencil-0.6.1 vs doc/entities.md in power_stencil-0.6.2

- old
+ new

@@ -56,12 +56,12 @@ $ power_stencil info -------------------------------------------------------------------------------- PROJECT REPORT -------------------------------------------------------------------------------- General information: - - Project required version: 0.2.18 - - PowerStencil version: 0.2.18 + - Project required version: 0.6.1 + - PowerStencil version: 0.6.1 -------------------------------------------------------------------------------- Paths: - Project root path: '/tmp/tst2' - Project configuration path: '/tmp/tst2/.ps_project' - Local user configuration file: '/tmp/tst2/.ps_project/personal-config.yaml' @@ -73,16 +73,16 @@ Entities: - Contains 1 entities. - project_config: 1 -------------------------------------------------------------------------------- Available entity types: - - Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity - - Type 'entity_override' --> UniverseCompiler::Entity::Override - - 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') - - Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor - - Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig - - 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') + - Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity (provided by 'PowerStencil core') + - Type 'entity_override' --> UniverseCompiler::Entity::Override (provided by 'PowerStencil core') + - 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' + - Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor (provided by 'PowerStencil core') + - Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig (provided by 'PowerStencil core') + - 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' ``` It provides a lot of information about the project, but let's focus on the `Entities` and `Available entity types` parts of the report. You can see here above that only 6 types of entity are defined by default in a brand new created `PowerStencil` project. You can find them below with some of their core features: @@ -176,24 +176,27 @@ ```shell $ power_stencil check RAW ENTITIES 'base_entity/my_1st_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false 'base_entity/my_2nd_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false 'project_config/Project Config': - - Storage path: '' - - Status : Valid - - Buildable : false + - Storage path : '' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false ``` -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. +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. :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). This command may show some extra information, for more complex entities. We will see that later on. @@ -201,31 +204,35 @@ ```shell $ power_stencil check base_entity/my_1st_entity 'project_config/Project Config' RAW ENTITIES 'base_entity/my_1st_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false 'project_config/Project Config': - - Storage path: '' - - Status : Valid - - Buildable : false + - Storage path : '' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false ``` 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: ```shell $ power_stencil check base_ --regexp RAW ENTITIES 'base_entity/my_1st_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_1st_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false 'base_entity/my_2nd_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/base_entity/my_2nd_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false ``` ## Querying and graphing entities The command to query entities from the repository is `power_stencil get`, and it works basically like the `power_stencil check` command. @@ -334,13 +341,14 @@ Created 'base_entity/dev_entity' $ power_stencil check base_entity/dev_entity RAW ENTITIES 'base_entity/dev_entity': - - Storage path: '/tmp/tst2/.ps_project/user_entities/base_entity/dev_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/user_entities/base_entity/dev_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false ``` You can notice where the YAML file has been created. Of course you can then delete the entity like any other... ```shell @@ -485,28 +493,29 @@ . . . -------------------------------------------------------------------------------- Available entity types: - - Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity + - Type 'base_entity' --> PowerStencil::SystemEntityDefinitions::ProjectEntity (provided by 'PowerStencil core') - Type 'custom_entity' --> MyCustomEntity - - Type 'entity_override' --> UniverseCompiler::Entity::Override - - 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') - - Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor - - Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig - - 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') + - Type 'entity_override' --> UniverseCompiler::Entity::Override (provided by 'PowerStencil core') + - 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' + - Type 'process_descriptor' --> PowerStencil::SystemEntityDefinitions::ProcessDescriptor (provided by 'PowerStencil core') + - Type 'project_config' --> PowerStencil::SystemEntityDefinitions::ProjectConfig (provided by 'PowerStencil core') + - 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' ``` You see that the `custom_entity` type appeared in the list. Need another proof ? ```shell $ power_stencil create custom_entity/my_1st_custom_entity Created 'custom_entity/my_1st_custom_entity' $ power_stencil check cust -r RAW ENTITIES 'custom_entity/my_1st_custom_entity': - - Storage path: '/tmp/tst2/.ps_project/entities/custom_entity/my_1st_custom_entity.yaml' - - Status : Valid - - Buildable : false + - Storage path : '/tmp/tst2/.ps_project/entities/custom_entity/my_1st_custom_entity.yaml' + - Provided by : 'PowerStencil core' + - Status : Valid + - Buildable : false $ power_stencil get custom_entity/my_1st_custom_entity --raw --- !ruby/object:MyCustomEntity :name: my_1st_custom_entity ```