power_stencil 0.6.0 → 0.6.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.
- checksums.yaml +4 -4
- data/lib/power_stencil/command_processors/build.rb +1 -1
- data/lib/power_stencil/command_processors/create.rb +1 -1
- data/lib/power_stencil/command_processors/delete.rb +5 -5
- data/lib/power_stencil/command_processors/init.rb +2 -2
- data/lib/power_stencil/command_processors/root.rb +1 -1
- data/lib/power_stencil/engine/build_handling.rb +1 -2
- data/lib/power_stencil/engine/directory_processor.rb +6 -1
- data/lib/power_stencil/plugins/base.rb +3 -1
- data/lib/power_stencil/plugins/capabilities.rb +9 -4
- data/lib/power_stencil/project/plugins.rb +6 -7
- data/lib/power_stencil/version.rb +1 -1
- data/power_stencil.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 687808cf09467280d9b69cc408051a26c27910f1
|
4
|
+
data.tar.gz: 30ab8477a45c06b3263b8eaeeabf013b8641830c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6839ca4af2d78718eaf88c378c424109f9bc5f8cab5ef1ab944ee01a1a437fcb85304638c2d46196f8690d502cee40698416caaa0ef1492676363ee0220db2a5
|
7
|
+
data.tar.gz: f448a6a57f64bd209f9682f94581ad9fbd19433ad51a46e8fd6bbcc6aeaadedb4de5a6d1bccd21b1833eba6f4e0ffb94061acbc677360d131d6cff77ba7fa6f2
|
@@ -37,7 +37,7 @@ module PowerStencil
|
|
37
37
|
if entity_report == ['Ok']
|
38
38
|
puts " - '#{entity_full_name}' has been correctly built"
|
39
39
|
else
|
40
|
-
|
40
|
+
puts_and_logs " - Failed to build '#{entity_full_name}' because #{entity_report.join}", logs_as: :error, check_verbose: false
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -12,7 +12,7 @@ module PowerStencil
|
|
12
12
|
def execute
|
13
13
|
analyse_extra_params.each do |search_criterion|
|
14
14
|
begin
|
15
|
-
puts_and_logs "Creating new entity '#{search_criterion.as_path}'"
|
15
|
+
puts_and_logs "Creating new entity '#{search_criterion.as_path}'", check_verbose: false
|
16
16
|
entity_as_hash = {name: search_criterion.name}
|
17
17
|
unless config[:property].nil?
|
18
18
|
config[:property].each do |property_def|
|
@@ -12,21 +12,21 @@ module PowerStencil
|
|
12
12
|
analyse_extra_params.each do |search_criterion|
|
13
13
|
begin
|
14
14
|
unless project.engine.entity *search_criterion.to_a, project.engine.root_universe
|
15
|
-
|
15
|
+
puts_and_logs "Skipping '#{search_criterion.as_path}'. Entity not found.", check_verbose: false
|
16
16
|
next
|
17
17
|
end
|
18
|
-
puts_and_logs "Deleting entity '#{search_criterion.as_path}'"
|
18
|
+
puts_and_logs "Deleting entity '#{search_criterion.as_path}'", check_verbose: false
|
19
19
|
if project.engine.delete_entity project.engine.root_universe,
|
20
20
|
*search_criterion.to_a,
|
21
21
|
delete_files: config[:'delete-files']
|
22
22
|
msg = "Deleted '#{search_criterion.as_path}'"
|
23
23
|
msg << ' and associated files.' if config[:'delete-files']
|
24
|
-
|
24
|
+
puts_and_logs msg, check_verbose: false
|
25
25
|
else
|
26
|
-
|
26
|
+
puts_and_logs 'Cancelled by user input.', check_verbose: false
|
27
27
|
end
|
28
28
|
rescue => e
|
29
|
-
|
29
|
+
puts_and_logs "Failed to delete '#{search_criterion.as_path}' with message '#{e.message}'.", logs_as: :error, check_verbose: false
|
30
30
|
logger.debug PowerStencil::Error.report_error(e)
|
31
31
|
end
|
32
32
|
end
|
@@ -15,9 +15,9 @@ module PowerStencil
|
|
15
15
|
def execute
|
16
16
|
setup_project_path
|
17
17
|
log_startup_context
|
18
|
-
puts_and_logs "Creating new project structure in '#{config[:'project-path']}'"
|
18
|
+
puts_and_logs "Creating new project structure in '#{config[:'project-path']}'", check_verbose: false
|
19
19
|
PowerStencil::Project::Base.create_project_tree config[:'project-path']
|
20
|
-
puts_and_logs 'Done.'
|
20
|
+
puts_and_logs 'Done.', check_verbose: false
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -18,7 +18,7 @@ module PowerStencil
|
|
18
18
|
unless config.command_line_layer.extra_parameters.empty?
|
19
19
|
raise PowerStencil::Error, "Invalid command '#{config.command_line_layer.extra_parameters.first}'"
|
20
20
|
end
|
21
|
-
puts_and_logs 'No action specified. Exiting...'
|
21
|
+
puts_and_logs 'No action specified. Exiting...', check_verbose: false
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
@@ -39,8 +39,7 @@ module PowerStencil
|
|
39
39
|
build_entity entity_to_build, build_entity_target_path
|
40
40
|
|
41
41
|
entity_build_report << 'Ok'
|
42
|
-
rescue => e
|
43
|
-
logger.error "Failed building '#{entity_to_build.as_path}' because '#{e.message}' !"
|
42
|
+
rescue SyntaxError, StandardError => e
|
44
43
|
entity_build_report << e.message
|
45
44
|
if fail_on_error
|
46
45
|
raise e
|
@@ -97,7 +97,12 @@ module PowerStencil
|
|
97
97
|
raise PowerStencil::Error, "File '#{source}' is supposed to be rendered using '#{engine_name}', but seems not to be supported !"
|
98
98
|
end
|
99
99
|
context = running_context universe, main_entry_point: main_entry_point
|
100
|
-
|
100
|
+
begin
|
101
|
+
return send templating_engine_method_name, source, context
|
102
|
+
rescue StandardError, SyntaxError => e
|
103
|
+
logger.puts_and_logs "Error rendering #{engine_name} template '#{source}'", logs_as: :error, check_verbose: false
|
104
|
+
raise e
|
105
|
+
end
|
101
106
|
end
|
102
107
|
end
|
103
108
|
logger.warn "File '#{source}' was supposed to be processed but there is no template engine defined ! Applying simple copy."
|
@@ -44,10 +44,12 @@ module PowerStencil
|
|
44
44
|
@gem_spec = PowerStencil::Plugins::Base.find_locally_installed_gem_spec name, gem_req
|
45
45
|
raise PowerStencil::Error, "Cannot find plugin '#{name}'. Try 'power_stencil plugin --install'" if gem_spec.nil?
|
46
46
|
raise PowerStencil::Error, "Invalid plugin '#{name}' ! Missing metadata 'plugin_name' in spec !" if gem_spec.metadata['plugin_name'].nil?
|
47
|
+
logger.debug "Plugin '#{name}' real name is '#{gem_spec.metadata['plugin_name']}'."
|
47
48
|
@name = gem_spec.metadata['plugin_name']
|
48
|
-
logger.debug "Plugin real name is '#{name}'."
|
49
49
|
when :local
|
50
50
|
logger.debug "Plugin '#{name}' is provided locally by the project."
|
51
|
+
else
|
52
|
+
raise PowerStencil::Error, "Unsupported plugin type (#{type}) for plugin '#{name}' !"
|
51
53
|
end
|
52
54
|
|
53
55
|
logger.debug "Loading plugin '#{name}'..."
|
@@ -21,11 +21,16 @@ module PowerStencil
|
|
21
21
|
raise PowerStencil::Error, "Plugin '#{self.name}' has no definition file !"
|
22
22
|
end
|
23
23
|
logger.debug "Loading plugin '#{self.name}' capabilities..."
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
begin
|
25
|
+
@plugin_definition = yaml_file_to_hash yaml_file
|
26
|
+
%i(processors entity_definitions templates build dsl).each do |capability|
|
27
|
+
unless plugin_definition[capability].nil? or plugin_definition[capability].empty?
|
28
|
+
capabilities[capability] = true
|
29
|
+
end
|
28
30
|
end
|
31
|
+
rescue => e
|
32
|
+
logger.debug PowerStencil::Error.report_error(e)
|
33
|
+
raise PowerStencil::Error, "Invalid plugin capabilities file '#{yaml_file}' for plugin '#{self.name}'"
|
29
34
|
end
|
30
35
|
|
31
36
|
end
|
@@ -52,17 +52,16 @@ module PowerStencil
|
|
52
52
|
return
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
candidates.each do |candidate|
|
55
|
+
Dir.entries(project_local_plugins_path)
|
56
|
+
.select { |e| File.directory? File.join(project_local_plugins_path, e) }
|
57
|
+
.reject { |d| %w(. ..).include? d }
|
58
|
+
.each do |candidate|
|
60
59
|
begin
|
61
60
|
raise PowerStencil::Error, "Plugin '#{candidate}' already exists !" unless plugins[candidate].nil?
|
62
61
|
plugins[candidate] = PowerStencil::Plugins::Base.new(candidate, self)
|
63
62
|
rescue PowerStencil::Error => pse
|
64
|
-
|
65
|
-
|
63
|
+
logger.puts_and_logs pse.message, logs_as: :error
|
64
|
+
logger.puts_and_logs "Discarding invalid plugin '#{candidate}'.", logs_as: :error
|
66
65
|
end
|
67
66
|
end
|
68
67
|
|
data/power_stencil.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
|
28
|
-
spec.add_dependency 'climatic', '~> 0.2.
|
28
|
+
spec.add_dependency 'climatic', '~> 0.2.30'
|
29
29
|
spec.add_dependency 'dir_glob_ignore', '~> 0.3'
|
30
30
|
spec.add_dependency 'universe_compiler', '~> 0.5.1'
|
31
31
|
spec.add_dependency 'pry'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power_stencil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Briais
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.
|
61
|
+
version: 0.2.30
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.
|
68
|
+
version: 0.2.30
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: dir_glob_ignore
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,7 +275,7 @@ metadata:
|
|
275
275
|
documentation_uri: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md
|
276
276
|
source_code_uri: https://gitlab.com/tools4devops/power_stencil
|
277
277
|
homepage_uri: https://powerstencil.brizone.org/
|
278
|
-
post_install_message: "\nThank you for installing PowerStencil 0.6.
|
278
|
+
post_install_message: "\nThank you for installing PowerStencil 0.6.1 !\nFrom the command
|
279
279
|
line you can run `power_stencil --help`\nIf your shell is not completing the command:\n
|
280
280
|
\ If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nOfficial Website
|
281
281
|
\ : https://powerstencil.brizone.org/\nFull documentation here : https://gitlab.com/tools4devops/power_stencil/blob/master/README.md\nFeel
|