abide_dev_utils 0.18.8 → 0.18.9
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/Gemfile.lock +1 -1
- data/lib/abide_dev_utils/sce/generate/reference.rb +29 -6
- data/lib/abide_dev_utils/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8cfa1f253500e43f42a6fa53de2da238f79ac12dc286c945488b8e521b2b7868
|
|
4
|
+
data.tar.gz: f357e24f825f8ffd304fe779f390ea5bdc00c0fb06bef9a6d7e2d228759ecb05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45dc1ae54c5b5f0486d889d18151269105938abe5fc1a55c7d7bf0a6d9f62e4cd39d36c7fa2ee7d27cbb36c099fd237da605f7f528823869c34004e023c0f745
|
|
7
|
+
data.tar.gz: d7474b5c61a1ee3249fa2eaa70ad63123b2509b79757cbbf3cef7c7cd858e8e0cc2f047a4917ab073693459874f61f26d0c4e55e3e5664f6e80a29092c9deee9
|
data/Gemfile.lock
CHANGED
|
@@ -324,7 +324,9 @@ module AbideDevUtils
|
|
|
324
324
|
@control_data[ctrl_param[:name]][:default] = ctrl_param[:default] || rsrc_param&.value
|
|
325
325
|
return unless @control_data[ctrl_param[:name]][:default]
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
default = @control_data[ctrl_param[:name]][:default]
|
|
328
|
+
default_str = [Hash, Array].any? { |t| default.is_a?(t) } ? @formatter.yaml_flow(default) : default
|
|
329
|
+
" - #{@md.italic('Default:')} #{@md.code(default_str)}"
|
|
328
330
|
end
|
|
329
331
|
|
|
330
332
|
def param_description(ctrl_param)
|
|
@@ -467,18 +469,39 @@ module AbideDevUtils
|
|
|
467
469
|
end
|
|
468
470
|
end
|
|
469
471
|
|
|
470
|
-
# Escapes and quotes a string.
|
|
471
|
-
#
|
|
472
|
-
# @
|
|
473
|
-
# @return [
|
|
472
|
+
# Escapes and quotes a string. Hash and Array values are formatted as
|
|
473
|
+
# YAML flow-style so they produce valid YAML when embedded in a code block.
|
|
474
|
+
# @param value [Any] the value to quote.
|
|
475
|
+
# @return [String] the quoted/formatted value.
|
|
474
476
|
def self.quote(value)
|
|
475
|
-
|
|
477
|
+
case value
|
|
478
|
+
when String
|
|
476
479
|
value.inspect
|
|
480
|
+
when Hash, Array
|
|
481
|
+
yaml_flow(value)
|
|
477
482
|
else
|
|
478
483
|
value
|
|
479
484
|
end
|
|
480
485
|
end
|
|
481
486
|
|
|
487
|
+
# Recursively formats a Hash or Array as a YAML flow-style scalar so it
|
|
488
|
+
# can be embedded inline in a YAML code block without Ruby hash-rocket syntax.
|
|
489
|
+
# @param value [Any] the value to format.
|
|
490
|
+
# @return [String] the YAML flow-style representation.
|
|
491
|
+
def self.yaml_flow(value)
|
|
492
|
+
case value
|
|
493
|
+
when Hash
|
|
494
|
+
pairs = value.map { |k, v| "#{k}: #{yaml_flow(v)}" }.join(', ')
|
|
495
|
+
"{#{pairs}}"
|
|
496
|
+
when Array
|
|
497
|
+
"[#{value.map { |v| yaml_flow(v) }.join(', ')}]"
|
|
498
|
+
when String
|
|
499
|
+
value
|
|
500
|
+
else
|
|
501
|
+
value.to_s
|
|
502
|
+
end
|
|
503
|
+
end
|
|
504
|
+
|
|
482
505
|
# Checks if a value is considered undef.
|
|
483
506
|
# @param value [Any] the value to check.
|
|
484
507
|
# @return [Boolean] true if value is considered undef (nil or 'undef').
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: abide_dev_utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- abide-team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: nokogiri
|
|
@@ -478,7 +477,6 @@ metadata:
|
|
|
478
477
|
source_code_uri: https://github.com/puppetlabs/abide_dev_utils
|
|
479
478
|
changelog_uri: https://github.com/puppetlabs/abide_dev_utils
|
|
480
479
|
rubygems_mfa_required: 'true'
|
|
481
|
-
post_install_message:
|
|
482
480
|
rdoc_options: []
|
|
483
481
|
require_paths:
|
|
484
482
|
- lib
|
|
@@ -493,8 +491,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
493
491
|
- !ruby/object:Gem::Version
|
|
494
492
|
version: '0'
|
|
495
493
|
requirements: []
|
|
496
|
-
rubygems_version: 3.
|
|
497
|
-
signing_key:
|
|
494
|
+
rubygems_version: 3.6.9
|
|
498
495
|
specification_version: 4
|
|
499
496
|
summary: Helper utilities for developing compliance Puppet code
|
|
500
497
|
test_files: []
|