smart_proxy_openscap 0.6.7 → 0.6.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46266786f19a4f1fd7aa1ad487310855685d1dba
4
- data.tar.gz: d352fd8adc7ea2b53db56fd405b9eb6c1b7ec842
3
+ metadata.gz: 1d6c00f161b70fbab31c6ccf9c8bdf9ab2682fa3
4
+ data.tar.gz: cbb4bc57214e6f68c19fe30fff5448d188190d7a
5
5
  SHA512:
6
- metadata.gz: ea02f6412f880c8f2bdc910d93cd144ffef2b9f08362272286aece54f38baac730fea7527f68e4eda32b45ace2c1ebf447eba485233959a3314931580eaf07fb
7
- data.tar.gz: 3ee40b98764a161555babd11e0dc9204394fda7365e9c884d9ebdb693015395cab4706d7fc12e4c7cb99192a6889375b37e2b5aff3717fefda8f560cef595343
6
+ metadata.gz: db24f262b735f44a7b60f30ed0b89eeb78cc1b5daaebc14bdae22b663063e8c000dbda9ea5b0d3e6bda081dc67af6bb5d9033930f67c0876dc904074d2fed4f0
7
+ data.tar.gz: c2c87b3bde1eec166aed4c064c52b0beabfb2f366492a1fb3492423f44b78a7398fcbea0fbd261287e8c7e15145b41c7070986214c3b2eb42d332ea7adc88eb6
@@ -7,6 +7,7 @@ module Proxy
7
7
  def generate_html(file_in, file_out)
8
8
  ::OpenSCAP.oscap_init
9
9
  File.write file_out, get_arf_html(file_in)
10
+ ensure
10
11
  ::OpenSCAP.oscap_cleanup
11
12
  end
12
13
 
@@ -14,8 +14,9 @@ module Proxy
14
14
  profile_id = policy ? nil : policy
15
15
  html = sds.html_guide profile_id
16
16
  File.write(out_file, { :html => html.force_encoding('UTF-8') }.to_json)
17
- sds.destroy
18
- source.destroy
17
+ ensure
18
+ sds.destroy if sds
19
+ source.destroy if source
19
20
  ::OpenSCAP.oscap_cleanup
20
21
  end
21
22
  end
@@ -13,22 +13,25 @@ module Proxy
13
13
  source = ::OpenSCAP::Source.new(in_file)
14
14
  json = type == 'scap_content' ? scap_content_profiles(source) : tailoring_profiles(source)
15
15
  File.write out_file, json
16
- source.destroy
16
+ ensure
17
+ source.destroy if source
17
18
  ::OpenSCAP.oscap_cleanup
18
19
  end
19
20
 
20
21
  def scap_content_profiles(source)
21
22
  bench = benchmark_profiles source
22
23
  profiles = collect_profiles bench
23
- bench.destroy
24
24
  profiles.to_json
25
+ ensure
26
+ bench.destroy if bench
25
27
  end
26
28
 
27
29
  def tailoring_profiles(source)
28
30
  tailoring = ::OpenSCAP::Xccdf::Tailoring.new(source, nil)
29
31
  profiles = collect_profiles tailoring
30
- tailoring.destroy
31
32
  profiles.to_json
33
+ ensure
34
+ tailoring.destroy if tailoring
32
35
  end
33
36
 
34
37
  def collect_profiles(profile_source)
@@ -41,8 +44,8 @@ module Proxy
41
44
  sds = ::OpenSCAP::DS::Sds.new(source)
42
45
  bench_source = sds.select_checklist!
43
46
  benchmark = ::OpenSCAP::Xccdf::Benchmark.new(bench_source)
44
- sds.destroy
45
- benchmark
47
+ ensure
48
+ sds.destroy if sds
46
49
  end
47
50
  end
48
51
  end
@@ -26,7 +26,8 @@ module Proxy
26
26
  errors << "Invalid SCAP file type"
27
27
  end
28
28
  File.write out_file, { :errors => errors }.to_json
29
- source.destroy
29
+ ensure
30
+ source.destroy if source
30
31
  ::OpenSCAP.oscap_cleanup
31
32
  end
32
33
  end
@@ -10,6 +10,6 @@
10
10
 
11
11
  module Proxy
12
12
  module OpenSCAP
13
- VERSION = '0.6.7'
13
+ VERSION = '0.6.8'
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Šimon Lukašík
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-09-14 00:00:00.000000000 Z
13
+ date: 2017-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake