Module: OpenSCAP

Extended by:
FFI::Library
Defined in:
lib/openscap/source.rb,
lib/openscap.rb,
lib/openscap/libc.rb,
lib/openscap/ds/arf.rb,
lib/openscap/version.rb,
lib/openscap/openscap.rb,
lib/openscap/exceptions.rb,
lib/openscap/xccdf/session.rb

Overview

Copyright © 2014 Red Hat Inc.

This software is licensed to you under the GNU General Public License, version 2 (GPLv2). There is NO WARRANTY for this software, express or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 along with this software; if not, see www.gnu.org/licenses/old-licenses/gpl-2.0.txt.

Defined Under Namespace

Modules: DS, Helper, LibC, Xccdf Classes: OpenSCAPError, Source

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.error?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/openscap/openscap.rb', line 18

def self.error?
  return oscap_err()
end

.get_full_errorObject



22
23
24
25
# File 'lib/openscap/openscap.rb', line 22

def self.get_full_error
  err = oscap_err_get_full_error
  return err.null? ? nil : err.read_string()
end

.raise!Object

Raises:



27
28
29
30
31
32
33
# File 'lib/openscap/openscap.rb', line 27

def self.raise!
  err = get_full_error
  if err.nil?
    err = '(unknown error)'
  end
  raise OpenSCAPError, err
end