power_stencil 0.3.1

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.
Files changed (132) 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 +198 -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-entity-build.svg +481 -0
  17. data/doc/images/power-stencil-entity-creation.svg +375 -0
  18. data/doc/images/power-stencil-simple-flow.svg +265 -0
  19. data/doc/plugins.md +169 -0
  20. data/doc/templates.md +333 -0
  21. data/etc/base_commands_definition.yml +259 -0
  22. data/etc/meta_templates/plugin_seed/etc/command_line.yaml +12 -0
  23. data/etc/meta_templates/plugin_seed/etc/plugin_config.yaml +4 -0
  24. data/etc/meta_templates/plugin_seed/etc/templates/.git_keep +0 -0
  25. data/etc/meta_templates/plugin_seed/lib/{entity}.rb.erb +34 -0
  26. data/etc/meta_templates/plugin_seed/lib/{entity}/entity_definitions/{entity}_entity.rb.erb +11 -0
  27. data/etc/meta_templates/plugin_seed/lib/{entity}/plugin_helper.rb.erb +17 -0
  28. data/etc/meta_templates/plugin_seed/lib/{entity}/version.rb.erb +3 -0
  29. data/etc/meta_templates/plugin_seed/lib/{entity}/{entity}_processor.rb.erb +19 -0
  30. data/etc/meta_templates/plugin_seed/psplugin_{entity}.gemspec +36 -0
  31. data/etc/power_stencil.yaml +92 -0
  32. data/etc/templates/plugin_definition/.gitignore +11 -0
  33. data/etc/templates/plugin_definition/.rspec +3 -0
  34. data/etc/templates/plugin_definition/.travis.yml +5 -0
  35. data/etc/templates/plugin_definition/CODE_OF_CONDUCT.md +74 -0
  36. data/etc/templates/plugin_definition/Gemfile +6 -0
  37. data/etc/templates/plugin_definition/LICENSE.txt +21 -0
  38. data/etc/templates/plugin_definition/README.md +43 -0
  39. data/etc/templates/plugin_definition/Rakefile +6 -0
  40. data/etc/templates/plugin_definition/bin/console +14 -0
  41. data/etc/templates/plugin_definition/bin/setup +8 -0
  42. data/etc/templates/plugin_definition/etc/command_line.yaml +12 -0
  43. data/etc/templates/plugin_definition/etc/plugin_config.yaml +4 -0
  44. data/etc/templates/plugin_definition/etc/templates/.git_keep +1 -0
  45. data/etc/templates/plugin_definition/lib/{entity}.rb.erb +34 -0
  46. data/etc/templates/plugin_definition/lib/{entity}/entity_definitions/{entity}_entity.rb.erb +11 -0
  47. data/etc/templates/plugin_definition/lib/{entity}/plugin_helper.rb.erb +17 -0
  48. data/etc/templates/plugin_definition/lib/{entity}/version.rb.erb +3 -0
  49. data/etc/templates/plugin_definition/lib/{entity}/{entity}_processor.rb.erb +19 -0
  50. data/etc/templates/plugin_definition/psplugin_{entity}.gemspec +36 -0
  51. data/etc/templates/plugin_definition/spec/spec_helper.rb +14 -0
  52. data/etc/templates/plugin_definition/spec/{entity}_spec.rb +9 -0
  53. data/etc/templates/project/.copy_ignore +2 -0
  54. data/etc/templates/project/.gitignore.erb +6 -0
  55. data/etc/templates/project/.ps_project/entities/.gitkeep +0 -0
  56. data/etc/templates/project/.ps_project/entities/README.md +11 -0
  57. data/etc/templates/project/.ps_project/entity_definitions/.gitkeep +0 -0
  58. data/etc/templates/project/.ps_project/entity_definitions/README.md +15 -0
  59. data/etc/templates/project/.ps_project/personal-config.yaml +8 -0
  60. data/etc/templates/project/.ps_project/plugins/.gitkeep +0 -0
  61. data/etc/templates/project/.ps_project/templates-templates/.gitkeep +0 -0
  62. data/etc/templates/project/.ps_project/templates-templates/README.md +13 -0
  63. data/etc/templates/project/.ps_project/user_entities/.gitkeep +0 -0
  64. data/etc/templates/project/.ps_project/user_entities/README.md +12 -0
  65. data/etc/templates/project/.ps_project/versioned-config.yaml +6 -0
  66. data/etc/templates/simple_exec/main.sh +4 -0
  67. data/exe/power_stencil +28 -0
  68. data/lib/power_stencil.rb +53 -0
  69. data/lib/power_stencil/command_processors/build.rb +43 -0
  70. data/lib/power_stencil/command_processors/check.rb +35 -0
  71. data/lib/power_stencil/command_processors/create.rb +70 -0
  72. data/lib/power_stencil/command_processors/delete.rb +38 -0
  73. data/lib/power_stencil/command_processors/edit.rb +35 -0
  74. data/lib/power_stencil/command_processors/entity_helper.rb +105 -0
  75. data/lib/power_stencil/command_processors/get.rb +22 -0
  76. data/lib/power_stencil/command_processors/info.rb +41 -0
  77. data/lib/power_stencil/command_processors/init.rb +47 -0
  78. data/lib/power_stencil/command_processors/new_plugin.rb +31 -0
  79. data/lib/power_stencil/command_processors/root.rb +27 -0
  80. data/lib/power_stencil/command_processors/shell.rb +37 -0
  81. data/lib/power_stencil/command_processors/trace_helper.rb +20 -0
  82. data/lib/power_stencil/dsl/base.rb +24 -0
  83. data/lib/power_stencil/dsl/entities.rb +46 -0
  84. data/lib/power_stencil/dsl/plugin_generation.rb +17 -0
  85. data/lib/power_stencil/engine/base.rb +50 -0
  86. data/lib/power_stencil/engine/build_handling.rb +77 -0
  87. data/lib/power_stencil/engine/directory_processor.rb +111 -0
  88. data/lib/power_stencil/engine/entities_definitions.rb +42 -0
  89. data/lib/power_stencil/engine/entities_handling.rb +76 -0
  90. data/lib/power_stencil/engine/entity_engine.rb +20 -0
  91. data/lib/power_stencil/engine/init_engine.rb +18 -0
  92. data/lib/power_stencil/engine/project_engine.rb +75 -0
  93. data/lib/power_stencil/engine/renderers/erb.rb +21 -0
  94. data/lib/power_stencil/error.rb +20 -0
  95. data/lib/power_stencil/initializer.rb +87 -0
  96. data/lib/power_stencil/plugins/base.rb +54 -0
  97. data/lib/power_stencil/plugins/capabilities.rb +30 -0
  98. data/lib/power_stencil/plugins/command_line.rb +27 -0
  99. data/lib/power_stencil/plugins/config.rb +32 -0
  100. data/lib/power_stencil/plugins/dependencies.rb +32 -0
  101. data/lib/power_stencil/plugins/gem.rb +57 -0
  102. data/lib/power_stencil/plugins/require.rb +77 -0
  103. data/lib/power_stencil/plugins/templates.rb +21 -0
  104. data/lib/power_stencil/project/base.rb +79 -0
  105. data/lib/power_stencil/project/config.rb +54 -0
  106. data/lib/power_stencil/project/create.rb +30 -0
  107. data/lib/power_stencil/project/info.rb +72 -0
  108. data/lib/power_stencil/project/paths.rb +119 -0
  109. data/lib/power_stencil/project/plugins.rb +89 -0
  110. data/lib/power_stencil/project/proxy.rb +13 -0
  111. data/lib/power_stencil/project/templates.rb +56 -0
  112. data/lib/power_stencil/project/versioning.rb +29 -0
  113. data/lib/power_stencil/system_entity_definitions/all.rb +14 -0
  114. data/lib/power_stencil/system_entity_definitions/buildable.rb +23 -0
  115. data/lib/power_stencil/system_entity_definitions/entity_override.rb +8 -0
  116. data/lib/power_stencil/system_entity_definitions/entity_project_common.rb +33 -0
  117. data/lib/power_stencil/system_entity_definitions/has_associated_files.rb +13 -0
  118. data/lib/power_stencil/system_entity_definitions/non_persistent.rb +14 -0
  119. data/lib/power_stencil/system_entity_definitions/plugin.rb +17 -0
  120. data/lib/power_stencil/system_entity_definitions/process_descriptor.rb +15 -0
  121. data/lib/power_stencil/system_entity_definitions/project_config.rb +24 -0
  122. data/lib/power_stencil/system_entity_definitions/project_entity.rb +16 -0
  123. data/lib/power_stencil/system_entity_definitions/simple_exec.rb +47 -0
  124. data/lib/power_stencil/utils/directory_processor.rb +54 -0
  125. data/lib/power_stencil/utils/file_edit.rb +87 -0
  126. data/lib/power_stencil/utils/file_helper.rb +56 -0
  127. data/lib/power_stencil/utils/gem_utils.rb +13 -0
  128. data/lib/power_stencil/utils/secure_require.rb +26 -0
  129. data/lib/power_stencil/utils/semantic_version.rb +128 -0
  130. data/lib/power_stencil/version.rb +3 -0
  131. data/power_stencil.gemspec +32 -0
  132. metadata +287 -0
@@ -0,0 +1,259 @@
1
+ :options:
2
+ verbose:
3
+ :type: bool
4
+ :summary: Displays extra runtime information.
5
+ :global: true
6
+ :short_aliases:
7
+ - v
8
+ help:
9
+ :type: bool
10
+ :summary: Displays this help.
11
+ :global: true
12
+ :short_aliases:
13
+ - h
14
+ version:
15
+ :type: bool
16
+ :summary: Displays program version.
17
+ :short_aliases:
18
+ - V
19
+ :long_aliases:
20
+ - program-version
21
+ simulate:
22
+ :type: bool
23
+ :global: true
24
+ :summary: Will not perform actual actions
25
+ debug:
26
+ :type: bool
27
+ :summary: Debug mode
28
+ :global: true
29
+ debug-on-stderr:
30
+ :type: bool
31
+ :global: true
32
+ :summary: Sends debugging to SDTERR
33
+ :long_aliases:
34
+ - debug-on-err
35
+ :dependencies:
36
+ - debug
37
+ :incompatibilities:
38
+ - log-file
39
+ log-level:
40
+ :global: true
41
+ :dependencies:
42
+ - debug
43
+ :type: integer
44
+ :summary: Defines the level of logging (0 to 5)
45
+ log-file:
46
+ :global: true
47
+ :dependencies:
48
+ - debug
49
+ :incompatibilities:
50
+ - debug-on-stderr
51
+ :type: string
52
+ :summary: Specifies a file to log into
53
+ truncate-log-file:
54
+ :global: true
55
+ :dependencies:
56
+ - log-file
57
+ :type: bool
58
+ :summary: Truncates the log file (appends by default)
59
+ project-path:
60
+ :global: true
61
+ :type: string
62
+ :summary: Specifies a startup path to use instead of '.'
63
+ auto:
64
+ :global: true
65
+ :type: bool
66
+ :summary: Bypasses command-line confirmations to the user
67
+
68
+ :banner: |
69
+ This is power_stencil. A powerful templating engine.
70
+
71
+ :subcommands:
72
+ init:
73
+ :banner: |
74
+ Initializes a PowerStencil repository.
75
+
76
+ Usage:
77
+ init [project_path] [options]
78
+
79
+ Default is initializing the PowerStencil repository in current directory. If
80
+ specified, will initialize a repository in project_path (global option
81
+ project_path can be used too).
82
+ :options:
83
+ force:
84
+ :type: bool
85
+ :summary: Forces creation in an already existing directory.
86
+ :short_aliases:
87
+ - f
88
+ info:
89
+ :banner: |
90
+ Generic information about the repository.
91
+
92
+ Usage:
93
+ info [options]
94
+
95
+ Displays information about the repository.
96
+ new-plugin:
97
+ :banner: |
98
+ Generates the skeleton for a plugin.
99
+
100
+ Usage:
101
+ new-plugin [options]
102
+
103
+ Generates a fully working although useless plugin skeleton.
104
+ get:
105
+ :banner: |
106
+ Query entities from repository.
107
+
108
+ Usage:
109
+
110
+ get [entity_type[/ ]entity_name] [options]
111
+
112
+ Retrieves entities from the repostory. You can have multiple
113
+ criteria passed on the command line. either of the form
114
+ "type/name" or two consecutive parameters "type name". If in
115
+ "regexp" mode then each criterion is considered as a regular
116
+ expression (be careful, not a file pattern alike)
117
+ :options:
118
+ regexp: &REGEXPOPT
119
+ :type: bool
120
+ :summary: Parameters are considered as regular expressions.
121
+ :short_aliases:
122
+ - r
123
+ :long_aliases:
124
+ - regular-expression
125
+ names-only:
126
+ :type: bool
127
+ :summary: Only returns the name of the entities found.
128
+ compiled: &COMPILEDOPT
129
+ :type: bool
130
+ :summary: Entities as used by susbstitution engine.
131
+ scenario: &SCENARIOOPT
132
+ :type: string
133
+ :summary: Applies overrides defined for this scenario.
134
+ :dependencies:
135
+ - compiled
136
+ raw:
137
+ :type: bool
138
+ :summary: Displays entities as they are stored
139
+ graph:
140
+ :type: bool
141
+ :summary: Displays the query result as a graph.
142
+ :short_aliases:
143
+ - g
144
+ shell:
145
+ :banner: |
146
+ Opens a shell to interact with entities.
147
+
148
+ Usage:
149
+ shell [options]
150
+
151
+ Opens a Ruby "pry" shell with all entities loaded. You can modify
152
+ create, delete any entity from there.
153
+ :options:
154
+ compiled:
155
+ <<: *COMPILEDOPT
156
+ scenario:
157
+ <<: *SCENARIOOPT
158
+ check:
159
+ :banner: |
160
+ Check repository entities consistency.
161
+
162
+ Usage:
163
+
164
+ check [entity_type[[/ ]entity_name]] [options]
165
+
166
+ Check entities consistency. By default will check all entities.
167
+ :options:
168
+ regexp:
169
+ <<: *REGEXPOPT
170
+ create:
171
+ :banner: |
172
+ Creates entities in the repository.
173
+
174
+ Usage:
175
+
176
+ create entity_type[/ ]entity_name [options]
177
+
178
+ Creates repository entities. Both type and name have to be provided
179
+ :options:
180
+ property:
181
+ :type: array
182
+ :summary: Specifiies a first-level property for the entity
183
+ :short_aliases:
184
+ - p
185
+ edit:
186
+ :type: bool
187
+ :summary: Edits the newly created entity.
188
+ :short_aliases:
189
+ - e
190
+ :long_aliases:
191
+ - edit-after-create
192
+ editor:
193
+ :type: string
194
+ :summary: Specifies an editor to use.
195
+ :dependencies:
196
+ - edit
197
+ user:
198
+ :type: bool
199
+ :summary: Stores the entities as local user entities, ie non-versioned
200
+ :long_aliases:
201
+ - user-storage
202
+ - non-versioned
203
+ :short_aliases:
204
+ - u
205
+ edit:
206
+ :banner: |
207
+ Edit entities from repository.
208
+
209
+ Usage:
210
+
211
+ edit [object_type[[/ ]object_name]] [options]
212
+
213
+ Edits repository entities. Parameters are used the same way as in 'get'.
214
+ :options:
215
+ regexp: *REGEXPOPT
216
+ editor:
217
+ :type: string
218
+ :summary: Specifies an editor to use.
219
+ :short_aliases:
220
+ - e
221
+ delete:
222
+ :banner: |
223
+ Delete entities from repository.
224
+
225
+ Usage:
226
+
227
+ delete [object_type[[/ ]object_name]] [options]
228
+
229
+ Deletes repository entities. Parameters are used the same way as in 'get'.
230
+ :options:
231
+ regexp: *REGEXPOPT
232
+ delete-files:
233
+ :type: bool
234
+ :summary: Will also remove files related to the entity.
235
+ build:
236
+ :banner: |
237
+ Builds entities.
238
+
239
+ Usage:
240
+
241
+ build [entity_type[[/ ]entity_name]]+ [options]
242
+
243
+ Builds repository entities. Parameters are used the same way as in 'get'.
244
+ :options:
245
+ regexp: *REGEXPOPT
246
+ supported-builds:
247
+ :type: bool
248
+ :summary: Displays the list of supported builds
249
+ :short_aliases:
250
+ - s
251
+ :long_aliases:
252
+ - list
253
+ fail-on-error:
254
+ :type: bool
255
+ :summary: Fails at the first failure
256
+ parallelized:
257
+ :type: bool
258
+ :summary: Parallelizes builds if possible
259
+
@@ -0,0 +1,12 @@
1
+ # This is an example
2
+ # With this file, you can contribute to the power_stencil
3
+ # command-line global semantic
4
+ :subcommands:
5
+ <%= main_entry_point %>:
6
+ :banner: |
7
+ Does nothing useful
8
+ Added by plugin <%= plugin_name %>
9
+ :options:
10
+ hello:
11
+ :type: bool
12
+ :summary: Just a hello flag.
@@ -0,0 +1,4 @@
1
+ # This config file provided by the plugin '<%= main_entry_point %>' will be
2
+ # automatically merged into the global project config
3
+
4
+ # :<%= plugin_name %>.property1: value 1
@@ -0,0 +1,34 @@
1
+ require '<%= plugin_name %>/version'
2
+ require '<%= plugin_name %>/plugin_helper'
3
+ require '<%= plugin_name %>/<%= plugin_name %>_processor'
4
+
5
+ module <%= plugin_module_name %>
6
+
7
+ extend PowerStencil::Utils::SecureRequire
8
+ extend <%= plugin_module_name %>::PluginHelper
9
+
10
+ REQUIRED_PLUGINS = []
11
+
12
+ def self.setup_processors
13
+ clm = PowerStencil.command_line_manager
14
+ clm.register_processor clm.command_by_alias('<%= main_entry_point %>'), <%= plugin_module_name %>::Processor.new
15
+ end
16
+
17
+ def self.setup_entity_definitions
18
+ PowerStencil.logger.info 'Setting up <%= main_entry_point %> plugin entities'
19
+ securely_require '<%= plugin_name %>/entity_definitions/<%= plugin_name %>_entity', fail_on_error: true
20
+ end
21
+
22
+ def self.setup_plugin_templates
23
+ Dir.entries(plugin_templates_path).reject { |e| %w(. ..).include? e }.each do |entry|
24
+ template_path = File.join(plugin_templates_path, entry)
25
+ if Dir.exist? template_path
26
+ PowerStencil.project.register_template_path_for_type entry.to_sym, template_path
27
+ end
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ # All plugins have to be in the PowerStencil::Plugin namespace !
34
+ PowerStencil::Plugin::<%= plugin_module_name %> = <%= plugin_module_name %>
@@ -0,0 +1,11 @@
1
+ module <%= plugin_module_name %>
2
+ module EntityDefinitions
3
+
4
+ class <%= plugin_module_name %>Entity < PowerStencil::SystemEntityDefinitions::ProjectEntity
5
+
6
+ entity_type :<%= plugin_name %>_entity
7
+
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ module <%= plugin_module_name %>
2
+ module PluginHelper
3
+
4
+ def plugin_templates_path
5
+ File.join plugin_root_path, 'etc', 'templates'
6
+ end
7
+
8
+ def command_line_definition_file_path
9
+ File.join plugin_root_path, 'etc', 'command_line.yaml'
10
+ end
11
+
12
+ def plugin_root_path
13
+ File.expand_path File.join('..', '..', '..'), __FILE__
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module <%= plugin_module_name %>
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,19 @@
1
+ module <%= plugin_module_name %>
2
+
3
+ class Processor
4
+
5
+ include Climatic::Script::UnimplementedProcessor
6
+ include Climatic::Proxy
7
+ include PowerStencil::Project::Proxy
8
+
9
+
10
+ def execute
11
+ puts '<%= main_entry_point.upcase %> PLUGIN WAZ HERE'
12
+ puts_and_logs config[].to_yaml
13
+ end
14
+
15
+
16
+ end
17
+
18
+
19
+ end
@@ -0,0 +1,36 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require '<%= plugin_name %>/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'psplugin_<%= plugin_name %>'
8
+ spec.version = <%= plugin_module_name %>::VERSION
9
+ spec.authors = ['Your name']
10
+ spec.email = ['you@somewhere']
11
+
12
+ spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
13
+ spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ else
22
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = 'exe'
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ['lib']
31
+
32
+ spec.add_development_dependency 'bundler', '~> 1.16'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'rspec', '~> 3.0'
35
+ spec.add_development_dependency 'power_stencil', "~> #{<%= plugin_module_name %>::VERSION}"
36
+ end
@@ -0,0 +1,92 @@
1
+ ---
2
+ # This file defines `power_stencil` executable defaults.
3
+ # It can be overridden via various mechanisms (mainly coming from
4
+ # the `climatic` gem), so system-wide config file, user config file,
5
+ # executable config file, project config file or for some of the
6
+ # properties directly from command line.
7
+
8
+
9
+ # PROJECT PATHS
10
+
11
+ # Default Power Stencil project configuration directory
12
+ :default_config_directory_name: .ps_project
13
+ # Ignore files for files/directory to completely skip in the process
14
+ :ignore_filename_for_files_to_skip: .copy_ignore
15
+ # Ignore files for files/directory to simply copy and apply no substitution
16
+ :ignore_filename_for_files_to_copy: .subst_ignore
17
+ # Ignore files for files/directory to simply copy and apply no renaming (see
18
+ # below :file_renaming_patterns: for more info)
19
+ :ignore_filename_for_files_to_rename: .rename_ignore
20
+ # Versioned project config file name.
21
+ :versioned_project_config_file_name: versioned-config.yaml
22
+ # Non versioned user's personal project config file name.
23
+ :unversioned_user_project_config_file_name: personal-config.yaml
24
+ # Entity definitions specific to the project
25
+ :project_entity_definitions_directory_name: entity_definitions
26
+ # Templates specific to the project
27
+ :project_templates_directory_name: templates-templates
28
+ # Directory name where entities are stored
29
+ :project_entities_directory_name: entities
30
+ # Directory name where user (unversioned) entities are stored
31
+ :user_entities_directory_name: user_entities
32
+ # Directory name where repository plugins are stored
33
+ :project_plugins_directory_name: plugins
34
+ # Root directory where builds are generated
35
+ :project_build_root_directory_name: build
36
+
37
+
38
+ # DSL CUSTOMIZATIONS
39
+
40
+ # Customizations for the shell. Basically defining various behaviors
41
+ # of Pry which is the underlying REPL.
42
+ :shell_dsl:
43
+ :prompt_level_1: 'PowerStencil DSL> '
44
+ :prompt_level_2: 'PowerStencil DSL --> '
45
+ :session_greetings: |
46
+ -------------------------------------------------------------------------------
47
+ Welcome to the PowerStencil shell session
48
+ In this shell you have access to anything the templating engine has access to.
49
+ You can view, edit, save entities.
50
+
51
+ - Retrieve and manipulate entities using the `entities` hash.
52
+ - Persist your changes using the `save` method on each entity.
53
+ - Create new project or user entities using `new_<type>` and `user_new_<type>`
54
+ methods (see `available_entity_types` for a list of possible types).
55
+ - And of course, it is a fully fledged Ruby Pry REPL, so you can do anything
56
+ you want...
57
+
58
+ Type `exit` to end your session.
59
+ -------------------------------------------------------------------------------
60
+
61
+
62
+
63
+ # TEMPLATING ENGINE
64
+
65
+ # Map to define which kind of template engine for which type of file. Be careful if you
66
+ # overlap two definitions. Warning, it is ruby Regex not shell pattern !
67
+ :templating_engines_map:
68
+ # Currently all files are rendered using ERB engine
69
+ :erb: '.*'
70
+
71
+ # Files matching particular patterns can be changed on the fly
72
+ :file_renaming_patterns:
73
+ # Erb files
74
+ ^(.+)\.erb$: '\1'
75
+
76
+
77
+ # PLUGINS
78
+
79
+ # Define the property to avoid a nil. It represents the plugins that are provided
80
+ # as real Ruby gems. Local plugins defined in the `:project_plugins_directory_name:`
81
+ # are automatically discovered and loaded.
82
+ :project_plugins: []
83
+
84
+
85
+
86
+ # MISC
87
+
88
+ # Default log level (warn)
89
+ :log-level: 2
90
+ # Maximum number of retries when editing a file
91
+ :max_file_edit_retry_times: 3
92
+