puppet-modulebuilder 1.1.0 → 2.0.0
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/.rubocop_todo.yml +7 -7
- data/CHANGELOG.md +8 -0
- data/lib/puppet/modulebuilder/builder.rb +25 -36
- data/lib/puppet/modulebuilder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05a8a7a5f6a232a88809f50d10b4a9c4dee9b4a425e29612ca2309919c0d6fc9
|
4
|
+
data.tar.gz: 27d621ca9b24fa55b1da29a1e53b2280c3d67d74e261ae423509cd63b7f37bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af2ac39ef0e40a3000b5a252375f0e448e2aee455e96f1a9cbac8d0a5b72d905febbf24a29dd8a71bbc9d469559c21aaac0384815a784a3b7c93dccd6a3a6b20
|
7
|
+
data.tar.gz: 3a78db102c55cda296dd9619533e53516e067348789183c4bcc5b1a7a846107af5d2f368a10e15a2e23cda62bcbde23a59e730a9019f15e02a0630bac2833db4
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2024-
|
3
|
+
# on 2024-07-05 11:25:28 UTC using RuboCop version 1.64.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -11,7 +11,7 @@ Lint/MixedRegexpCaptureTypes:
|
|
11
11
|
Exclude:
|
12
12
|
- 'Gemfile'
|
13
13
|
|
14
|
-
# Offense count:
|
14
|
+
# Offense count: 2
|
15
15
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
16
16
|
# Prefixes: when, with, without
|
17
17
|
RSpec/ContextWording:
|
@@ -34,24 +34,24 @@ RSpec/MessageSpies:
|
|
34
34
|
RSpec/MultipleExpectations:
|
35
35
|
Max: 11
|
36
36
|
|
37
|
-
# Offense count:
|
37
|
+
# Offense count: 8
|
38
38
|
# Configuration parameters: AllowSubject.
|
39
39
|
RSpec/MultipleMemoizedHelpers:
|
40
40
|
Max: 8
|
41
41
|
|
42
|
-
# Offense count:
|
42
|
+
# Offense count: 5
|
43
43
|
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
44
44
|
# SupportedStyles: always, named_only
|
45
45
|
RSpec/NamedSubject:
|
46
46
|
Exclude:
|
47
47
|
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'
|
48
48
|
|
49
|
-
# Offense count:
|
49
|
+
# Offense count: 1
|
50
50
|
# Configuration parameters: AllowedGroups.
|
51
51
|
RSpec/NestedGroups:
|
52
|
-
Max:
|
52
|
+
Max: 4
|
53
53
|
|
54
|
-
# Offense count:
|
54
|
+
# Offense count: 28
|
55
55
|
RSpec/SubjectStub:
|
56
56
|
Exclude:
|
57
57
|
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
|
6
6
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
|
7
7
|
|
8
|
+
## [v2.0.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v2.0.0) - 2024-09-17
|
9
|
+
|
10
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v1.1.0...v2.0.0)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Implement allowlist for puppet module content [#79](https://github.com/puppetlabs/puppet-modulebuilder/pull/79) ([bastelfreak](https://github.com/bastelfreak))
|
15
|
+
|
8
16
|
## [v1.1.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v1.1.0) - 2024-09-17
|
9
17
|
|
10
18
|
[Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v1.0.0...v1.1.0)
|
@@ -5,15 +5,29 @@ require 'logger'
|
|
5
5
|
module Puppet::Modulebuilder
|
6
6
|
# Class to build Puppet Modules from source
|
7
7
|
class Builder
|
8
|
-
|
8
|
+
# Due to the way how PathSpec generates the regular expression,
|
9
|
+
# `/*` doesn't match directories starting with a dot,
|
10
|
+
# so we need `/.*` as well.
|
11
|
+
IGNORED = [
|
12
|
+
'/**',
|
9
13
|
'/.*',
|
10
|
-
'
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'
|
14
|
-
'
|
15
|
-
'
|
16
|
-
'
|
14
|
+
'!/CHANGELOG*',
|
15
|
+
'!/LICENSE',
|
16
|
+
'!/README*',
|
17
|
+
'!/REFERENCE.md',
|
18
|
+
'!/bolt_plugin.json',
|
19
|
+
'!/data/**',
|
20
|
+
'!/docs/**',
|
21
|
+
'!/files/**',
|
22
|
+
'!/hiera.yaml',
|
23
|
+
'!/locales/**',
|
24
|
+
'!/manifests/**',
|
25
|
+
'!/metadata.json',
|
26
|
+
'!/plans/**',
|
27
|
+
'!/scripts/**',
|
28
|
+
'!/tasks/**',
|
29
|
+
'!/templates/**',
|
30
|
+
'!/types/**',
|
17
31
|
].freeze
|
18
32
|
|
19
33
|
attr_reader :destination, :logger
|
@@ -168,21 +182,6 @@ module Puppet::Modulebuilder
|
|
168
182
|
from: symlink_path.relative_path_from(module_path), to: symlink_path.realpath.relative_path_from(module_path))
|
169
183
|
end
|
170
184
|
|
171
|
-
# Select the most appropriate ignore file in the module directory.
|
172
|
-
#
|
173
|
-
# In order of preference, we first try `.pdkignore`, then `.pmtignore`
|
174
|
-
# and finally `.gitignore`.
|
175
|
-
#
|
176
|
-
# @return [String] The path to the file containing the patterns of file
|
177
|
-
# paths to ignore.
|
178
|
-
def ignore_file
|
179
|
-
@ignore_file ||= [
|
180
|
-
File.join(source, '.pdkignore'),
|
181
|
-
File.join(source, '.pmtignore'),
|
182
|
-
File.join(source, '.gitignore'),
|
183
|
-
].find { |file| file_exists?(file) && file_readable?(file) }
|
184
|
-
end
|
185
|
-
|
186
185
|
# Checks if the path contains any non-ASCII characters.
|
187
186
|
#
|
188
187
|
# Java will throw an error when it encounters a path containing
|
@@ -251,20 +250,10 @@ module Puppet::Modulebuilder
|
|
251
250
|
def ignored_files
|
252
251
|
require 'pathspec'
|
253
252
|
|
254
|
-
|
255
|
-
|
256
|
-
ignored = if ignore_file.nil?
|
257
|
-
PathSpec.new
|
258
|
-
else
|
259
|
-
PathSpec.new(read_file(ignore_file, open_args: 'rb:UTF-8'))
|
260
|
-
end
|
261
|
-
|
262
|
-
ignored = ignored.add("/#{File.basename(destination)}/") if File.realdirpath(destination).start_with?(File.realdirpath(source))
|
253
|
+
ignored = PathSpec.new(IGNORED)
|
254
|
+
ignored.add("/#{File.basename(destination)}/") if File.realdirpath(destination).start_with?(File.realdirpath(source))
|
263
255
|
|
264
|
-
|
265
|
-
|
266
|
-
ignored
|
267
|
-
end
|
256
|
+
ignored
|
268
257
|
end
|
269
258
|
|
270
259
|
# Create a temporary build directory where the files to be included in
|