openscap 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +2 -0
  3. data/lib/openscap.rb +1 -10
  4. data/lib/openscap/all.rb +1 -10
  5. data/lib/openscap/ds/arf.rb +2 -10
  6. data/lib/openscap/ds/sds.rb +1 -10
  7. data/lib/openscap/exceptions.rb +1 -10
  8. data/lib/openscap/libc.rb +1 -10
  9. data/lib/openscap/openscap.rb +2 -11
  10. data/lib/openscap/source.rb +2 -13
  11. data/lib/openscap/text.rb +1 -10
  12. data/lib/openscap/version.rb +2 -11
  13. data/lib/openscap/xccdf.rb +1 -10
  14. data/lib/openscap/xccdf/benchmark.rb +1 -10
  15. data/lib/openscap/xccdf/fix.rb +2 -10
  16. data/lib/openscap/xccdf/group.rb +1 -10
  17. data/lib/openscap/xccdf/ident.rb +2 -10
  18. data/lib/openscap/xccdf/item.rb +3 -10
  19. data/lib/openscap/xccdf/policy.rb +1 -10
  20. data/lib/openscap/xccdf/policy_model.rb +1 -10
  21. data/lib/openscap/xccdf/profile.rb +1 -10
  22. data/lib/openscap/xccdf/reference.rb +2 -10
  23. data/lib/openscap/xccdf/rule.rb +2 -11
  24. data/lib/openscap/xccdf/ruleresult.rb +1 -10
  25. data/lib/openscap/xccdf/session.rb +2 -10
  26. data/lib/openscap/xccdf/tailoring.rb +1 -10
  27. data/lib/openscap/xccdf/testresult.rb +1 -10
  28. data/lib/openscap/xccdf/value.rb +1 -10
  29. data/test/common/testcase.rb +2 -11
  30. data/test/data/sds-complex.xml +1 -1
  31. data/test/ds/arf_test.rb +2 -11
  32. data/test/ds/sds_test.rb +1 -10
  33. data/test/integration/arf_waiver_test.rb +1 -10
  34. data/test/openscap_test.rb +1 -10
  35. data/test/source_test.rb +1 -10
  36. data/test/text_test.rb +1 -10
  37. data/test/xccdf/arf_test.rb +1 -10
  38. data/test/xccdf/benchmark_test.rb +5 -14
  39. data/test/xccdf/policy_test.rb +1 -10
  40. data/test/xccdf/profile_test.rb +1 -10
  41. data/test/xccdf/session_ds_test.rb +1 -10
  42. data/test/xccdf/session_test.rb +1 -10
  43. data/test/xccdf/tailoring_test.rb +1 -10
  44. data/test/xccdf/testresult_test.rb +1 -10
  45. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 622927a649b2dd5feaf2151484df58166f77b7e7
4
- data.tar.gz: e4271432dd3c6d41454ae9c1e6d70dc6522aef42
2
+ SHA256:
3
+ metadata.gz: c9d56737a95b91a18225def06b0f8a1d23a749e565b5dc302cc50e61f75ef87b
4
+ data.tar.gz: bd13f950489c98534bfbc4bc174196c449c1eece3c870dfb5dae4d88e2a11c0d
5
5
  SHA512:
6
- metadata.gz: 85e324684a3bbf5a58a179e7363f008680680b93db3e1a01635bfcdf9c9d3f22b9b61dce1f0cee2591ac83a8b5d66202863ec4042433f46c6daa7c970217f9d7
7
- data.tar.gz: 4ad741fdce87513d609a4759215f7555135c9c4be5af32185d649cd7a1c7b702a636c6720a5014aec848fc63e493a08888d64af6fd8ceca173424cacb0700dc3
6
+ metadata.gz: a8315dd1675d6589d21a7324e9b125136c2a39dae45e1be4a30a47f5ea031d06e266aef58d4dee67e58515319173f547fb7bdfab2d7a68527fde27d952069e01
7
+ data.tar.gz: df5b605d6d6bb2e995bc7f7e0358134c57ef9c32b9fb154ddcbcb26875f376644c3f132ccac0cb13a73d5e21a1d63197d812b017eb87b9ac596307e1035e591f
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
 
3
5
  Bundler::GemHelper.install_tasks :name => 'openscap'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/openscap'
13
4
  require 'openscap/exceptions'
@@ -1,12 +1,3 @@
1
- #
2
- # Copyright (c) 2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  Dir.glob(File.join(File.dirname(__FILE__), '{xccdf,ds,}', '*.rb'), &method(:require))
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/ds/sds'
13
4
  require 'openscap/source'
@@ -57,6 +48,7 @@ module OpenSCAP
57
48
  html_p = OpenSCAP.ds_rds_session_get_html_report @session
58
49
  OpenSCAP.raise! if OpenSCAP.error?
59
50
  return nil if html_p.null?
51
+
60
52
  html = html_p.read_string
61
53
  OpenSCAP::LibC.free html_p
62
54
  html
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/source'
13
4
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  class OpenSCAPError < StandardError
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'ffi'
13
4
 
@@ -1,19 +1,10 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'ffi'
13
4
 
14
5
  module OpenSCAP
15
6
  extend FFI::Library
16
- ffi_lib ['libopenscap.so.8', 'openscap']
7
+ ffi_lib ['libopenscap.so.8', 'libopenscap.so.25', 'openscap']
17
8
 
18
9
  def self.error?
19
10
  oscap_err
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
 
@@ -37,9 +28,7 @@ module OpenSCAP
37
28
 
38
29
  def validate!
39
30
  e = FFI::MemoryPointer.new(:char, 4096)
40
- unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
41
- OpenSCAP.raise! e.read_string
42
- end
31
+ OpenSCAP.raise!(e.read_string) unless OpenSCAP.oscap_source_validate(@raw, XmlReporterCallback, e).zero?
43
32
  end
44
33
 
45
34
  def save(filepath = nil)
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  class Text
@@ -1,14 +1,5 @@
1
- #
2
- # Copyright (c) 2014--2018 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
- VERSION = '0.4.8'.freeze
4
+ VERSION = '0.4.9'
14
5
  end
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/openscap'
13
4
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/source'
13
4
  require 'openscap/xccdf/profile'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  module Xccdf
@@ -15,6 +6,7 @@ module OpenSCAP
15
6
  def initialize(raw)
16
7
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
17
8
  unless raw.is_a?(FFI::Pointer)
9
+
18
10
  @raw = raw
19
11
  end
20
12
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/xccdf'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  module Xccdf
@@ -15,6 +6,7 @@ module OpenSCAP
15
6
  def initialize(raw)
16
7
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
17
8
  unless raw.is_a?(FFI::Pointer)
9
+
18
10
  @raw = raw
19
11
  end
20
12
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/text'
@@ -21,6 +12,7 @@ module OpenSCAP
21
12
  def self.build(t)
22
13
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with #{t}" \
23
14
  unless t.is_a?(FFI::Pointer)
15
+
24
16
  # This is Abstract base class that enables you to build its child
25
17
  case OpenSCAP.xccdf_item_get_type t
26
18
  when :group
@@ -36,6 +28,7 @@ module OpenSCAP
36
28
  if self.class == OpenSCAP::Xccdf::Item
37
29
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} abstract base class."
38
30
  end
31
+
39
32
  @raw = t
40
33
  end
41
34
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/xccdf/benchmark'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/text'
13
4
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  module Xccdf
@@ -15,6 +6,7 @@ module OpenSCAP
15
6
  def initialize(raw)
16
7
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
17
8
  unless raw.is_a?(FFI::Pointer)
9
+
18
10
  @raw = raw
19
11
  end
20
12
 
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/xccdf/item'
@@ -27,7 +18,7 @@ module OpenSCAP
27
18
  :xccdf_medium => 'Medium',
28
19
  :xccdf_high => 'High'
29
20
  }
30
- severity_mapping[severity] ? severity_mapping[severity] : severity_mapping[:xccdf_unknown]
21
+ severity_mapping[severity] || severity_mapping[:xccdf_unknown]
31
22
  end
32
23
 
33
24
  def fixes
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/text'
@@ -1,19 +1,11 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  module OpenSCAP
13
4
  module Xccdf
14
5
  class Session
15
6
  def initialize(input_filename)
16
7
  raise OpenSCAPError, 'No filename specified!' unless input_filename
8
+
17
9
  @input_filename = input_filename
18
10
  @s = OpenSCAP.xccdf_session_new(input_filename)
19
11
  OpenSCAP.raise! if @s.null?
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/source'
13
4
  require 'openscap/xccdf/profile'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/source'
13
4
  require 'openscap/exceptions'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2015 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap/exceptions'
13
4
  require 'openscap/xccdf/item'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'test/unit'
13
4
 
@@ -26,7 +17,7 @@ module OpenSCAP
26
17
  end
27
18
 
28
19
  def cleanup
29
- @s.destroy if @s
20
+ @s&.destroy
30
21
  Dir.chdir '../..'
31
22
  OpenSCAP.raise! if OpenSCAP.error?
32
23
  OpenSCAP.oscap_cleanup
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- <ds:data-stream-collection xmlns:ds="http://scap.nist.gov/schema/scap/source/1.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cat="urn:oasis:names:tc:entity:xmlns:xml:catalog" id="scap_org.open-scap_collection_from_xccdf_first-xccdf.xml" schematron-version="1.0">
2
+ <ds:data-stream-collection xmlns:ds="http://scap.nist.gov/schema/scap/source/1.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cat="urn:oasis:names:tc:entity:xmlns:xml:catalog" id="scap_org.open-scap_collection_from_xccdf_first-xccdf.xml" schematron-version="1.2">
3
3
  <!-- This is bit more complex Datastream. The purpose is to test that scanner is able to find
4
4
  * datastream-id scap_org.open-scap_datastream_tst2
5
5
  * xccdf-id scap_org.open-scap_cref_second-xccdf.xml2
@@ -1,20 +1,11 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/ds/arf'
14
5
  require 'common/testcase'
15
6
 
16
7
  class TestArf < OpenSCAP::TestCase
17
- REPORT = 'report.rds.xml'.freeze
8
+ REPORT = 'report.rds.xml'
18
9
 
19
10
  def test_arf_new_nil
20
11
  msg = nil
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/source'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/xccdf/benchmark'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'common/testcase'
13
4
  require 'openscap'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/source'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/text'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'common/testcase'
13
4
  require 'openscap'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'common/testcase'
13
4
  require 'openscap'
@@ -87,11 +78,11 @@ class TestBenchmark < OpenSCAP::TestCase
87
78
  def test_items_references
88
79
  b = benchmark_from_file
89
80
  install_hids_rule = b.items['xccdf_org.ssgproject.content_rule_install_hids']
90
- expected_references = [{ :title => 'SC-7',
91
- :href => 'http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf',
81
+ expected_references = [{ :title => 'SC-7',
82
+ :href => 'http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf',
92
83
  :html_link => "<a href='http://csrc.nist.gov/publications/nistpubs/800-53-Rev3/sp800-53-rev3-final.pdf'>SC-7</a>" },
93
- { :title => '1263',
94
- :href => 'http://iase.disa.mil/cci/index.html',
84
+ { :title => '1263',
85
+ :href => 'http://iase.disa.mil/cci/index.html',
95
86
  :html_link => "<a href='http://iase.disa.mil/cci/index.html'>1263</a>" }]
96
87
  assert_equal(expected_references, install_hids_rule.references.map(&:to_hash), 'Install hids references should be equal')
97
88
  b.destroy
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'common/testcase'
13
4
  require 'openscap'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'common/testcase'
13
4
  require 'openscap'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'common/testcase'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'common/testcase'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014--2016 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/source'
@@ -1,13 +1,4 @@
1
- #
2
- # Copyright (c) 2014 Red Hat Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public License,
5
- # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6
- # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7
- # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8
- # along with this software; if not, see
9
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10
- #
1
+ # frozen_string_literal: true
11
2
 
12
3
  require 'openscap'
13
4
  require 'openscap/source'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Lukasik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.6.14.1
119
+ rubygems_version: 2.7.6.2
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: A FFI wrapper around the OpenSCAP library