kafo 7.5.1 → 7.6.0

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
  SHA256:
3
- metadata.gz: ffb94761bad000c82e2c5903a82007ed014ea7e40a3c5575defcc951debdd77b
4
- data.tar.gz: fcc3ce347007c53d3ccbd2fbf4db49beb3715b047f4b8b4742de0c3604b72326
3
+ metadata.gz: e83868e710307e0ccb06910fb70c1c13bc6a91a44038011d117f27b9dd44b878
4
+ data.tar.gz: 569a7f58e1c722e35a87ae9aa8d102dd6fa7da9f36a1feafca2cb8a8825f874b
5
5
  SHA512:
6
- metadata.gz: af7c8147d0dde7afaa3bb5f4f5873bef63b868e8f60a81acd0df7cc1866ab184f463a0c3d16c8fbfd6b155b08f928174b23a1155c6b816d21f6c01fdd50141c8
7
- data.tar.gz: 1466c6205198bcda61b2edb11e560be757bcc4974dc6fb1e3c2396da302126f03f2e0eff7cd3130cfbd39ad89047d0c2f0a7e19436fbb132c4e21b863a550dca
6
+ metadata.gz: 96856823593af214597eabe41b6fd1998bf4c852631e326e9c9426f561fa28c35b9f1318d95e7648d98b599a8898512be396b2f219e003338a40d49a90f5885e
7
+ data.tar.gz: 646f7b4a3ebeb3bb70ee7fa01cf87ce878759e04756fa54113d9fc06cabc17a6b6af3dbbd1c1b4535466317ef5231b744b9e289d71a200113f4953db17b16b3a
@@ -9,6 +9,7 @@ require 'kafo/parser_cache_writer'
9
9
  require 'kafo/string_helper'
10
10
  require 'logger'
11
11
  require 'yaml'
12
+ require 'cgi'
12
13
 
13
14
  KafoConfigure = OpenStruct.new
14
15
  def KafoConfigure.exit(code)
@@ -76,9 +77,10 @@ module Kafo
76
77
 
77
78
  @config.modules.sort.each do |mod|
78
79
  mod.params.sort.each do |param|
80
+ html_doc = CGI.escapeHTML(param.doc.join(' '))
79
81
  puts ' <tr>'
80
82
  puts " <td style='white-space:nowrap'>#{parametrize(param)}</td>"
81
- puts " <td>#{param.doc.join(' ')}</td>"
83
+ puts " <td>#{html_doc}</td>"
82
84
  puts ' </tr>'
83
85
  end
84
86
  end
@@ -129,7 +131,8 @@ module Kafo
129
131
  puts "| #{'-'*40} | #{'-' * @max} |"
130
132
  @config.modules.sort.each do |mod|
131
133
  mod.params.sort.each do |param|
132
- puts "| #{parametrize(param).ljust(40)} | #{param.doc.join(' ').ljust(@max)} |"
134
+ html_doc = CGI.escapeHTML(param.doc.join(' '))
135
+ puts "| #{parametrize(param).ljust(40)} | #{html_doc.ljust(@max)} |"
133
136
  end
134
137
  end
135
138
  end
@@ -50,11 +50,21 @@ module Kafo
50
50
  false
51
51
  end
52
52
 
53
- def self.format_command(command)
53
+ # Format a command for use in Open3 that properly filters the environment
54
+ # for use with Puppet
55
+ #
56
+ # @param command [String, Array]
57
+ # The command to execute. A string implies it'll run with a shell while
58
+ # an array runs without. That removes the need to escape input and is
59
+ # recommended.
60
+ # @return [Array]
61
+ # A command for use in Open3
62
+ def self.format_command(command, extra_env = {})
63
+ cmd = command.is_a?(Array) ? command : [command]
54
64
  if aio_puppet?
55
- [clean_env_vars, command, :unsetenv_others => true]
65
+ [clean_env_vars.merge(extra_env)] + cmd + [:unsetenv_others => true]
56
66
  else
57
- [::ENV, command, :unsetenv_others => false]
67
+ [::ENV.to_h.merge(extra_env)] + cmd + [:unsetenv_others => false]
58
68
  end
59
69
  end
60
70
 
data/lib/kafo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "7.5.1"
4
+ VERSION = "7.6.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.5.1
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-16 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -215,17 +215,8 @@ files:
215
215
  - bin/kafofy
216
216
  - config/config_header.txt
217
217
  - config/kafo.yaml.example
218
- - doc/Kafo.html
219
- - doc/_index.html
220
- - doc/class_list.html
221
- - doc/file.README.html
222
- - doc/file_list.html
223
- - doc/frames.html
224
- - doc/index.html
225
218
  - doc/kafo_run.png
226
219
  - doc/kafo_run.uml
227
- - doc/method_list.html
228
- - doc/top-level-namespace.html
229
220
  - lib/kafo.rb
230
221
  - lib/kafo/app_option/declaration.rb
231
222
  - lib/kafo/app_option/definition.rb
data/doc/Kafo.html DELETED
@@ -1,151 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Module: Kafo
8
-
9
- &mdash; Documentation by YARD 0.9.36
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" />
16
-
17
- <script type="text/javascript">
18
- pathId = "Kafo";
19
- relpath = '';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="_index.html">Index (K)</a> &raquo;
40
-
41
-
42
- <span class="title">Kafo</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Module: Kafo
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
- <dl>
80
- <dt>Defined in:</dt>
81
- <dd>lib/kafo/kafo_configure.rb<span class="defines">,<br />
82
- lib/kafo/param.rb,<br /> lib/kafo/store.rb,<br /> lib/kafo/logger.rb,<br /> lib/kafo/wizard.rb,<br /> lib/kafo/hooking.rb,<br /> lib/kafo/logging.rb,<br /> lib/kafo/version.rb,<br /> lib/kafo/condition.rb,<br /> lib/kafo/data_type.rb,<br /> lib/kafo/exceptions.rb,<br /> lib/kafo/migrations.rb,<br /> lib/kafo/fact_writer.rb,<br /> lib/kafo/param_group.rb,<br /> lib/kafo/base_context.rb,<br /> lib/kafo/color_scheme.rb,<br /> lib/kafo/exit_handler.rb,<br /> lib/kafo/hook_context.rb,<br /> lib/kafo/progress_bar.rb,<br /> lib/kafo/configuration.rb,<br /> lib/kafo/param_builder.rb,<br /> lib/kafo/puppet_module.rb,<br /> lib/kafo/puppet_report.rb,<br /> lib/kafo/string_helper.rb,<br /> lib/kafo/data_types/any.rb,<br /> lib/kafo/kafo_configure.rb,<br /> lib/kafo/puppet_command.rb,<br /> lib/kafo/system_checker.rb,<br /> lib/kafo/data_types/enum.rb,<br /> lib/kafo/data_types/hash.rb,<br /> lib/kafo/scenario_option.rb,<br /> lib/kafo/data_type_parser.rb,<br /> lib/kafo/data_types/array.rb,<br /> lib/kafo/data_types/float.rb,<br /> lib/kafo/data_types/tuple.rb,<br /> lib/kafo/data_types/undef.rb,<br /> lib/kafo/hiera_configurer.rb,<br /> lib/kafo/multi_stage_hook.rb,<br /> lib/kafo/scenario_manager.rb,<br /> lib/kafo/data_types/regexp.rb,<br /> lib/kafo/data_types/scalar.rb,<br /> lib/kafo/data_types/string.rb,<br /> lib/kafo/data_types/struct.rb,<br /> lib/kafo/migration_context.rb,<br /> lib/kafo/puppet_configurer.rb,<br /> lib/kafo/puppet_log_parser.rb,<br /> lib/kafo/data_types/aliases.rb,<br /> lib/kafo/data_types/boolean.rb,<br /> lib/kafo/data_types/integer.rb,<br /> lib/kafo/data_types/numeric.rb,<br /> lib/kafo/data_types/pattern.rb,<br /> lib/kafo/help_builders/base.rb,<br /> lib/kafo/data_types/optional.rb,<br /> lib/kafo/help_builders/basic.rb,<br /> lib/kafo/parser_cache_reader.rb,<br /> lib/kafo/parser_cache_writer.rb,<br /> lib/kafo/data_types/not_undef.rb,<br /> lib/kafo/app_option/definition.rb,<br /> lib/kafo/execution_environment.rb,<br /> lib/kafo/progress_bars/colored.rb,<br /> lib/kafo/app_option/declaration.rb,<br /> lib/kafo/help_builders/advanced.rb,<br /> lib/kafo/puppet_failed_resource.rb,<br /> lib/kafo/data_types/type_reference.rb,<br /> lib/kafo/progress_bars/black_white.rb,<br /> lib/kafo/data_types/wrapped_data_type.rb</span>
83
- </dd>
84
- </dl>
85
-
86
- </div>
87
-
88
- <h2>Overview</h2><div class="docstring">
89
- <div class="discussion">
90
-
91
- <p>First of all we have to store ENV variable, requiring facter can override them</p>
92
-
93
-
94
- </div>
95
- </div>
96
- <div class="tags">
97
-
98
-
99
- </div><h2>Defined Under Namespace</h2>
100
- <p class="children">
101
-
102
-
103
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Kafo/AppOption.html" title="Kafo::AppOption (module)">AppOption</a></span>, <span class='object_link'><a href="Kafo/DataTypes.html" title="Kafo::DataTypes (module)">DataTypes</a></span>, <span class='object_link'><a href="Kafo/ENV.html" title="Kafo::ENV (module)">ENV</a></span>, <span class='object_link'><a href="Kafo/HelpBuilders.html" title="Kafo::HelpBuilders (module)">HelpBuilders</a></span>, <span class='object_link'><a href="Kafo/ProgressBars.html" title="Kafo::ProgressBars (module)">ProgressBars</a></span>, <span class='object_link'><a href="Kafo/StringHelper.html" title="Kafo::StringHelper (module)">StringHelper</a></span>
104
-
105
-
106
-
107
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Kafo/BaseContext.html" title="Kafo::BaseContext (class)">BaseContext</a></span>, <span class='object_link'><a href="Kafo/ColorScheme.html" title="Kafo::ColorScheme (class)">ColorScheme</a></span>, <span class='object_link'><a href="Kafo/Condition.html" title="Kafo::Condition (class)">Condition</a></span>, <span class='object_link'><a href="Kafo/ConditionError.html" title="Kafo::ConditionError (class)">ConditionError</a></span>, <span class='object_link'><a href="Kafo/Configuration.html" title="Kafo::Configuration (class)">Configuration</a></span>, <span class='object_link'><a href="Kafo/ConfigurationException.html" title="Kafo::ConfigurationException (class)">ConfigurationException</a></span>, <span class='object_link'><a href="Kafo/DataType.html" title="Kafo::DataType (class)">DataType</a></span>, <span class='object_link'><a href="Kafo/DataTypeParser.html" title="Kafo::DataTypeParser (class)">DataTypeParser</a></span>, <span class='object_link'><a href="Kafo/ExecutionEnvironment.html" title="Kafo::ExecutionEnvironment (class)">ExecutionEnvironment</a></span>, <span class='object_link'><a href="Kafo/ExitHandler.html" title="Kafo::ExitHandler (class)">ExitHandler</a></span>, <span class='object_link'><a href="Kafo/FactWriter.html" title="Kafo::FactWriter (class)">FactWriter</a></span>, <span class='object_link'><a href="Kafo/HieraConfigurer.html" title="Kafo::HieraConfigurer (class)">HieraConfigurer</a></span>, <span class='object_link'><a href="Kafo/HookContext.html" title="Kafo::HookContext (class)">HookContext</a></span>, <span class='object_link'><a href="Kafo/Hooking.html" title="Kafo::Hooking (class)">Hooking</a></span>, <span class='object_link'><a href="Kafo/KafoConfigure.html" title="Kafo::KafoConfigure (class)">KafoConfigure</a></span>, <span class='object_link'><a href="Kafo/Logger.html" title="Kafo::Logger (class)">Logger</a></span>, <span class='object_link'><a href="Kafo/Logging.html" title="Kafo::Logging (class)">Logging</a></span>, <span class='object_link'><a href="Kafo/MigrationContext.html" title="Kafo::MigrationContext (class)">MigrationContext</a></span>, <span class='object_link'><a href="Kafo/Migrations.html" title="Kafo::Migrations (class)">Migrations</a></span>, <span class='object_link'><a href="Kafo/MultiStageHook.html" title="Kafo::MultiStageHook (class)">MultiStageHook</a></span>, <span class='object_link'><a href="Kafo/Param.html" title="Kafo::Param (class)">Param</a></span>, <span class='object_link'><a href="Kafo/ParamBuilder.html" title="Kafo::ParamBuilder (class)">ParamBuilder</a></span>, <span class='object_link'><a href="Kafo/ParamGroup.html" title="Kafo::ParamGroup (class)">ParamGroup</a></span>, <span class='object_link'><a href="Kafo/ParserCacheReader.html" title="Kafo::ParserCacheReader (class)">ParserCacheReader</a></span>, <span class='object_link'><a href="Kafo/ParserCacheWriter.html" title="Kafo::ParserCacheWriter (class)">ParserCacheWriter</a></span>, <span class='object_link'><a href="Kafo/ParserError.html" title="Kafo::ParserError (class)">ParserError</a></span>, <span class='object_link'><a href="Kafo/ProgressBar.html" title="Kafo::ProgressBar (class)">ProgressBar</a></span>, <span class='object_link'><a href="Kafo/PuppetCommand.html" title="Kafo::PuppetCommand (class)">PuppetCommand</a></span>, <span class='object_link'><a href="Kafo/PuppetConfigurer.html" title="Kafo::PuppetConfigurer (class)">PuppetConfigurer</a></span>, <span class='object_link'><a href="Kafo/PuppetFailedResource.html" title="Kafo::PuppetFailedResource (class)">PuppetFailedResource</a></span>, <span class='object_link'><a href="Kafo/PuppetLogParser.html" title="Kafo::PuppetLogParser (class)">PuppetLogParser</a></span>, <span class='object_link'><a href="Kafo/PuppetModule.html" title="Kafo::PuppetModule (class)">PuppetModule</a></span>, <span class='object_link'><a href="Kafo/PuppetReport.html" title="Kafo::PuppetReport (class)">PuppetReport</a></span>, <span class='object_link'><a href="Kafo/PuppetReportError.html" title="Kafo::PuppetReportError (class)">PuppetReportError</a></span>, <span class='object_link'><a href="Kafo/ScenarioManager.html" title="Kafo::ScenarioManager (class)">ScenarioManager</a></span>, <span class='object_link'><a href="Kafo/ScenarioOption.html" title="Kafo::ScenarioOption (class)">ScenarioOption</a></span>, <span class='object_link'><a href="Kafo/Store.html" title="Kafo::Store (class)">Store</a></span>, <span class='object_link'><a href="Kafo/SystemChecker.html" title="Kafo::SystemChecker (class)">SystemChecker</a></span>, <span class='object_link'><a href="Kafo/Wizard.html" title="Kafo::Wizard (class)">Wizard</a></span>
108
-
109
-
110
- </p>
111
-
112
-
113
- <h2>
114
- Constant Summary
115
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
116
- </h2>
117
-
118
- <dl class="constants">
119
-
120
- <dt id="PARSER_CACHE_VERSION-constant" class="">PARSER_CACHE_VERSION =
121
-
122
- </dt>
123
- <dd><pre class="code"><span class='int'>1</span></pre></dd>
124
-
125
- <dt id="VERSION-constant" class="">VERSION =
126
-
127
- </dt>
128
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>7.5.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
129
-
130
- </dl>
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
- </div>
142
-
143
- <div id="footer">
144
- Generated on Thu Aug 8 18:22:10 2024 by
145
- <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
146
- 0.9.36 (ruby-3.2.4).
147
- </div>
148
-
149
- </div>
150
- </body>
151
- </html>