compliance_engine 0.1.3 → 0.1.5
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/CHANGELOG.md +7 -0
- data/compliance_engine.gemspec +1 -1
- data/lib/compliance_engine/data.rb +1 -6
- data/lib/compliance_engine/environment_loader/zip.rb +1 -1
- data/lib/compliance_engine/environment_loader.rb +5 -3
- data/lib/compliance_engine/module_loader.rb +7 -5
- data/lib/compliance_engine/version.rb +1 -1
- metadata +12 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dbd845dda86bd56f683bf88d248f27af366046126a0bf112486555f56b3e0eb0
|
|
4
|
+
data.tar.gz: 5be3bd18377c0b6d2dd49c3d0ab69f53becde97bace7fc9c5a257b96b490560e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3724f3a4924117858fc1064f46dfef8354d19ae29c45d3d3947b48c7e924b68bf2c0d640db0fe19bfa1f566efc91b768296ec60e21309208ae551d628bda70e4
|
|
7
|
+
data.tar.gz: c390e3a1e3d95830ad328068aa47c1de4cda0018d86fefbe906d3675956013343b8abd823db9154b0fe637d11d2f1a7584f8dd9b025b2924ba01084c1571fd8c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### 0.1.5 / 2026-01-08
|
|
2
|
+
* Add rubyzip 3.x support (#69)
|
|
3
|
+
|
|
4
|
+
### 0.1.4 / 2025-06-04
|
|
5
|
+
* Use OpenVox in the dev container (#50)
|
|
6
|
+
* Sort glob entries to avoid more GHA test failures
|
|
7
|
+
|
|
1
8
|
### 0.1.3 / 2025-05-20
|
|
2
9
|
* Add dependency on observer gem (#47)
|
|
3
10
|
* Add Ruby 3.4 to testing matrix
|
data/compliance_engine.gemspec
CHANGED
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_dependency 'deep_merge', '~> 1.2'
|
|
28
28
|
spec.add_dependency 'irb', '~> 1.14'
|
|
29
29
|
spec.add_dependency 'observer', '~> 0.1'
|
|
30
|
-
spec.add_dependency 'rubyzip', '
|
|
30
|
+
spec.add_dependency 'rubyzip', '>= 2.3', '< 4'
|
|
31
31
|
spec.add_dependency 'semantic_puppet', '~> 1.1'
|
|
32
32
|
spec.add_dependency 'thor', '~> 1.3'
|
|
33
33
|
end
|
|
@@ -137,12 +137,7 @@ class ComplianceEngine::Data
|
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
if fileclass.file?(path)
|
|
140
|
-
key
|
|
141
|
-
File.join(path.zipfile.to_s, '.', path.to_s)
|
|
142
|
-
else
|
|
143
|
-
path.to_s
|
|
144
|
-
end
|
|
145
|
-
update(path, key: key, fileclass: fileclass)
|
|
140
|
+
update(path, key: path.to_s, fileclass: fileclass)
|
|
146
141
|
next
|
|
147
142
|
end
|
|
148
143
|
|
|
@@ -18,7 +18,7 @@ class ComplianceEngine::EnvironmentLoader::Zip < ComplianceEngine::EnvironmentLo
|
|
|
18
18
|
dir = zipfile.dir
|
|
19
19
|
file = zipfile.file
|
|
20
20
|
|
|
21
|
-
super(root, fileclass: file, dirclass: dir)
|
|
21
|
+
super(root, fileclass: file, dirclass: dir, zipfile_path: path)
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -10,9 +10,11 @@ class ComplianceEngine::EnvironmentLoader
|
|
|
10
10
|
# @param paths [Array] the paths to search for Puppet modules
|
|
11
11
|
# @param fileclass [File] the class to use for file operations (default: `File`)
|
|
12
12
|
# @param dirclass [Dir] the class to use for directory operations (default: `Dir`)
|
|
13
|
-
|
|
13
|
+
# @param zipfile_path [String, nil] the path to the zip file if loading from a zip archive
|
|
14
|
+
def initialize(*paths, fileclass: File, dirclass: Dir, zipfile_path: nil)
|
|
14
15
|
raise ArgumentError, 'No paths specified' if paths.empty?
|
|
15
16
|
@modulepath ||= paths
|
|
17
|
+
@zipfile_path = zipfile_path
|
|
16
18
|
modules = paths.map do |path|
|
|
17
19
|
dirclass.entries(path)
|
|
18
20
|
.grep(%r{\A[a-z][a-z0-9_]*\Z})
|
|
@@ -23,8 +25,8 @@ class ComplianceEngine::EnvironmentLoader
|
|
|
23
25
|
[]
|
|
24
26
|
end
|
|
25
27
|
modules.flatten!
|
|
26
|
-
@modules = modules.map { |path| ComplianceEngine::ModuleLoader.new(path, fileclass: fileclass, dirclass: dirclass) }
|
|
28
|
+
@modules = modules.map { |path| ComplianceEngine::ModuleLoader.new(path, fileclass: fileclass, dirclass: dirclass, zipfile_path: @zipfile_path) }
|
|
27
29
|
end
|
|
28
30
|
|
|
29
|
-
attr_reader :modulepath, :modules
|
|
31
|
+
attr_reader :modulepath, :modules, :zipfile_path
|
|
30
32
|
end
|
|
@@ -11,12 +11,14 @@ class ComplianceEngine::ModuleLoader
|
|
|
11
11
|
# @param path [String] the path to the Puppet module
|
|
12
12
|
# @param fileclass [File] the class to use for file operations (default: `File`)
|
|
13
13
|
# @param dirclass [Dir] the class to use for directory operations (default: `Dir`)
|
|
14
|
-
|
|
14
|
+
# @param zipfile_path [String, nil] the path to the zip file if loading from a zip archive
|
|
15
|
+
def initialize(path, fileclass: File, dirclass: Dir, zipfile_path: nil)
|
|
15
16
|
raise ComplianceEngine::Error, "#{path} is not a directory" unless fileclass.directory?(path)
|
|
16
17
|
|
|
17
18
|
@name = nil
|
|
18
19
|
@version = nil
|
|
19
20
|
@files = []
|
|
21
|
+
@zipfile_path = zipfile_path
|
|
20
22
|
|
|
21
23
|
# Read the Puppet module's metadata.json
|
|
22
24
|
metadata_json = File.join(path.to_s, 'metadata.json')
|
|
@@ -39,9 +41,9 @@ class ComplianceEngine::ModuleLoader
|
|
|
39
41
|
}.flatten
|
|
40
42
|
# Using .each here to make mocking with rspec easier.
|
|
41
43
|
globs.each do |glob|
|
|
42
|
-
dirclass.glob(glob).each do |file|
|
|
43
|
-
key = if
|
|
44
|
-
File.join(
|
|
44
|
+
dirclass.glob(glob).sort.each do |file|
|
|
45
|
+
key = if @zipfile_path
|
|
46
|
+
File.join(@zipfile_path, '.', file.to_s)
|
|
45
47
|
else
|
|
46
48
|
file.to_s
|
|
47
49
|
end
|
|
@@ -57,5 +59,5 @@ class ComplianceEngine::ModuleLoader
|
|
|
57
59
|
end
|
|
58
60
|
end
|
|
59
61
|
|
|
60
|
-
attr_reader :name, :version, :files
|
|
62
|
+
attr_reader :name, :version, :files, :zipfile_path
|
|
61
63
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: compliance_engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Pritchard
|
|
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: deep_merge
|
|
@@ -56,16 +55,22 @@ dependencies:
|
|
|
56
55
|
name: rubyzip
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements:
|
|
59
|
-
- - "
|
|
58
|
+
- - ">="
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
60
|
version: '2.3'
|
|
61
|
+
- - "<"
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '4'
|
|
62
64
|
type: :runtime
|
|
63
65
|
prerelease: false
|
|
64
66
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
67
|
requirements:
|
|
66
|
-
- - "
|
|
68
|
+
- - ">="
|
|
67
69
|
- !ruby/object:Gem::Version
|
|
68
70
|
version: '2.3'
|
|
71
|
+
- - "<"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '4'
|
|
69
74
|
- !ruby/object:Gem::Dependency
|
|
70
75
|
name: semantic_puppet
|
|
71
76
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,7 +99,6 @@ dependencies:
|
|
|
94
99
|
- - "~>"
|
|
95
100
|
- !ruby/object:Gem::Version
|
|
96
101
|
version: '1.3'
|
|
97
|
-
description:
|
|
98
102
|
email:
|
|
99
103
|
- steve@sicura.us
|
|
100
104
|
executables:
|
|
@@ -134,9 +138,8 @@ licenses:
|
|
|
134
138
|
metadata:
|
|
135
139
|
homepage_uri: https://simp-project.com/docs/sce/
|
|
136
140
|
source_code_uri: https://github.com/simp/rubygem-simp-compliance_engine
|
|
137
|
-
changelog_uri: https://github.com/simp/rubygem-simp-compliance_engine/releases/tag/0.1.
|
|
141
|
+
changelog_uri: https://github.com/simp/rubygem-simp-compliance_engine/releases/tag/0.1.5
|
|
138
142
|
bug_tracker_uri: https://github.com/simp/rubygem-simp-compliance_engine/issues
|
|
139
|
-
post_install_message:
|
|
140
143
|
rdoc_options: []
|
|
141
144
|
require_paths:
|
|
142
145
|
- lib
|
|
@@ -151,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
154
|
- !ruby/object:Gem::Version
|
|
152
155
|
version: '0'
|
|
153
156
|
requirements: []
|
|
154
|
-
rubygems_version:
|
|
155
|
-
signing_key:
|
|
157
|
+
rubygems_version: 4.0.3
|
|
156
158
|
specification_version: 4
|
|
157
159
|
summary: Parser for Sicura Compliance Engine data
|
|
158
160
|
test_files: []
|