power_stencil 0.8.8 → 0.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/etc/meta_templates/plugin_seed/README.md +118 -0
- data/etc/meta_templates/plugin_seed/psplugin_{entity}.gemspec +20 -5
- data/etc/meta_templates/plugin_seed/spec/spec_helper.rb +15 -0
- data/etc/meta_templates/plugin_seed/spec/{entity}_spec.rb +10 -0
- data/etc/templates/plugin_definition/README.md +95 -20
- data/etc/templates/plugin_definition/psplugin_{entity}.gemspec +20 -5
- data/etc/templates/plugin_definition/spec/spec_helper.rb +2 -1
- data/etc/templates/plugin_definition/spec/{entity}_spec.rb +4 -3
- data/lib/power_stencil/command_processors/init.rb +1 -1
- data/lib/power_stencil/dsl/plugin_generation.rb +4 -0
- data/lib/power_stencil/engine/build_handling.rb +5 -0
- data/lib/power_stencil/engine/entities_handling.rb +2 -2
- data/lib/power_stencil/initializer.rb +7 -1
- data/lib/power_stencil/project/completion.rb +3 -5
- data/lib/power_stencil/project/git.rb +0 -1
- data/lib/power_stencil/version.rb +1 -1
- data/power_stencil.gemspec +1 -1
- metadata +14 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 658cd6b4a3099ebad88b964d3d2d29125e2d2632
|
4
|
+
data.tar.gz: d4593e14e6b18d7dcd7888881d4ab8e2cc0188d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8907db7dd9cc04235d905999303b07d643cfd4907cbfb9f67f3efd1eb56469a2436853bb626745f1e768daab7588e951890975fc2614f860876c27d145a8758
|
7
|
+
data.tar.gz: 95a384be8f2a4587af1c46710fdbf6ad10024d439a41c4f96889dfbdf57eb7dcf2ac8860e2f08ccf0e4d0d213a5f2fc957b4d5340d51efa905ada5566701386c
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<% gem_name = "psplugin_#{ plugin_name}" -%>
|
2
|
+
<%= plugin_title_name %>
|
3
|
+
<%= '=' * plugin_title_name.size %>
|
4
|
+
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/<%= gem_name %>.svg)](https://rubygems.org/gems/<%= gem_name %>) [![Pipeline status](https://gitlab.com/tools4devops/psplugins/<%= gem_name %>/badges/master/pipeline.svg)](https://gitlab.com/tools4devops/psplugins/<%= gem_name %>/commits/master)
|
6
|
+
|
7
|
+
[PowerStencil] is the Swiss-army knife templating workflow for developers and ops.
|
8
|
+
|
9
|
+
`<%= plugin_title_name %>` is a [PowerStencil] plugin.
|
10
|
+
|
11
|
+
See [official website][PowerStencil site].
|
12
|
+
|
13
|
+
|
14
|
+
<!-- TOC -->
|
15
|
+
|
16
|
+
- [What is a PowerStencil plugin ?](#what-is-a-powerstencil-plugin-)
|
17
|
+
- [Using this plugin in your `PowerStencil` projects](#using-this-plugin-in-your-powerstencil-projects)
|
18
|
+
- [Goal of this plugin](#goal-of-this-plugin)
|
19
|
+
- [Plugin capabilities](#plugin-capabilities)
|
20
|
+
- [Config](#config)
|
21
|
+
- [Subcommands and options](#subcommands-and-options)
|
22
|
+
- [Post-build actions](#post-build-actions)
|
23
|
+
- [DSL in templates and in `power_stencil shell`](#dsl-in-templates-and-in-power_stencil-shell)
|
24
|
+
- [Entity types](#entity-types)
|
25
|
+
- [Templates-templates](#templates-templates)
|
26
|
+
- [Contributing](#contributing)
|
27
|
+
- [License](#license)
|
28
|
+
- [Code of Conduct](#code-of-conduct)
|
29
|
+
|
30
|
+
<!-- /TOC -->
|
31
|
+
|
32
|
+
# What is a PowerStencil plugin ?
|
33
|
+
|
34
|
+
A `PowerStencil` plugin can be used in the context of a `PowerStencil` project and bring extra features to a standard project.
|
35
|
+
|
36
|
+
If you don't know what `PowerStencil` is made for, you may read [the documentation][PowerStencil] first.
|
37
|
+
|
38
|
+
Features provided by a plugin can be:
|
39
|
+
|
40
|
+
* Extra config.
|
41
|
+
* Extra subcommands or options added to the `power_stencil` command-line.
|
42
|
+
* Extra post-build actions.
|
43
|
+
* Extra DSL methods available in templates and in `power_stencil shell`.
|
44
|
+
* Extra entity types.
|
45
|
+
* Extra templates-templates.
|
46
|
+
|
47
|
+
# Using this plugin in your `PowerStencil` projects
|
48
|
+
|
49
|
+
To use this plugin within your `PowerStencil` project, you need to:
|
50
|
+
|
51
|
+
* be within a `PowerStencil` project :wink:.
|
52
|
+
* declare this plugin in the project configuration (from the root of your project in the `.ps_project/versioned-config.yaml` file).
|
53
|
+
|
54
|
+
In this yaml configuration file, you just have to add a new entry in the `:project_plugins` array or simply create it if it is not yet existing:
|
55
|
+
|
56
|
+
```yaml
|
57
|
+
:project_plugins:
|
58
|
+
- <%= gem_name %>
|
59
|
+
```
|
60
|
+
If this plugin is not already present on your machine, you may have to download it:
|
61
|
+
|
62
|
+
$ power_stencil plugin --install
|
63
|
+
|
64
|
+
And then you may see information about the plugin by running:
|
65
|
+
|
66
|
+
* `power_stencil info` in the plugins section.
|
67
|
+
* `power_stencil plugin --list -v`
|
68
|
+
|
69
|
+
# Goal of this plugin
|
70
|
+
|
71
|
+
# Plugin capabilities
|
72
|
+
|
73
|
+
This plugin provides the following features:
|
74
|
+
|
75
|
+
## Config
|
76
|
+
|
77
|
+
## Subcommands and options
|
78
|
+
|
79
|
+
## Post-build actions
|
80
|
+
|
81
|
+
## DSL in templates and in `power_stencil shell`
|
82
|
+
|
83
|
+
## Entity types
|
84
|
+
|
85
|
+
## Templates-templates
|
86
|
+
|
87
|
+
|
88
|
+
# Contributing
|
89
|
+
|
90
|
+
Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/tools4devops/psplugins/<%= plugin_name %>/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
91
|
+
|
92
|
+
## License
|
93
|
+
|
94
|
+
The gem is available as open source under the terms of the [MIT License].
|
95
|
+
|
96
|
+
## Code of Conduct
|
97
|
+
|
98
|
+
Everyone interacting in the PowerStencil project’s codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct].
|
99
|
+
|
100
|
+
<!-- End of Document -->
|
101
|
+
|
102
|
+
<!-- Pages -->
|
103
|
+
[code of conduct]: CODE_OF_CONDUCT.md
|
104
|
+
|
105
|
+
<!-- Code links -->
|
106
|
+
|
107
|
+
<!-- Illustrations -->
|
108
|
+
[simple-flow-image]: doc/images/power-stencil-simple-flow.svg
|
109
|
+
|
110
|
+
<!-- External links -->
|
111
|
+
[MIT License]: http://opensource.org/licenses/MIT "The MIT license"
|
112
|
+
[ERB]: https://ruby-doc.org/stdlib-2.6.3/libdoc/erb/rdoc/ERB.html "Quick ERB description"
|
113
|
+
[Haml]: http://haml.info/ "The templating engine for XML-like documents"
|
114
|
+
[Ruby]: https://www.ruby-lang.org "The powerful Ruby language"
|
115
|
+
[Rails]: https://rubyonrails.org/ "The Ruby on Rails framework"
|
116
|
+
[PowerStencil site]: https://powerstencil.brizone.org "Official PowerStencil website"
|
117
|
+
[PowerStencil]: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md "PowerStencil documentation"
|
118
|
+
[PowerStencil plugins]: https://gitlab.com/tools4devops/power_stencil/blob/master/doc/plugins.md "PowerStencil plugins documentation"
|
@@ -12,13 +12,27 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{<%= plugin_name %> is a plugin for the PowerStencil framework.}
|
13
13
|
spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
14
|
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
15
|
-
spec.license =
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
|
-
#
|
18
|
-
#
|
17
|
+
# Change this and following metadata if you don't want your plugin to be an "official" PowerStencil plugin.
|
18
|
+
# ie deployed to https://gitlab.com/tools4devops/psplugins
|
19
|
+
source_code_uri = 'https://gitlab.com/tools4devops/psplugins/<%= plugin_name %>'
|
20
|
+
|
21
|
+
# Gem metadata
|
19
22
|
if spec.respond_to?(:metadata)
|
23
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
24
|
+
# to allow pushing to a single host or delete this line to allow pushing to any host.
|
20
25
|
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
|
26
|
+
|
27
|
+
# Nice link to your home page on rubygems.org
|
28
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
29
|
+
|
30
|
+
# You have to probably change this if you don't deploy to gitlab
|
31
|
+
spec.metadata['bug_tracker_uri'] = "#{source_code_uri}/issues"
|
32
|
+
spec.metadata['documentation_uri'] = "#{source_code_uri}/blob/master/README.md"
|
33
|
+
spec.metadata['source_code_uri'] = source_code_uri
|
34
|
+
|
35
|
+
# This metadata is mandatory for a PowerStencil plugin !!
|
22
36
|
spec.metadata['plugin_name'] = '<%= plugin_name %>'
|
23
37
|
else
|
24
38
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes and PowerStencil plugin mechanism !'
|
@@ -31,8 +45,9 @@ Gem::Specification.new do |spec|
|
|
31
45
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
46
|
spec.require_paths = ['lib']
|
33
47
|
|
34
|
-
spec.add_development_dependency 'bundler'
|
48
|
+
spec.add_development_dependency 'bundler'
|
35
49
|
spec.add_development_dependency 'rake', '~> 10.0'
|
36
50
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
37
51
|
spec.add_development_dependency 'power_stencil', "~> <%= PowerStencil::VERSION %>"
|
52
|
+
|
38
53
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
require 'power_stencil'
|
3
|
+
require "<%= plugin_name %>"
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
# Enable flags like --only-failures and --next-failure
|
7
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
8
|
+
|
9
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
10
|
+
config.disable_monkey_patching!
|
11
|
+
|
12
|
+
config.expect_with :rspec do |c|
|
13
|
+
c.syntax = :expect
|
14
|
+
end
|
15
|
+
end
|
@@ -1,43 +1,118 @@
|
|
1
|
-
#
|
1
|
+
<% gem_name = "psplugin_#{ plugin_name}" -%>
|
2
|
+
<%= plugin_title_name %>
|
3
|
+
<%= '=' * plugin_title_name.size %>
|
2
4
|
|
3
|
-
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/<%= gem_name %>.svg)](https://rubygems.org/gems/<%= gem_name %>) [![Pipeline status](https://gitlab.com/tools4devops/psplugins/<%= gem_name %>/badges/master/pipeline.svg)](https://gitlab.com/tools4devops/psplugins/<%= gem_name %>/commits/master)
|
4
6
|
|
5
|
-
|
7
|
+
[PowerStencil] is the Swiss-army knife templating workflow for developers and ops.
|
6
8
|
|
7
|
-
|
9
|
+
`<%= plugin_title_name %>` is a [PowerStencil] plugin.
|
8
10
|
|
9
|
-
|
11
|
+
See [official website][PowerStencil site].
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
|
14
|
+
<!-- TOC -->
|
15
|
+
|
16
|
+
- [What is a PowerStencil plugin ?](#what-is-a-powerstencil-plugin-)
|
17
|
+
- [Using this plugin in your `PowerStencil` projects](#using-this-plugin-in-your-powerstencil-projects)
|
18
|
+
- [Goal of this plugin](#goal-of-this-plugin)
|
19
|
+
- [Plugin capabilities](#plugin-capabilities)
|
20
|
+
- [Config](#config)
|
21
|
+
- [Subcommands and options](#subcommands-and-options)
|
22
|
+
- [Post-build actions](#post-build-actions)
|
23
|
+
- [DSL in templates and in `power_stencil shell`](#dsl-in-templates-and-in-power_stencil-shell)
|
24
|
+
- [Entity types](#entity-types)
|
25
|
+
- [Templates-templates](#templates-templates)
|
26
|
+
- [Contributing](#contributing)
|
27
|
+
- [License](#license)
|
28
|
+
- [Code of Conduct](#code-of-conduct)
|
29
|
+
|
30
|
+
<!-- /TOC -->
|
31
|
+
|
32
|
+
# What is a PowerStencil plugin ?
|
33
|
+
|
34
|
+
A `PowerStencil` plugin can be used in the context of a `PowerStencil` project and bring extra features to a standard project.
|
35
|
+
|
36
|
+
If you don't know what `PowerStencil` is made for, you may read [the documentation][PowerStencil] first.
|
37
|
+
|
38
|
+
Features provided by a plugin can be:
|
39
|
+
|
40
|
+
* Extra config.
|
41
|
+
* Extra subcommands or options added to the `power_stencil` command-line.
|
42
|
+
* Extra post-build actions.
|
43
|
+
* Extra DSL methods available in templates and in `power_stencil shell`.
|
44
|
+
* Extra entity types.
|
45
|
+
* Extra templates-templates.
|
46
|
+
|
47
|
+
# Using this plugin in your `PowerStencil` projects
|
48
|
+
|
49
|
+
To use this plugin within your `PowerStencil` project, you need to:
|
50
|
+
|
51
|
+
* be within a `PowerStencil` project :wink:.
|
52
|
+
* declare this plugin in the project configuration (from the root of your project in the `.ps_project/versioned-config.yaml` file).
|
53
|
+
|
54
|
+
In this yaml configuration file, you just have to add a new entry in the `:project_plugins` array or simply create it if it is not yet existing:
|
55
|
+
|
56
|
+
```yaml
|
57
|
+
:project_plugins:
|
58
|
+
- <%= gem_name %>
|
13
59
|
```
|
60
|
+
If this plugin is not already present on your machine, you may have to download it:
|
61
|
+
|
62
|
+
$ power_stencil plugin --install
|
63
|
+
|
64
|
+
And then you may see information about the plugin by running:
|
65
|
+
|
66
|
+
* `power_stencil info` in the plugins section.
|
67
|
+
* `power_stencil plugin --list -v`
|
68
|
+
|
69
|
+
# Goal of this plugin
|
14
70
|
|
15
|
-
|
71
|
+
# Plugin capabilities
|
16
72
|
|
17
|
-
|
73
|
+
This plugin provides the following features:
|
18
74
|
|
19
|
-
|
75
|
+
## Config
|
20
76
|
|
21
|
-
|
77
|
+
## Subcommands and options
|
22
78
|
|
23
|
-
##
|
79
|
+
## Post-build actions
|
24
80
|
|
25
|
-
|
81
|
+
## DSL in templates and in `power_stencil shell`
|
26
82
|
|
27
|
-
##
|
83
|
+
## Entity types
|
28
84
|
|
29
|
-
|
85
|
+
## Templates-templates
|
30
86
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
87
|
|
33
|
-
|
88
|
+
# Contributing
|
34
89
|
|
35
|
-
Bug reports and pull requests are welcome on
|
90
|
+
Bug reports and pull requests are welcome on Gitlab at https://gitlab.com/tools4devops/psplugins/<%= plugin_name %>/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
91
|
|
37
92
|
## License
|
38
93
|
|
39
|
-
The gem is available as open source under the terms of the [MIT License]
|
94
|
+
The gem is available as open source under the terms of the [MIT License].
|
40
95
|
|
41
96
|
## Code of Conduct
|
42
97
|
|
43
|
-
Everyone interacting in the
|
98
|
+
Everyone interacting in the PowerStencil project’s codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct].
|
99
|
+
|
100
|
+
<!-- End of Document -->
|
101
|
+
|
102
|
+
<!-- Pages -->
|
103
|
+
[code of conduct]: CODE_OF_CONDUCT.md
|
104
|
+
|
105
|
+
<!-- Code links -->
|
106
|
+
|
107
|
+
<!-- Illustrations -->
|
108
|
+
[simple-flow-image]: doc/images/power-stencil-simple-flow.svg
|
109
|
+
|
110
|
+
<!-- External links -->
|
111
|
+
[MIT License]: http://opensource.org/licenses/MIT "The MIT license"
|
112
|
+
[ERB]: https://ruby-doc.org/stdlib-2.6.3/libdoc/erb/rdoc/ERB.html "Quick ERB description"
|
113
|
+
[Haml]: http://haml.info/ "The templating engine for XML-like documents"
|
114
|
+
[Ruby]: https://www.ruby-lang.org "The powerful Ruby language"
|
115
|
+
[Rails]: https://rubyonrails.org/ "The Ruby on Rails framework"
|
116
|
+
[PowerStencil site]: https://powerstencil.brizone.org "Official PowerStencil website"
|
117
|
+
[PowerStencil]: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md "PowerStencil documentation"
|
118
|
+
[PowerStencil plugins]: https://gitlab.com/tools4devops/power_stencil/blob/master/doc/plugins.md "PowerStencil plugins documentation"
|
@@ -12,13 +12,27 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{<%= plugin_name %> is a plugin for the PowerStencil framework.}
|
13
13
|
spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
14
|
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
15
|
-
spec.license =
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
|
-
#
|
18
|
-
#
|
17
|
+
# Change this and following metadata if you don't want your plugin to be an "official" PowerStencil plugin.
|
18
|
+
# ie deployed to https://gitlab.com/tools4devops/psplugins
|
19
|
+
source_code_uri = 'https://gitlab.com/tools4devops/psplugins/<%= plugin_name %>'
|
20
|
+
|
21
|
+
# Gem metadata
|
19
22
|
if spec.respond_to?(:metadata)
|
23
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
24
|
+
# to allow pushing to a single host or delete this line to allow pushing to any host.
|
20
25
|
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
|
26
|
+
|
27
|
+
# Nice link to your home page on rubygems.org
|
28
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
29
|
+
|
30
|
+
# You have to probably change this if you don't deploy to gitlab
|
31
|
+
spec.metadata['bug_tracker_uri'] = "#{source_code_uri}/issues"
|
32
|
+
spec.metadata['documentation_uri'] = "#{source_code_uri}/blob/master/README.md"
|
33
|
+
spec.metadata['source_code_uri'] = source_code_uri
|
34
|
+
|
35
|
+
# This metadata is mandatory for a PowerStencil plugin !!
|
22
36
|
spec.metadata['plugin_name'] = '<%= plugin_name %>'
|
23
37
|
else
|
24
38
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes and PowerStencil plugin mechanism !'
|
@@ -31,8 +45,9 @@ Gem::Specification.new do |spec|
|
|
31
45
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
46
|
spec.require_paths = ['lib']
|
33
47
|
|
34
|
-
spec.add_development_dependency 'bundler'
|
48
|
+
spec.add_development_dependency 'bundler'
|
35
49
|
spec.add_development_dependency 'rake', '~> 10.0'
|
36
50
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
37
51
|
spec.add_development_dependency 'power_stencil', "~> <%= PowerStencil::VERSION %>"
|
52
|
+
|
38
53
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
RSpec.describe <%= plugin_module_name %> do
|
2
|
-
it
|
2
|
+
it 'has a version number' do
|
3
3
|
expect(<%= plugin_module_name %>::VERSION).not_to be nil
|
4
4
|
end
|
5
5
|
|
6
|
-
it
|
7
|
-
|
6
|
+
it 'does something useful' do
|
7
|
+
pending 'Tests implementation'
|
8
|
+
RSpec.fail
|
8
9
|
end
|
9
10
|
end
|
@@ -14,7 +14,7 @@ module PowerStencil
|
|
14
14
|
|
15
15
|
def execute
|
16
16
|
setup_project_path
|
17
|
-
log_startup_context
|
17
|
+
# log_startup_context
|
18
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
20
|
puts_and_logs 'Done.', check_verbose: false
|
@@ -95,8 +95,11 @@ module PowerStencil
|
|
95
95
|
|
96
96
|
|
97
97
|
def build_entity(entity_to_build, target_path)
|
98
|
+
initial_directory = Dir.pwd
|
98
99
|
target_plugin_name = entity_to_build.buildable_by.to_s
|
99
100
|
default_build entity_to_build, target_path
|
101
|
+
# Post processing executed from generated directory (#11)
|
102
|
+
Dir.chdir target_path
|
100
103
|
|
101
104
|
if target_plugin_name.empty?
|
102
105
|
post_build_hook entity_to_build, target_path
|
@@ -106,6 +109,8 @@ module PowerStencil
|
|
106
109
|
raise PowerStencil::Error, "Plugin '#{target_plugin_name}' has no build capability !" unless target_plugin.capabilities[:build]
|
107
110
|
target_plugin.post_build_hook entity_to_build, target_path
|
108
111
|
end
|
112
|
+
ensure
|
113
|
+
Dir.chdir initial_directory
|
109
114
|
end
|
110
115
|
|
111
116
|
def default_build(entity_to_build, target_path)
|
@@ -34,11 +34,11 @@ module PowerStencil
|
|
34
34
|
@available_entities_hash.keys
|
35
35
|
end
|
36
36
|
|
37
|
-
def entity(type, name, universe)
|
37
|
+
def entity(type, name, universe = self.root_universe)
|
38
38
|
universe.get_entity type, name
|
39
39
|
end
|
40
40
|
|
41
|
-
def entities(universe, criterion: nil, value: nil, &filter_block)
|
41
|
+
def entities(universe = self.root_universe, criterion: nil, value: nil, &filter_block)
|
42
42
|
universe.get_entities criterion: criterion, value: value, &filter_block
|
43
43
|
end
|
44
44
|
|
@@ -17,6 +17,7 @@ module PowerStencil
|
|
17
17
|
logger.debug 'Starting PowerStencil initialization...'
|
18
18
|
setup_system_processors
|
19
19
|
setup_universe_compiler_logger
|
20
|
+
try_to_load_project fail_on_error: false
|
20
21
|
logger.debug 'PowerStencil initialization complete'
|
21
22
|
end
|
22
23
|
|
@@ -29,7 +30,12 @@ module PowerStencil
|
|
29
30
|
include PowerStencil::Utils::FileHelper
|
30
31
|
|
31
32
|
def try_to_load_project(fail_on_error: true)
|
32
|
-
|
33
|
+
begin
|
34
|
+
PowerStencil::Project::Base.instantiate_from_config config
|
35
|
+
rescue => e
|
36
|
+
raise e if fail_on_error
|
37
|
+
end
|
38
|
+
|
33
39
|
end
|
34
40
|
|
35
41
|
def setup_system_processors
|
@@ -6,17 +6,15 @@ module PowerStencil
|
|
6
6
|
def query_for_completion(query_type)
|
7
7
|
case query_type
|
8
8
|
when :entities
|
9
|
-
engine.entities
|
9
|
+
engine.entities.map(&:as_path).sort
|
10
10
|
when :'entity-types'
|
11
11
|
engine.available_entity_types.sort
|
12
12
|
when :scenario
|
13
|
-
engine.entities(
|
13
|
+
engine.entities(criterion: :by_type, value: :entity_override) do |entity|
|
14
14
|
!entity.scenario.nil? and !entity.scenario.empty?
|
15
15
|
end.map(&:scenario).sort.uniq
|
16
16
|
when :buildable
|
17
|
-
engine.entities(
|
18
|
-
entity.buildable?
|
19
|
-
end.map(&:as_path).sort
|
17
|
+
engine.entities(&:buildable?).map(&:as_path).sort
|
20
18
|
else
|
21
19
|
raise PowerStencil::Error, "'#{query_type}' is not a valid query type for completion !"
|
22
20
|
end
|
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.33'
|
29
29
|
spec.add_dependency 'dir_glob_ignore', '~> 0.3'
|
30
30
|
spec.add_dependency 'universe_compiler', '~> 0.5.5'
|
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.8.
|
4
|
+
version: 0.8.13
|
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-11-
|
11
|
+
date: 2019-11-07 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.33
|
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.33
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: dir_glob_ignore
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- doc/plugins.md
|
155
155
|
- doc/templates.md
|
156
156
|
- etc/base_commands_definition.yml
|
157
|
+
- etc/meta_templates/plugin_seed/README.md
|
157
158
|
- etc/meta_templates/plugin_seed/etc/command_line.yaml
|
158
159
|
- etc/meta_templates/plugin_seed/etc/plugin_capabilities.yaml
|
159
160
|
- etc/meta_templates/plugin_seed/etc/plugin_config.yaml
|
@@ -168,6 +169,8 @@ files:
|
|
168
169
|
- etc/meta_templates/plugin_seed/lib/{entity}/version.rb.erb
|
169
170
|
- etc/meta_templates/plugin_seed/lib/{entity}/{entity}_processor.rb.erb
|
170
171
|
- etc/meta_templates/plugin_seed/psplugin_{entity}.gemspec
|
172
|
+
- etc/meta_templates/plugin_seed/spec/spec_helper.rb
|
173
|
+
- etc/meta_templates/plugin_seed/spec/{entity}_spec.rb
|
171
174
|
- etc/power_stencil.yaml
|
172
175
|
- etc/templates/plugin_definition/.gitignore
|
173
176
|
- etc/templates/plugin_definition/.rspec
|
@@ -299,12 +302,13 @@ metadata:
|
|
299
302
|
documentation_uri: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md
|
300
303
|
source_code_uri: https://gitlab.com/tools4devops/power_stencil
|
301
304
|
homepage_uri: https://powerstencil.brizone.org/
|
302
|
-
post_install_message: "\nThank you for installing PowerStencil 0.8.
|
303
|
-
line you can run `power_stencil --help`\nIf your shell is not completing
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
305
|
+
post_install_message: "\nThank you for installing PowerStencil 0.8.13 !\nFrom the
|
306
|
+
command line you can run `power_stencil --help`\nIf your shell is not completing
|
307
|
+
the command:\n If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nOfficial
|
308
|
+
Website : https://powerstencil.brizone.org/\nFull documentation here :
|
309
|
+
https://gitlab.com/tools4devops/power_stencil/blob/master/README.md\nFeel free to
|
310
|
+
report issues: https://gitlab.com/tools4devops/power_stencil/issues\n\nType 'power_stencil
|
311
|
+
adm --zsh-completion' to install auto-completion for zsh.\n\n "
|
308
312
|
rdoc_options: []
|
309
313
|
require_paths:
|
310
314
|
- lib
|