power_stencil 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +194 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/bin/update_plugin_template +79 -0
  13. data/doc/builds.md +267 -0
  14. data/doc/entities.md +964 -0
  15. data/doc/example_use_cases.md +59 -0
  16. data/doc/images/power-stencil-architecture.svg +151 -0
  17. data/doc/images/power-stencil-entity-build.svg +481 -0
  18. data/doc/images/power-stencil-entity-creation.svg +375 -0
  19. data/doc/images/power-stencil-project-overview.svg +2534 -0
  20. data/doc/images/power-stencil-simple-flow.svg +265 -0
  21. data/doc/plugins.md +169 -0
  22. data/doc/templates.md +332 -0
  23. data/etc/base_commands_definition.yml +259 -0
  24. data/etc/meta_templates/plugin_seed/etc/command_line.yaml +12 -0
  25. data/etc/meta_templates/plugin_seed/etc/plugin_config.yaml +4 -0
  26. data/etc/meta_templates/plugin_seed/etc/templates/.git_keep +0 -0
  27. data/etc/meta_templates/plugin_seed/lib/{entity}.rb.erb +34 -0
  28. data/etc/meta_templates/plugin_seed/lib/{entity}/entity_definitions/{entity}_entity.rb.erb +11 -0
  29. data/etc/meta_templates/plugin_seed/lib/{entity}/plugin_helper.rb.erb +17 -0
  30. data/etc/meta_templates/plugin_seed/lib/{entity}/version.rb.erb +3 -0
  31. data/etc/meta_templates/plugin_seed/lib/{entity}/{entity}_processor.rb.erb +19 -0
  32. data/etc/meta_templates/plugin_seed/psplugin_{entity}.gemspec +36 -0
  33. data/etc/power_stencil.yaml +92 -0
  34. data/etc/templates/plugin_definition/.gitignore +11 -0
  35. data/etc/templates/plugin_definition/.rspec +3 -0
  36. data/etc/templates/plugin_definition/.travis.yml +5 -0
  37. data/etc/templates/plugin_definition/CODE_OF_CONDUCT.md +74 -0
  38. data/etc/templates/plugin_definition/Gemfile +6 -0
  39. data/etc/templates/plugin_definition/LICENSE.txt +21 -0
  40. data/etc/templates/plugin_definition/README.md +43 -0
  41. data/etc/templates/plugin_definition/Rakefile +6 -0
  42. data/etc/templates/plugin_definition/bin/console +14 -0
  43. data/etc/templates/plugin_definition/bin/setup +8 -0
  44. data/etc/templates/plugin_definition/etc/command_line.yaml +12 -0
  45. data/etc/templates/plugin_definition/etc/plugin_config.yaml +4 -0
  46. data/etc/templates/plugin_definition/etc/templates/.git_keep +1 -0
  47. data/etc/templates/plugin_definition/lib/{entity}.rb.erb +34 -0
  48. data/etc/templates/plugin_definition/lib/{entity}/entity_definitions/{entity}_entity.rb.erb +11 -0
  49. data/etc/templates/plugin_definition/lib/{entity}/plugin_helper.rb.erb +17 -0
  50. data/etc/templates/plugin_definition/lib/{entity}/version.rb.erb +3 -0
  51. data/etc/templates/plugin_definition/lib/{entity}/{entity}_processor.rb.erb +19 -0
  52. data/etc/templates/plugin_definition/psplugin_{entity}.gemspec +36 -0
  53. data/etc/templates/plugin_definition/spec/spec_helper.rb +14 -0
  54. data/etc/templates/plugin_definition/spec/{entity}_spec.rb +9 -0
  55. data/etc/templates/project/.copy_ignore +2 -0
  56. data/etc/templates/project/.gitignore.erb +6 -0
  57. data/etc/templates/project/.ps_project/entities/.gitkeep +0 -0
  58. data/etc/templates/project/.ps_project/entities/README.md +11 -0
  59. data/etc/templates/project/.ps_project/entity_definitions/.gitkeep +0 -0
  60. data/etc/templates/project/.ps_project/entity_definitions/README.md +15 -0
  61. data/etc/templates/project/.ps_project/personal-config.yaml +8 -0
  62. data/etc/templates/project/.ps_project/plugins/.gitkeep +0 -0
  63. data/etc/templates/project/.ps_project/templates-templates/.gitkeep +0 -0
  64. data/etc/templates/project/.ps_project/templates-templates/README.md +13 -0
  65. data/etc/templates/project/.ps_project/user_entities/.gitkeep +0 -0
  66. data/etc/templates/project/.ps_project/user_entities/README.md +12 -0
  67. data/etc/templates/project/.ps_project/versioned-config.yaml +6 -0
  68. data/etc/templates/simple_exec/main.sh +4 -0
  69. data/exe/power_stencil +28 -0
  70. data/lib/power_stencil.rb +53 -0
  71. data/lib/power_stencil/command_processors/build.rb +43 -0
  72. data/lib/power_stencil/command_processors/check.rb +35 -0
  73. data/lib/power_stencil/command_processors/create.rb +70 -0
  74. data/lib/power_stencil/command_processors/delete.rb +38 -0
  75. data/lib/power_stencil/command_processors/edit.rb +35 -0
  76. data/lib/power_stencil/command_processors/entity_helper.rb +105 -0
  77. data/lib/power_stencil/command_processors/get.rb +22 -0
  78. data/lib/power_stencil/command_processors/info.rb +41 -0
  79. data/lib/power_stencil/command_processors/init.rb +47 -0
  80. data/lib/power_stencil/command_processors/new_plugin.rb +31 -0
  81. data/lib/power_stencil/command_processors/root.rb +27 -0
  82. data/lib/power_stencil/command_processors/shell.rb +37 -0
  83. data/lib/power_stencil/command_processors/trace_helper.rb +20 -0
  84. data/lib/power_stencil/dsl/base.rb +24 -0
  85. data/lib/power_stencil/dsl/entities.rb +46 -0
  86. data/lib/power_stencil/dsl/plugin_generation.rb +17 -0
  87. data/lib/power_stencil/engine/base.rb +50 -0
  88. data/lib/power_stencil/engine/build_handling.rb +77 -0
  89. data/lib/power_stencil/engine/directory_processor.rb +111 -0
  90. data/lib/power_stencil/engine/entities_definitions.rb +42 -0
  91. data/lib/power_stencil/engine/entities_handling.rb +76 -0
  92. data/lib/power_stencil/engine/entity_engine.rb +20 -0
  93. data/lib/power_stencil/engine/init_engine.rb +18 -0
  94. data/lib/power_stencil/engine/project_engine.rb +75 -0
  95. data/lib/power_stencil/engine/renderers/erb.rb +21 -0
  96. data/lib/power_stencil/error.rb +20 -0
  97. data/lib/power_stencil/initializer.rb +87 -0
  98. data/lib/power_stencil/plugins/base.rb +54 -0
  99. data/lib/power_stencil/plugins/capabilities.rb +30 -0
  100. data/lib/power_stencil/plugins/command_line.rb +27 -0
  101. data/lib/power_stencil/plugins/config.rb +32 -0
  102. data/lib/power_stencil/plugins/dependencies.rb +32 -0
  103. data/lib/power_stencil/plugins/gem.rb +57 -0
  104. data/lib/power_stencil/plugins/require.rb +77 -0
  105. data/lib/power_stencil/plugins/templates.rb +21 -0
  106. data/lib/power_stencil/project/base.rb +79 -0
  107. data/lib/power_stencil/project/config.rb +54 -0
  108. data/lib/power_stencil/project/create.rb +30 -0
  109. data/lib/power_stencil/project/info.rb +72 -0
  110. data/lib/power_stencil/project/paths.rb +119 -0
  111. data/lib/power_stencil/project/plugins.rb +89 -0
  112. data/lib/power_stencil/project/proxy.rb +13 -0
  113. data/lib/power_stencil/project/templates.rb +56 -0
  114. data/lib/power_stencil/project/versioning.rb +29 -0
  115. data/lib/power_stencil/system_entity_definitions/all.rb +14 -0
  116. data/lib/power_stencil/system_entity_definitions/buildable.rb +23 -0
  117. data/lib/power_stencil/system_entity_definitions/entity_override.rb +8 -0
  118. data/lib/power_stencil/system_entity_definitions/entity_project_common.rb +33 -0
  119. data/lib/power_stencil/system_entity_definitions/has_associated_files.rb +13 -0
  120. data/lib/power_stencil/system_entity_definitions/non_persistent.rb +14 -0
  121. data/lib/power_stencil/system_entity_definitions/plugin.rb +17 -0
  122. data/lib/power_stencil/system_entity_definitions/process_descriptor.rb +15 -0
  123. data/lib/power_stencil/system_entity_definitions/project_config.rb +24 -0
  124. data/lib/power_stencil/system_entity_definitions/project_entity.rb +16 -0
  125. data/lib/power_stencil/system_entity_definitions/simple_exec.rb +47 -0
  126. data/lib/power_stencil/utils/directory_processor.rb +54 -0
  127. data/lib/power_stencil/utils/file_edit.rb +87 -0
  128. data/lib/power_stencil/utils/file_helper.rb +56 -0
  129. data/lib/power_stencil/utils/gem_utils.rb +13 -0
  130. data/lib/power_stencil/utils/secure_require.rb +26 -0
  131. data/lib/power_stencil/utils/semantic_version.rb +128 -0
  132. data/lib/power_stencil/version.rb +3 -0
  133. data/power_stencil.gemspec +32 -0
  134. metadata +287 -0
@@ -0,0 +1,265 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ width="340.14127mm"
13
+ height="55.292072mm"
14
+ viewBox="0 0 340.14127 55.292072"
15
+ version="1.1"
16
+ id="svg8"
17
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
18
+ sodipodi:docname="power-stencil-simple-flow.svg">
19
+ <title
20
+ id="title1457">PowerStencil simple flow description</title>
21
+ <defs
22
+ id="defs2">
23
+ <marker
24
+ inkscape:stockid="Arrow1Send"
25
+ orient="auto"
26
+ refY="0"
27
+ refX="0"
28
+ id="Arrow1Send"
29
+ style="overflow:visible"
30
+ inkscape:isstock="true">
31
+ <path
32
+ id="path1098"
33
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
34
+ style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:1.00000003pt;stroke-opacity:1"
35
+ transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
36
+ inkscape:connector-curvature="0" />
37
+ </marker>
38
+ <marker
39
+ inkscape:stockid="Arrow1Lend"
40
+ orient="auto"
41
+ refY="0"
42
+ refX="0"
43
+ id="Arrow1Lend"
44
+ style="overflow:visible"
45
+ inkscape:isstock="true">
46
+ <path
47
+ id="path1086"
48
+ d="M 0,0 5,-5 -12.5,0 5,5 Z"
49
+ style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:1.00000003pt;stroke-opacity:1"
50
+ transform="matrix(-0.8,0,0,-0.8,-10,0)"
51
+ inkscape:connector-curvature="0" />
52
+ </marker>
53
+ <inkscape:path-effect
54
+ effect="bspline"
55
+ id="path-effect1081"
56
+ is_visible="true"
57
+ weight="33.333333"
58
+ steps="2"
59
+ helper_size="0"
60
+ apply_no_weight="true"
61
+ apply_with_weight="true"
62
+ only_selected="false" />
63
+ </defs>
64
+ <sodipodi:namedview
65
+ id="base"
66
+ pagecolor="#ffffff"
67
+ bordercolor="#666666"
68
+ borderopacity="1.0"
69
+ inkscape:pageopacity="0.0"
70
+ inkscape:pageshadow="2"
71
+ inkscape:zoom="0.7"
72
+ inkscape:cx="641.18508"
73
+ inkscape:cy="2.7826171"
74
+ inkscape:document-units="mm"
75
+ inkscape:current-layer="layer1"
76
+ showgrid="false"
77
+ inkscape:window-width="1920"
78
+ inkscape:window-height="1141"
79
+ inkscape:window-x="0"
80
+ inkscape:window-y="31"
81
+ inkscape:window-maximized="1"
82
+ fit-margin-top="10"
83
+ fit-margin-left="10"
84
+ fit-margin-right="10"
85
+ fit-margin-bottom="10" />
86
+ <metadata
87
+ id="metadata5">
88
+ <rdf:RDF>
89
+ <cc:Work
90
+ rdf:about="">
91
+ <dc:format>image/svg+xml</dc:format>
92
+ <dc:type
93
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
94
+ <dc:title>PowerStencil simple flow description</dc:title>
95
+ <dc:creator>
96
+ <cc:Agent>
97
+ <dc:title>L.Briais</dc:title>
98
+ </cc:Agent>
99
+ </dc:creator>
100
+ </cc:Work>
101
+ </rdf:RDF>
102
+ </metadata>
103
+ <g
104
+ inkscape:label="Calque 1"
105
+ inkscape:groupmode="layer"
106
+ id="layer1"
107
+ transform="translate(30.579753,-38.363802)">
108
+ <rect
109
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a7c2db;fill-opacity:0;fill-rule:evenodd;stroke:#b3b3b3;stroke-width:1.00654888;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.02619566, 4.02619566;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
110
+ id="rect927"
111
+ width="202.58376"
112
+ height="33.93668"
113
+ x="75.10601"
114
+ y="49.020126"
115
+ ry="3.7410421" />
116
+ <rect
117
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a7c2db;fill-opacity:0;fill-rule:evenodd;stroke:#b3b3b3;stroke-width:1.00654888;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.02619566, 4.02619566;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
118
+ id="rect927-7"
119
+ width="69.897194"
120
+ height="34.285522"
121
+ x="-4.7348213"
122
+ y="48.867077"
123
+ ry="3.7794967" />
124
+ <path
125
+ style="fill:#4d4d4d;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:4.16499996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Send)"
126
+ d="m -20.579753,67.932995 c 104.23538,0 208.470493,0 312.705333,0"
127
+ id="path1079"
128
+ inkscape:connector-curvature="0"
129
+ inkscape:path-effect="#path-effect1081"
130
+ inkscape:original-d="m -20.579753,67.932995 c 104.23538,-2.64e-4 208.470493,-2.64e-4 312.705333,0" />
131
+ <g
132
+ id="g948">
133
+ <rect
134
+ ry="1.3100638"
135
+ y="59.92662"
136
+ x="2.6126425"
137
+ height="16.012749"
138
+ width="55.700253"
139
+ id="rect815"
140
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a7c2db;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.48427609;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
141
+ <text
142
+ id="text819"
143
+ y="66.31649"
144
+ x="10.098216"
145
+ style="font-style:normal;font-weight:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
146
+ xml:space="preserve"><tspan
147
+ id="tspan821"
148
+ style="stroke-width:0.26458332px"
149
+ y="66.31649"
150
+ x="10.098216"
151
+ sodipodi:role="line">Project </tspan><tspan
152
+ id="tspan865"
153
+ style="stroke-width:0.26458332px"
154
+ y="72.104248"
155
+ x="10.098216"
156
+ sodipodi:role="line">Templates &amp; Data</tspan></text>
157
+ </g>
158
+ <g
159
+ id="g954"
160
+ transform="translate(-2.9812257e-6,-0.76938629)">
161
+ <rect
162
+ ry="1.3100638"
163
+ y="60.696007"
164
+ x="81.007019"
165
+ height="16.012749"
166
+ width="55.700253"
167
+ id="rect815-6"
168
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a7c2db;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.48427609;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
169
+ <text
170
+ id="text819-2"
171
+ y="67.085876"
172
+ x="82.828049"
173
+ style="font-style:normal;font-weight:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
174
+ xml:space="preserve"><tspan
175
+ id="tspan821-7"
176
+ style="stroke-width:0.26458332px"
177
+ y="67.085876"
178
+ x="82.828049"
179
+ sodipodi:role="line">PowerStencil</tspan><tspan
180
+ id="tspan861"
181
+ style="stroke-width:0.26458332px"
182
+ y="72.873634"
183
+ x="82.828049"
184
+ sodipodi:role="line">Core actions &amp; Plugins</tspan></text>
185
+ </g>
186
+ <g
187
+ id="g960"
188
+ transform="translate(-1.3073388,-1.5253372)">
189
+ <rect
190
+ ry="1.3100638"
191
+ y="61.451958"
192
+ x="146.01892"
193
+ height="16.012749"
194
+ width="55.700253"
195
+ id="rect815-6-9"
196
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a7c2db;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.48427609;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
197
+ <text
198
+ id="text819-2-3"
199
+ y="68.290604"
200
+ x="159.57373"
201
+ style="font-style:normal;font-weight:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
202
+ xml:space="preserve"><tspan
203
+ id="tspan821-7-9"
204
+ style="stroke-width:0.26458332px"
205
+ y="68.290604"
206
+ x="159.57373"
207
+ sodipodi:role="line">Generated</tspan><tspan
208
+ id="tspan861-2"
209
+ style="stroke-width:0.26458332px"
210
+ y="74.078362"
211
+ x="159.57373"
212
+ sodipodi:role="line">Files &amp; Code</tspan></text>
213
+ </g>
214
+ <g
215
+ id="g1077"
216
+ transform="translate(2.2510687e-6)">
217
+ <rect
218
+ ry="1.3075371"
219
+ y="59.942062"
220
+ x="208.43158"
221
+ height="15.981865"
222
+ width="63.152916"
223
+ id="rect815-6-9-8"
224
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ccd7e2;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.51515979;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
225
+ <text
226
+ id="text819-2-3-3"
227
+ y="66.316498"
228
+ x="210.64307"
229
+ style="font-style:normal;font-weight:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
230
+ xml:space="preserve"><tspan
231
+ id="tspan921"
232
+ style="stroke-width:0.26458332px"
233
+ y="66.316498"
234
+ x="210.64307"
235
+ sodipodi:role="line">Optionally triggers action</tspan><tspan
236
+ id="tspan925"
237
+ style="stroke-width:0.26458332px"
238
+ y="72.104256"
239
+ x="210.64307"
240
+ sodipodi:role="line">on generated files</tspan></text>
241
+ </g>
242
+ <text
243
+ xml:space="preserve"
244
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
245
+ x="2.1105075"
246
+ y="55.366859"
247
+ id="text1006"><tspan
248
+ sodipodi:role="line"
249
+ id="tspan1004"
250
+ x="2.1105075"
251
+ y="55.366859"
252
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.63020849px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#999999;stroke-width:0.26458332px">Git repository</tspan></text>
253
+ <text
254
+ xml:space="preserve"
255
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.63020849px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
256
+ x="80.534271"
257
+ y="55.366859"
258
+ id="text1006-9"><tspan
259
+ sodipodi:role="line"
260
+ x="80.534271"
261
+ y="55.366859"
262
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.63020849px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#999999;stroke-width:0.26458332px"
263
+ id="tspan1026">Build process</tspan></text>
264
+ </g>
265
+ </svg>
@@ -0,0 +1,169 @@
1
+ Plugins
2
+ =======
3
+
4
+ <!-- TOC -->
5
+
6
+ - [Why plugins ?](#why-plugins-)
7
+ - [Capitalize on your custom entity types](#capitalize-on-your-custom-entity-types)
8
+ - [Functional code growing](#functional-code-growing)
9
+ - [Need of very specific post actions developed in Ruby](#need-of-very-specific-post-actions-developed-in-ruby)
10
+ - [Enhance `power_stencil` command line](#enhance-power_stencil-command-line)
11
+ - [What are plugins ?](#what-are-plugins-)
12
+ - [Creating plugin local to the project](#creating-plugin-local-to-the-project)
13
+
14
+ <!-- /TOC -->
15
+ [:back:][Documentation root]
16
+
17
+ # Why plugins ?
18
+
19
+ If you read everything about [entities], [templates] and [builds], you may wonder why you may ever need to create plugins. There are nevertheless good reasons to build real plugins.
20
+
21
+ ## Capitalize on your custom entity types
22
+
23
+ You have designed super nicely crafted entity types that you may want to **re-use** in other projects.
24
+
25
+ ## Functional code growing
26
+
27
+ If you start developing a lot of code around your entity types, it may become a bad idea to keep everything within your entity types code and you may want to **structure** your code, add tests to it etc...
28
+
29
+ ## Need of very specific post actions developed in Ruby
30
+
31
+ If calling an executable after the [build][builds] process completed is not enough and you want some custom Ruby to be run right after the [build][builds] completion.
32
+
33
+ ## Enhance `power_stencil` command line
34
+
35
+ If you want to have new custom sub-commands or options available.
36
+
37
+
38
+ # What are plugins ?
39
+
40
+ Plugins are actually Ruby Gems with a specific structure. Plugins can be part of the project or provided as a separated stand-alone Gem.
41
+
42
+ The normal process would be to begin with a plugin within the project and once you're ok with its features you may release it as a standalone Ruby Gem.
43
+
44
+ - Plugins local to the project are automatically taken in account.
45
+ - To use plugins provided as Gems you have to set the `:plugins:` array property in the `.ps_project/versioned-config.yaml`
46
+
47
+ :warning: Plugins provided as standalone Gems are not thoroughly tested, for the time being you may use plugins local to the project.
48
+
49
+
50
+ # Creating plugin local to the project
51
+
52
+ The is a command provided for that, that will create a whole plugin skeleton.
53
+
54
+ ```shell
55
+ $ power_stencil new-plugin myplugin
56
+ Generated new plugin 'myplugin'
57
+
58
+ $ ll .ps_project/plugins/myplugin
59
+ total 60
60
+ drwxrwxr-x 6 laurent laurent 4096 août 28 14:38 ./
61
+ drwxrwxr-x 3 laurent laurent 4096 août 28 14:38 ../
62
+ drwxrwxr-x 2 laurent laurent 4096 août 28 14:38 bin/
63
+ -rw-rw-r-- 1 laurent laurent 3228 août 28 14:38 CODE_OF_CONDUCT.md
64
+ drwxrwxr-x 3 laurent laurent 4096 août 28 14:38 etc/
65
+ -rw-rw-r-- 1 laurent laurent 163 août 28 14:38 Gemfile
66
+ -rw-rw-r-- 1 laurent laurent 113 août 28 14:38 .gitignore
67
+ drwxrwxr-x 3 laurent laurent 4096 août 28 14:38 lib/
68
+ -rw-rw-r-- 1 laurent laurent 1077 août 28 14:38 LICENSE.txt
69
+ -rw-rw-r-- 1 laurent laurent 1491 août 28 14:38 psplugin_myplugin.gemspec
70
+ -rw-rw-r-- 1 laurent laurent 117 août 28 14:38 Rakefile
71
+ -rw-rw-r-- 1 laurent laurent 1770 août 28 14:38 README.md
72
+ -rw-rw-r-- 1 laurent laurent 53 août 28 14:38 .rspec
73
+ drwxrwxr-x 2 laurent laurent 4096 août 28 14:38 spec/
74
+ -rw-rw-r-- 1 laurent laurent 88 août 28 14:38 .travis.yml
75
+ ```
76
+
77
+ You can see that it looks a lot like a Ruby Gem, and it's normal because it is ;-)...
78
+
79
+ So what was the impact on the project.
80
+
81
+ If you do a `power_stencil info` you see a new part appeared in the report
82
+
83
+ ```
84
+ --------------------------------------------------------------------------------
85
+ Plugins:
86
+ --> Plugin 'myplugin' has following capabilities:
87
+ - command_line: true
88
+ - local_config: true
89
+ - processors: true
90
+ - build: false
91
+ - dsl: false
92
+ - entity_definitions: true
93
+ - code: true
94
+ - version: true
95
+ - templates: true
96
+ ```
97
+ Each of the lines correspond to what is called a _plugin capability_.
98
+
99
+ Obviously by default the plugin does nothing, but it defined some placeholders. For example in the ouput here above it says `command_line: true`. What could it mean ?
100
+
101
+ Let's try to see to help:
102
+
103
+ ```shell
104
+ $ power_stencil --help
105
+ This is power_stencil. A powerful templating engine.
106
+ -- Options ---------------------------------------------------------------------
107
+ -v, --verbose Displays extra runtime information.
108
+ -h, --help Displays this help.
109
+ --program-version, -V, --version Displays program version.
110
+ --simulate Will not perform actual actions
111
+ --debug Debug mode
112
+ --debug-on-err, --debug-on-stderr Sends debugging to SDTERR
113
+ --log-level Defines the level of logging (0 to 5)
114
+ --log-file Specifies a file to log into
115
+ --truncate-log-file Truncates the log file (appends by default)
116
+ --project-path Specifies a startup path to use instead of '.'
117
+ --auto Bypasses command-line confirmations to the user
118
+
119
+ --------------------------------------------------------------------------------
120
+ Following subcommands exist too:
121
+ For more information you can always issue sub_command_name --help...
122
+ --------------------------------------------------------------------------------
123
+ * init: Initializes a PowerStencil repository ...
124
+ * info: Generic information about the repository ...
125
+ * new-plugin: Generates the skeleton for a plugin ...
126
+ * get: Query entities from repository ...
127
+ * shell: Opens a shell to interact with entities ...
128
+ * check: Check repository entities consistency ...
129
+ * create: Creates entities in the repository ...
130
+ * edit: Edit entities from repository ...
131
+ * delete: Delete entities from repository ...
132
+ * build: Builds entities ...
133
+ * myplugin: Does nothing useful Added by plugin myplugin
134
+ ```
135
+
136
+ You can see that the plugin brought a new sub-command `myplugin`.
137
+
138
+ Let's try it:
139
+
140
+ ```shell
141
+ $ power_stencil myplugin
142
+ MYPLUGIN PLUGIN WAZ HERE
143
+ ```
144
+
145
+ Wow it worked ! Useless, but worked !
146
+
147
+
148
+ The documentation for plugins is not yet done, so you are encouraged to read the code, the capabilities (in the output of `power_stencil info`) give you an idea of what plugins can do.
149
+
150
+ :warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen.
151
+
152
+
153
+ [:back:][Documentation root]
154
+ <!-- End of Document -->
155
+
156
+ <!-- Pages -->
157
+ [Documentation root]: ../README.md "Back to documentation root"
158
+ [entities]: entities.md "Entities in PowerStencil"
159
+ [builds]: builds.md "Builds in PowerStencil"
160
+ [templates]: templates.md "Templates in PowerStencil"
161
+
162
+
163
+ <!-- Code links -->
164
+
165
+
166
+ <!-- Illustrations -->
167
+
168
+
169
+ <!-- External links -->
@@ -0,0 +1,332 @@
1
+ Templates
2
+ =========
3
+
4
+ <!-- TOC -->
5
+
6
+ - [Templates overview](#templates-overview)
7
+ - [Templates discovery with `simple_exec` entity type](#templates-discovery-with-simple_exec-entity-type)
8
+ - [What can I do within templates ?](#what-can-i-do-within-templates-)
9
+ - [ERB for newbies](#erb-for-newbies)
10
+ - [The `PowerStencil` DSL](#the-powerstencil-dsl)
11
+ - [Where do I create templates ?](#where-do-i-create-templates-)
12
+ - [Creating templates-templates of your own](#creating-templates-templates-of-your-own)
13
+ - [basics](#basics)
14
+ - [`.xxx_ignore` files](#xxx_ignore-files)
15
+ - [Application to our example](#application-to-our-example)
16
+
17
+ <!-- /TOC -->
18
+ [:back:][Documentation root]
19
+
20
+ # Templates overview
21
+
22
+ Templates are the key feature of `PowerStencil` (hence the name). Templates are what will use the [entities] you carefully crafted in order to produce something during the [build][builds] process.
23
+
24
+ Currently the underlying engine is [ERB].
25
+
26
+ When an entity type has some templates associated and you create an entity, it will create a directory `<entity_type>/<entity_name>` where you will fond those templates.
27
+
28
+ # Templates discovery with `simple_exec` entity type
29
+
30
+ In the basic entity types, the only one having templates is the `simple_exec` entity type. So let's try with it:
31
+
32
+ ```shell
33
+ $ power_stencil create simple_exec/demo_templates
34
+ Created 'simple_exec/demo_templates'
35
+
36
+ $ power_stencil check simple_exec/demo_templates
37
+ RAW ENTITIES
38
+ 'simple_exec/demo_templates':
39
+ - Storage path : '/tmp/tst3/.ps_project/entities/simple_exec/demo_templates.yaml'
40
+ - Templates path : '/tmp/tst3/simple_exec/demo_templates'
41
+ - Status : Valid
42
+ - Buildable : true
43
+ ```
44
+ As you can see the output of `power_stencil check` shows more information than entities we already created. First we see that this entity is `buildable`, and we'll detail that in the [builds] document, but for the moment what we will focus on the `Templates path` information.
45
+
46
+ And it's true if we have a look in the `simple_exec/demo_templates` from the root of the project, a file appeared there:
47
+
48
+ ```shell
49
+ $ ls -l simple_exec/demo_templates
50
+ total 4
51
+ -rwxrwxr-x 1 laurent laurent 57 août 23 16:44 main.sh
52
+
53
+ $ cat simple_exec/demo_templates/main.sh
54
+ #!/usr/bin/env bash
55
+
56
+ echo "Nothing to do... Easy task..."
57
+ ```
58
+
59
+ Humm... This stuff doesn't look like a template...looks like a regular bash script. It's true and we'll come back to the internals of `simple_exec` in the [builds], where does this script come from etc... So don't focus too much on this file for the moment.
60
+
61
+ We will just first experiment our first build !
62
+
63
+ ```shell
64
+ $ power_stencil build simple_exec/demo_templates -v
65
+ De-templating files for 'simple_exec/demo_templates' into '/tmp/tst3/build/20190823-1709-54271-simple_exec_demo_templates/simple_exec_demo_templates'
66
+ Entities analysis completed.
67
+ Running '/tmp/tst3/build/20190823-1709-54271-simple_exec_demo_templates/simple_exec_demo_templates/main.sh'
68
+ Nothing to do... Easy task...
69
+ End of process 15572
70
+ - 'simple_exec/demo_templates' has been correctly built
71
+ ```
72
+
73
+ What can we see there ?
74
+
75
+ The first line is the most interesting one for us. It says "De-templating ... into ...", and it's true that a brand new directory named `build` appeared at the root of the project. Again we won't focus too much on the name of the sub-directory as we will see that in the [builds], but if we have a look in the generated directory we see the same content as what we had in `simple_exec/demo_templates`...
76
+ And by the way the generated script seems to have been run, as we can see in the output.
77
+
78
+ :warning: If bash is not installed on your system, the output will obviously be different as `PowerStencil` won't be able to run the script, yet all the files should have been generated correctly.
79
+
80
+ Ok is it possible, that everything inside `simple_exec/demo_templates` is actually considered as templates ? **The answer is yes !!**
81
+
82
+ Let prove it and replace the content of `simple_exec/demo_templates/main.sh` by the following:
83
+
84
+ ```shell
85
+ #!/usr/bin/env bash
86
+
87
+ echo "This script has been generated on <%= Time.now %>"
88
+
89
+ echo "It was done in the scope of '<%= build_target.name %>' (which is of the type '<%= build_target.type %>')..."
90
+ ```
91
+ Ah ok... now it looks like an ERB template !
92
+
93
+ Let's rebuild...
94
+
95
+ ```shell
96
+ $ power_stencil build simple_exec/demo_templates -v
97
+ De-templating files for 'simple_exec/demo_templates' into '/tmp/tst3/build/20190823-1733-08665-simple_exec_demo_templates/simple_exec_demo_templates'
98
+ Entities analysis completed.
99
+ Running '/tmp/tst3/build/20190823-1733-08665-simple_exec_demo_templates/simple_exec_demo_templates/main.sh'
100
+ This script has been generated on 2019-08-23 17:33:08 +0200
101
+ It was done in the scope of 'demo_templates' (which is of the type 'simple_exec')...
102
+ End of process 415
103
+ - 'simple_exec/demo_templates' has been correctly built
104
+ ```
105
+
106
+ And it's true, if I have a look at the generated script (replace with your own path):
107
+
108
+ ```shell
109
+ $ cat /tmp/tst3/build/20190823-1733-08665-simple_exec_demo_templates/simple_exec_demo_templates/main.sh
110
+ #!/usr/bin/env bash
111
+
112
+ echo "This script has been generated on 2019-08-23 17:33:08 +0200"
113
+
114
+ echo "It was done in the scope of 'demo_templates' (which is of the type 'simple_exec')..."
115
+ ```
116
+
117
+ The content has been "de-templated"... :+1: sooo cool !
118
+
119
+ :information_source: Here the template directory of the `simple_exec/demo_templates` was containing only on file (the bash script), but **any file in any sub-directory of that directory would have been considered as a template** (yet there are some mechanism to control and limit which files have to be processed, like for example imagine there would be images, or zip files, probably you don't want them to be processed. All of this will be covered in the [builds] document).
120
+
121
+ # What can I do within templates ?
122
+
123
+ ## ERB for newbies
124
+
125
+ So you noticed the [ERB] syntax. If you already developed within a [Ruby on Rails] project you are probably used to it. Basically [ERB] introduces two main types of tags:
126
+
127
+ - `<% %>` between those tags you can put **any valid [Ruby] code**.
128
+ - `<%= %>` what is returned by the enclosed [Ruby] code will be inserted _here_ in the resulting document.
129
+
130
+ There are some other minor tags like comments, or insertion without carriage return... You are encouraged to have a look at [ERB] if you don't know it, but it's fairly simple like most templating engine are.
131
+
132
+ ## The `PowerStencil` DSL
133
+
134
+ On top of any Ruby legit code you can use special methods provided by `PowerStencil` to ease the access to entities, configuration etc...
135
+
136
+ Here are the main methods:
137
+
138
+ - `entity(type, name)` will return any entity from the repository. The method is self-explanatory, this is the most generic way to access any entity of the repository.
139
+ - `entities(criterion: nil, value: nil, &filter_block)` which is a more generic entities query method where `criterion` can be `:by_name` or `:by_type` and that will return an array (that you can potentially filter using the `filter_block`).
140
+ - `build_target` will return the entity that you are currently building.
141
+ - `project_config` is a shortcut to the project entity. You could actually retrieve it using the `entity(type, name)` method.
142
+
143
+ And of course you have access like in `power_stencil shell` to any class brought by `PowerStencil`, you could create entities there, destroy some, **but you should not do it**, as it would be very weird to do that during the process of detemplating !
144
+
145
+ # Where do I create templates ?
146
+
147
+ **When an entity is [buildable] you can find its templates in the `<entity_type>/<entity_name>` from the root of the project.**
148
+
149
+ But by default, that directory is not created, and if no templates is created at this place for a [buildable] entity, the build will fail saying it didn't find any template...
150
+
151
+ Yet, you probably noticed that when we created an entity of `simple_exec` type, a file (the bash script `main.sh`) _automagically_ appeared in the right place so that we could immediatelly build it. How can you achieve that with entity types of your own ? **This is what is called _templates-templates_**...
152
+
153
+ First let's have a look at the output of `power_stencil info`, focusing on `simple_exec`:
154
+
155
+ ```shell
156
+ $ power_stencil info
157
+ .
158
+ .
159
+ .
160
+ - 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')
161
+ ```
162
+
163
+ `simple_exec` is an entity type coming with `PowerStencil`, and you can see that it takes its _template-template_ from within the `PowerStencil` gem itself !
164
+
165
+ But within the `PowerStencil` project, there is a place to create _templates-templates_ of your own: `.ps_projet/templates-templates/<entity_type>`.
166
+
167
+ To summarize about templates and _templates-templates_:
168
+ ![entity-creation-flow]
169
+
170
+ :information_source: There is actually a third place where you could find entity types and _templates-templates_, this is within [plugins], but we will cover that in the [plugins] part...
171
+
172
+ # Creating templates-templates of your own
173
+
174
+ ## basics
175
+
176
+ Let's imagine we have a custom buildable entity type defined in `.ps_project/entity_definitions/custom_buildable_entity.rb` and which content is:
177
+
178
+ ```ruby
179
+ class CustomBuildableEntity < PowerStencil::SystemEntityDefinitions::ProjectEntity
180
+ entity_type :custom_buildable_entity
181
+ buildable
182
+ end
183
+ ```
184
+ We could have (useless) _templates-templates_ defined in `.ps_project/templates-templates/custom_buildable_entity`.
185
+
186
+ :information_source: A whole tree structure can be defined there, not only one file.
187
+
188
+ Let's create there a text file named `a_useless_text_file.txt` with the following content:
189
+
190
+ ```
191
+ This text has been generated on the <%= Time.now %>
192
+
193
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
194
+ sed do eiusmod tempor incididunt ....
195
+ ```
196
+
197
+ Let's now create an entity of this type:
198
+
199
+ ```shell
200
+ $ power_stencil create custom_buildable_entity/test1
201
+ Created 'custom_buildable_entity/test1'
202
+
203
+ $ ll custom_buildable_entity/test1
204
+ total 12
205
+ drwxrwxr-x 2 laurent laurent 4096 août 26 13:40 ./
206
+ drwxrwxr-x 3 laurent laurent 4096 août 26 13:40 ../
207
+ -rw-rw-r-- 1 laurent laurent 26 août 26 13:40 a_useless_text_file.txt
208
+ ```
209
+ Everything, seems ok. The entity `custom_buildable_entity/test1` has been created and there is now a new folder at the root of the project named `custom_buildable_entity/test1` and which content is a text file named `a_useless_text_file.txt`... So far so good.
210
+
211
+ And what is the content of this file ?
212
+
213
+ ```shell
214
+ $ cat custom_buildable_entity/test1/a_useless_text_file.txt
215
+ This text has been generated on the 2019-08-26 13:50:35 +0200
216
+
217
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
218
+ sed do eiusmod tempor incididunt ....
219
+ ```
220
+
221
+ **Oops !!** It looks like the _template-template_ content has been processed as templates and the `<%= Time.now %>` code has been replaced by its result. This is not **at all** what we could have expected !! The idea was that the entity type template (the _template-template_) would become the entity template, ready for the build...
222
+
223
+ **:warning: In `PowerStencil`, the concept is that everywhere there is a template defined (and _templates-templates_ are), they are really treated as templates unless you explicitely say the opposite !**
224
+
225
+ So, how can we avoid that, so that the _templates-templates_ are not processed as templates ?
226
+
227
+ A bad answer would be to have [ERB] code to generate [ERB] tags and code... :scream: (although sometimes in very specific cases you may really want to do that).
228
+
229
+ No in this case we would like the _template-template_ to be simply not processed as a template. There is a solution for that _.xxx_ignore files_...
230
+
231
+ ## `.xxx_ignore` files
232
+
233
+ When any file is processed using the `PowerStencil` framework to generate another file, there are 3 operations/checks that are always applied:
234
+
235
+ 1. Is the file eligible to the process (ie should it be completely ignored by the process) ?
236
+ 2. Is the file eligible to the templating process ?
237
+ 3. Should the file be renamed ?
238
+
239
+ This is managed through a set of files that work the same way `.git_ignore` files work for Git. You can have those files anywhere within the tree of files that are processed.
240
+
241
+ Their syntax is very simple. Each line can either be:
242
+
243
+ - an empty line
244
+ - a comment line starting with `#`
245
+ - a line specifying a [Dir::glob pattern]
246
+
247
+ As you probably now guessed, there are three different `.xxx_ignore` types of files available:
248
+
249
+ - the `.copy_ignore` file will define which files should be completely ignored by the process. A good example would be for example a README file describing what is in the directory, but that you don't want to copy. Those files are simply ignored.
250
+ - the `.subst_ignore` file will define which files should be copied as-is and not processed as templates.
251
+ - later in the process files could be renamed (for example, by default `.erb` files see their `.erb` extension removed, but sometimes you may not want this to happen). The `.rename_ignore` file will define which files should not be renamed.
252
+
253
+ This feature is actually coming from the [dir_glob_ignore] Gem.
254
+
255
+ ## Application to our example
256
+
257
+ Let's come back to [our example](#basics), and create the relevant `.xxx_ignore` files.
258
+
259
+ First we don't want the `.ps_project/templates-templates/custom_buildable_entity/a_useless_text_file.txt` to be considered as a template. So let's create the `.ps_project/templates-templates/custom_buildable_entity/.subst_ignore` file with the following content:
260
+
261
+ ```ignore
262
+ # Ignore everything in this directory and sub folders
263
+ **
264
+ ```
265
+
266
+ But if we let things like that, the `.subst_ignore` would not be processed by the templating engine (because it matches `**` from a `Dir::glob` point of view), but would be copied. And we don't want that !
267
+ So let's create a `.ps_project/templates-templates/custom_buildable_entity/.copy_ignore` with the following content:
268
+
269
+ ```ignore
270
+ # This files should not be processed at all
271
+ .subst_ignore
272
+ .copy_ignore
273
+ ```
274
+
275
+ Et voilà, let's verify:
276
+
277
+ ```shell
278
+ $ power_stencil create custom_buildable_entity/test2
279
+ Created 'custom_buildable_entity/test2'
280
+
281
+ $ ls -la custom_buildable_entity/test2
282
+ total 12
283
+ drwxrwxr-x 2 laurent laurent 4096 août 26 18:37 .
284
+ drwxrwxr-x 4 laurent laurent 4096 août 26 18:37 ..
285
+ -rw-rw-r-- 1 laurent laurent 148 août 26 18:37 a_useless_text_file.txt
286
+
287
+ $ cat custom_buildable_entity/test2/a_useless_text_file.txt
288
+ This text has been generated on the <%= Time.now %>
289
+
290
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
291
+ sed do eiusmod tempor incididunt ....
292
+ ```
293
+ :+1: Success ! None of the `.xxx_ignore` files are in the resulting folder, and the `custom_buildable_entity/test2/a_useless_text_file.txt` has not been processed, ready for the [build process][builds]. We can verify this too:
294
+
295
+ ```shell
296
+ $ power_stencil build custom_buildable_entity/test2 -v
297
+ De-templating files for 'custom_buildable_entity/test2' into '/tmp/tst3/build/20190826-1842-27501-custom_buildable_entity_test2/custom_buildable_entity_test2'
298
+ Entities analysis completed.
299
+ - 'custom_buildable_entity/test2' has been correctly built
300
+
301
+ $ cat /tmp/tst3/build/20190826-1842-27501-custom_buildable_entity_test2/custom_buildable_entity_test2/a_useless_text_file.txt
302
+ This text has been generated on the 2019-08-26 18:42:27 +0200
303
+
304
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
305
+ sed do eiusmod tempor incididunt ....
306
+
307
+ ```
308
+ Flawless victory !!
309
+
310
+ [:back:][Documentation root]
311
+ <!-- End of Document -->
312
+
313
+ <!-- Pages -->
314
+ [Documentation root]: ../README.md "Back to documentation root"
315
+ [entities]: entities.md "Entities in PowerStencil"
316
+ [builds]: builds.md "Builds in PowerStencil"
317
+ [plugins]: plugins.md "Plugins in PowerStencil"
318
+ [example use cases]: example_use_cases.md "Example uses cases using PowerStencil"
319
+ [buildable]: entities.md#buildable--buildable_by "How to make an entity buildable ?"
320
+
321
+ <!-- Code links -->
322
+
323
+
324
+ <!-- Illustrations -->
325
+ [entity-creation-flow]: images/power-stencil-entity-creation.svg
326
+
327
+ <!-- External links -->
328
+ [ERB]: https://ruby-doc.org/stdlib-2.6.3/libdoc/erb/rdoc/ERB.html "Quick ERB description"
329
+ [Ruby On Rails]: https://rubyonrails.org/ "One of the best Web framework"
330
+ [Ruby]: https://www.ruby-lang.org "The powerful Ruby language"
331
+ [Dir::glob pattern]: https://ruby-doc.org/core-2.6.3/Dir.html#method-c-glob "Ruby documentation"
332
+ [dir_glob_ignore]: https://gitlab.com/lbriais/dir_glob_ignore "An extension to the Ruby `Dir::glob` feature"