puppet-modulebuilder 1.1.0 → 2.0.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: 1e3b99ce5da4071720566c77f44583561146cc8eb93f067b46df09b41a496f9a
4
- data.tar.gz: 8d414dcd3940dc02f5fe0a6580a5b52be4a24e4249869488d7c64816d51e1c25
3
+ metadata.gz: 05a8a7a5f6a232a88809f50d10b4a9c4dee9b4a425e29612ca2309919c0d6fc9
4
+ data.tar.gz: 27d621ca9b24fa55b1da29a1e53b2280c3d67d74e261ae423509cd63b7f37bd9
5
5
  SHA512:
6
- metadata.gz: 72f79579ecefd1fa236f084d811b670c62ba06468270fd88689d086d47868e23287e22634e3b0f1aec81463d9fc2c47a6b96b179b1b822305448dd2c45e603a2
7
- data.tar.gz: 83e3c4375ae4f14be9a27b960042a377debee4479ace71ba697faddac636b1317df151652d087d30d77a8cdff339a73c868195a2831a143bc43468042be8744d
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-06-28 12:03:58 UTC using RuboCop version 1.64.1.
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: 4
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: 13
37
+ # Offense count: 8
38
38
  # Configuration parameters: AllowSubject.
39
39
  RSpec/MultipleMemoizedHelpers:
40
40
  Max: 8
41
41
 
42
- # Offense count: 8
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: 3
49
+ # Offense count: 1
50
50
  # Configuration parameters: AllowedGroups.
51
51
  RSpec/NestedGroups:
52
- Max: 5
52
+ Max: 4
53
53
 
54
- # Offense count: 32
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
- DEFAULT_IGNORED = [
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
- '/pkg/',
11
- '~*',
12
- '/coverage',
13
- '/checksums.json',
14
- '/REVISION',
15
- '/spec/fixtures/modules/',
16
- '/vendor/',
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
- @ignored_files ||=
255
- begin
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
- DEFAULT_IGNORED.each { |r| ignored.add(r) }
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppet
4
4
  module Modulebuilder
5
- VERSION = '1.1.0'
5
+ VERSION = '2.0.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-modulebuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheena