power_stencil 0.4.17 → 0.4.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 090721c55ffc99653d0be5a9b923c45c175cd538
4
- data.tar.gz: 80ba7636a39ceed4f6403cef1170206ca33ee8d4
3
+ metadata.gz: 80af1c57689a2ba89246da59fb373577dd48a31b
4
+ data.tar.gz: 1c91918d21e15a9730929db9d58309b415c6098d
5
5
  SHA512:
6
- metadata.gz: 601aa0ba6a72326dc3dab22ecc0304ac26c33046dd0f208c1bd2e045d0767c4624a69027389dc76b2dc154f38eb55750e7229fffcbaee853aa891b77368d2e08
7
- data.tar.gz: 87f465b799e7802715383c226e8acd57c4eb0cc50ff336b7666eb22802b876662554b43d0e482a2f0fc84b15f4323e047484dc19543413dd47463024c2bb99d8
6
+ metadata.gz: f4ee7f37502473381418bc6184c6436f5ab05d159ed819d4bfbd4cc39554130cddd9a2d0742db82db7f7103738d7b7614df3cd1753e0d29a9713fc98608d5999
7
+ data.tar.gz: bd212747f02e36cc2d3d93f37246152c34ba7552af969757cada09122063ca1633e05b47a549abd9d703bb7bff3e9a8f8bc380f53b767475b0477cc4a745e5e5
data/README.md CHANGED
@@ -112,7 +112,7 @@ PowerStencil is the Swiss-army knife templating workflow for developers and ops.
112
112
  --------------------------------------------------------------------------------
113
113
  * init: Initializes a PowerStencil repository ...
114
114
  * info: Generic information about the repository ...
115
- * new-plugin: Generates the skeleton for a plugin ...
115
+ * plugin: Manipulates plugins ...
116
116
  * get: Query entities from repository ...
117
117
  * shell: Opens a shell to interact with entities ...
118
118
  * check: Check repository entities consistency ...
@@ -52,7 +52,7 @@ The normal process would be to begin with a plugin within the project and once y
52
52
  The is a command provided for that, that will create a whole plugin skeleton.
53
53
 
54
54
  ```shell
55
- $ power_stencil new-plugin myplugin
55
+ $ power_stencil plugin --create myplugin
56
56
  Generated new plugin 'myplugin'
57
57
 
58
58
  $ ll .ps_project/plugins/myplugin
@@ -96,7 +96,35 @@ If you do a `power_stencil info` you see a new part appeared in the report
96
96
  ```
97
97
  Each of the lines correspond to what is called a _plugin capability_.
98
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 ?
99
+ You can get the same information by issuing:
100
+
101
+ $ power_stencil plugin --list
102
+
103
+ ```
104
+ 1 plugin found to be used in this project.
105
+ - myplugin (in '/tmp/tst project/.ps_project/plugins/myplugin/lib/myplugin.rb')
106
+ ```
107
+
108
+ Or with the capabilities information:
109
+
110
+ $ power_stencil plugin --list -v
111
+
112
+ ```
113
+ 1 plugin found to be used in this project.
114
+ - myplugin (in '/tmp/tst project/.ps_project/plugins/myplugin/lib/myplugin.rb')
115
+ command_line: true
116
+ local_config: true
117
+ processors: true
118
+ build: false
119
+ dsl: false
120
+ entity_definitions: true
121
+ code: true
122
+ version: true
123
+ templates: true
124
+ ```
125
+
126
+
127
+ Obviously by default the plugin does nothing useful, yet it defined some placeholders. For example in the output here above it says `command_line: true`. What could it mean ?
100
128
 
101
129
  Let's try to see to help:
102
130
 
@@ -122,7 +150,7 @@ PowerStencil is the Swiss-army knife templating workflow for developers and ops.
122
150
  --------------------------------------------------------------------------------
123
151
  * init: Initializes a PowerStencil repository ...
124
152
  * info: Generic information about the repository ...
125
- * new-plugin: Generates the skeleton for a plugin ...
153
+ * plugin: Manipulates plugins ...
126
154
  * get: Query entities from repository ...
127
155
  * shell: Opens a shell to interact with entities ...
128
156
  * check: Check repository entities consistency ...
@@ -93,14 +93,24 @@
93
93
  info [options]
94
94
 
95
95
  Displays information about the repository.
96
- new-plugin:
96
+ plugin:
97
97
  :banner: |
98
- Generates the skeleton for a plugin.
98
+ Manipulates plugins.
99
99
 
100
100
  Usage:
101
- new-plugin [options]
101
+ plugin [options]
102
102
 
103
- Generates a fully working although useless plugin skeleton.
103
+ Manipulates plugins.
104
+ :options:
105
+ create:
106
+ :type: bool
107
+ :summary: Generates a fully working although useless plugin skeleton.
108
+ :long_aliases:
109
+ - new
110
+ - scaffold
111
+ list:
112
+ :type: bool
113
+ :summary: List currently used plugins in this project.
104
114
  get:
105
115
  :banner: |
106
116
  Query entities from repository.
@@ -46,11 +46,11 @@
46
46
  :shell_dsl:
47
47
  :prompt_level_1: 'PowerStencil DSL> '
48
48
  :prompt_level_2: 'PowerStencil DSL --> '
49
- :session_greetings: |
49
+ :session_greetings: |+
50
50
  -------------------------------------------------------------------------------
51
51
  Welcome to the PowerStencil shell session
52
52
  In this shell you have access to anything the templating engine has access to.
53
- You can view, edit, save entities.
53
+ On top of this, you can view, edit, save and delete entities.
54
54
 
55
55
  - Retrieve and manipulate entities using the `entities` hash.
56
56
  - Persist your changes using the `save` method on each entity.
@@ -63,8 +63,6 @@
63
63
  Type `exit` to end your session.
64
64
  -------------------------------------------------------------------------------
65
65
 
66
-
67
-
68
66
  # TEMPLATING ENGINE
69
67
 
70
68
  # Map to define which kind of template engine for which type of file. Be careful if you
@@ -75,7 +73,8 @@
75
73
 
76
74
  # Files matching particular patterns can be changed on the fly
77
75
  :file_renaming_patterns:
78
- # Specific .gitignore file for Windows
76
+ # Specific .gitignore hack for `power_stencil init` as .gitignore should be processed
77
+ # *after* .ps_project
79
78
  ^(.+)\.zzzgitignore\.erb$: '\1.gitignore'
80
79
  # Erb files
81
80
  ^(.+)\.erb$: '\1'
@@ -5,7 +5,7 @@ PowerStencil plugins
5
5
  In this directory, you can define project specific local plugins.
6
6
  You should create them using the `PowerStencil` command-line.
7
7
 
8
- $ power_stencil new-plugin myplugin
8
+ $ power_stencil plugin --create myplugin
9
9
 
10
10
  __It is strongly advised to keep this directory under source control__
11
11
 
@@ -30,7 +30,7 @@ require 'power_stencil/command_processors/create'
30
30
  require 'power_stencil/command_processors/edit'
31
31
  require 'power_stencil/command_processors/delete'
32
32
  require 'power_stencil/command_processors/shell'
33
- require 'power_stencil/command_processors/new_plugin'
33
+ require 'power_stencil/command_processors/plugin'
34
34
  require 'power_stencil/command_processors/build'
35
35
 
36
36
 
@@ -0,0 +1,56 @@
1
+ module PowerStencil
2
+ module CommandProcessors
3
+
4
+ class Plugin
5
+
6
+ include Climatic::Script::UnimplementedProcessor
7
+ include Climatic::Proxy
8
+ include PowerStencil::Project::Proxy
9
+
10
+ def execute
11
+
12
+ if config[:list]
13
+ if project.plugins.empty?
14
+ puts 'No plugin used in this project.'
15
+ else
16
+ puts "#{project.plugins.size} plugin#{project.plugins.size == 1 ? '' : 's'} found to be used in this project."
17
+ end
18
+ project.plugins.each do |plugin_name, plugin_def|
19
+ puts " - #{plugin_name} (in '#{plugin_def.entry_point_path}')"
20
+ if config[:verbose]
21
+ plugin_def.capabilities.each do |name, value|
22
+ puts " #{name}: #{value}"
23
+ end
24
+ end
25
+ end
26
+ return
27
+ end
28
+
29
+
30
+ if config[:create]
31
+ if config.command_line_layer.extra_parameters.empty?
32
+ raise PowerStencil::Error, 'Please specify at least one plugin name !'
33
+ end
34
+ config.command_line_layer.extra_parameters.each do |plugin_name|
35
+ begin
36
+ target_path = File.join project.project_plugin_path(plugin_name)
37
+ project.create_plugin_tree plugin_name, target_path
38
+ puts "Generated new plugin '#{plugin_name}'"
39
+ rescue => e
40
+ msg = "Could not create plugin '#{plugin_name}' because '#{e.message}'"
41
+ puts msg
42
+ logger.error "Could not create plugin '#{plugin_name}' because '#{e.message}'"
43
+ logger.debug PowerStencil::Error.report_error(e)
44
+ end
45
+ end
46
+ return
47
+ end
48
+
49
+ raise PowerStencil::Error, 'You should specify an option'
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
@@ -47,7 +47,7 @@ module PowerStencil
47
47
  edit: PowerStencil::CommandProcessors::Edit,
48
48
  delete: PowerStencil::CommandProcessors::Delete,
49
49
  shell: PowerStencil::CommandProcessors::Shell,
50
- :'new-plugin' => PowerStencil::CommandProcessors::NewPlugin,
50
+ plugin: PowerStencil::CommandProcessors::Plugin,
51
51
  build: PowerStencil::CommandProcessors::Build
52
52
  }.each do |command_name, processor|
53
53
  command_line_manager.register_processor command_line_manager.command_by_alias(command_name),
@@ -1,3 +1,3 @@
1
1
  module PowerStencil
2
- VERSION = '0.4.17'.freeze
2
+ VERSION = '0.4.18'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: power_stencil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.17
4
+ version: 0.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Briais
@@ -196,7 +196,7 @@ files:
196
196
  - lib/power_stencil/command_processors/get.rb
197
197
  - lib/power_stencil/command_processors/info.rb
198
198
  - lib/power_stencil/command_processors/init.rb
199
- - lib/power_stencil/command_processors/new_plugin.rb
199
+ - lib/power_stencil/command_processors/plugin.rb
200
200
  - lib/power_stencil/command_processors/root.rb
201
201
  - lib/power_stencil/command_processors/shell.rb
202
202
  - lib/power_stencil/command_processors/trace_helper.rb
@@ -260,7 +260,7 @@ metadata:
260
260
  documentation_uri: https://gitlab.com/tools4devops/power_stencil/blob/master/README.md
261
261
  source_code_uri: https://gitlab.com/tools4devops/power_stencil
262
262
  homepage_uri: https://powerstencil.brizone.org/
263
- post_install_message: "\nThank you for installing PowerStencil 0.4.17 !\nFrom the
263
+ post_install_message: "\nThank you for installing PowerStencil 0.4.18 !\nFrom the
264
264
  command line you can run `power_stencil --help`\nIf your shell is not completing
265
265
  the command:\n If you use rbenv: `rbenv rehash`\n If you use zsh : `rehash`\n\nOfficial
266
266
  Website : https://powerstencil.brizone.org/\nFull documentation here :
@@ -1,31 +0,0 @@
1
- module PowerStencil
2
- module CommandProcessors
3
-
4
- class NewPlugin
5
-
6
- include Climatic::Script::UnimplementedProcessor
7
- include Climatic::Proxy
8
- include PowerStencil::Project::Proxy
9
-
10
- def execute
11
- if config.command_line_layer.extra_parameters.empty?
12
- raise PowerStencil::Error, 'Please specify a plugin name!'
13
- end
14
- config.command_line_layer.extra_parameters.each do |plugin_name|
15
- begin
16
- target_path = File.join project.project_plugin_path(plugin_name)
17
- project.create_plugin_tree plugin_name, target_path
18
- puts "Generated new plugin '#{plugin_name}'"
19
- rescue => e
20
- msg = "Could not create plugin '#{plugin_name}' because '#{e.message}'"
21
- puts msg
22
- logger.error "Could not create plugin '#{plugin_name}' because '#{e.message}'"
23
- logger.debug PowerStencil::Error.report_error(e)
24
- end
25
- end
26
- end
27
-
28
- end
29
-
30
- end
31
- end