compliance_engine 0.1.4 → 0.1.6
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 +6 -0
- data/compliance_engine.gemspec +2 -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 +6 -4
- data/lib/compliance_engine/version.rb +1 -1
- metadata +32 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9cf000d354045bd026560c6973a78b8939d7e1afbcabcfceea28514c9cad4cb2
|
|
4
|
+
data.tar.gz: 4d2bc0af35450a9304c54894935898438a220f4a9dd2ec3cf27fd4464fdc85f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46feb241ff9d68a5664992212a4b5b30852359e94a9b97b4d9adc26189fa18a8112e3c2ee3ff7b8eeacd717b315a1d38535e7f2a44266c88cc029559529d5d5e
|
|
7
|
+
data.tar.gz: 894d7860b229bf92db40bf7ca4583d1119da1b047b04899e99c2a3054e3c195770fddd0eb524312577acd678da3b7b5c4ffe3288c5a342efe83ac3bf536b5bb6
|
data/CHANGELOG.md
CHANGED
data/compliance_engine.gemspec
CHANGED
|
@@ -26,8 +26,9 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
|
|
27
27
|
spec.add_dependency 'deep_merge', '~> 1.2'
|
|
28
28
|
spec.add_dependency 'irb', '~> 1.14'
|
|
29
|
+
spec.add_dependency 'logger', '>= 1.4', '< 2.0'
|
|
29
30
|
spec.add_dependency 'observer', '~> 0.1'
|
|
30
|
-
spec.add_dependency 'rubyzip', '
|
|
31
|
+
spec.add_dependency 'rubyzip', '>= 2.3', '< 4'
|
|
31
32
|
spec.add_dependency 'semantic_puppet', '~> 1.1'
|
|
32
33
|
spec.add_dependency 'thor', '~> 1.3'
|
|
33
34
|
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')
|
|
@@ -40,8 +42,8 @@ class ComplianceEngine::ModuleLoader
|
|
|
40
42
|
# Using .each here to make mocking with rspec easier.
|
|
41
43
|
globs.each do |glob|
|
|
42
44
|
dirclass.glob(glob).sort.each do |file|
|
|
43
|
-
key = if
|
|
44
|
-
File.join(
|
|
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.6
|
|
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
|
|
@@ -38,6 +37,26 @@ dependencies:
|
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '1.14'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: logger
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '1.4'
|
|
47
|
+
- - "<"
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '2.0'
|
|
50
|
+
type: :runtime
|
|
51
|
+
prerelease: false
|
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '1.4'
|
|
57
|
+
- - "<"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '2.0'
|
|
41
60
|
- !ruby/object:Gem::Dependency
|
|
42
61
|
name: observer
|
|
43
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -56,16 +75,22 @@ dependencies:
|
|
|
56
75
|
name: rubyzip
|
|
57
76
|
requirement: !ruby/object:Gem::Requirement
|
|
58
77
|
requirements:
|
|
59
|
-
- - "
|
|
78
|
+
- - ">="
|
|
60
79
|
- !ruby/object:Gem::Version
|
|
61
80
|
version: '2.3'
|
|
81
|
+
- - "<"
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '4'
|
|
62
84
|
type: :runtime
|
|
63
85
|
prerelease: false
|
|
64
86
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
87
|
requirements:
|
|
66
|
-
- - "
|
|
88
|
+
- - ">="
|
|
67
89
|
- !ruby/object:Gem::Version
|
|
68
90
|
version: '2.3'
|
|
91
|
+
- - "<"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '4'
|
|
69
94
|
- !ruby/object:Gem::Dependency
|
|
70
95
|
name: semantic_puppet
|
|
71
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,7 +119,6 @@ dependencies:
|
|
|
94
119
|
- - "~>"
|
|
95
120
|
- !ruby/object:Gem::Version
|
|
96
121
|
version: '1.3'
|
|
97
|
-
description:
|
|
98
122
|
email:
|
|
99
123
|
- steve@sicura.us
|
|
100
124
|
executables:
|
|
@@ -134,9 +158,8 @@ licenses:
|
|
|
134
158
|
metadata:
|
|
135
159
|
homepage_uri: https://simp-project.com/docs/sce/
|
|
136
160
|
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.
|
|
161
|
+
changelog_uri: https://github.com/simp/rubygem-simp-compliance_engine/releases/tag/0.1.6
|
|
138
162
|
bug_tracker_uri: https://github.com/simp/rubygem-simp-compliance_engine/issues
|
|
139
|
-
post_install_message:
|
|
140
163
|
rdoc_options: []
|
|
141
164
|
require_paths:
|
|
142
165
|
- lib
|
|
@@ -151,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
174
|
- !ruby/object:Gem::Version
|
|
152
175
|
version: '0'
|
|
153
176
|
requirements: []
|
|
154
|
-
rubygems_version:
|
|
155
|
-
signing_key:
|
|
177
|
+
rubygems_version: 4.0.3
|
|
156
178
|
specification_version: 4
|
|
157
179
|
summary: Parser for Sicura Compliance Engine data
|
|
158
180
|
test_files: []
|