File tree Expand file tree Collapse file tree 14 files changed +32
-32
lines changed Expand file tree Collapse file tree 14 files changed +32
-32
lines changed Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2014 Red Hat Inc.
2
+ # Copyright (c) 2014--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -25,7 +25,7 @@ def initialize(param)
25
25
@source = OpenSCAP ::Source . new ( param )
26
26
@session = OpenSCAP . ds_rds_session_new_from_source @source . raw
27
27
else
28
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::DS:Arf with '#{ param } '"
28
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::DS:Arf with '#{ param } '"
29
29
end
30
30
OpenSCAP . raise! if @session . null?
31
31
end
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2014 Red Hat Inc.
2
+ # Copyright (c) 2014--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -31,7 +31,7 @@ def self.raise!(msg = nil)
31
31
else
32
32
err += "\n #{ msg } "
33
33
end
34
- fail OpenSCAPError , err
34
+ raise OpenSCAPError , err
35
35
end
36
36
37
37
attach_function :oscap_init , [ ] , :void
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2014 Red Hat Inc.
2
+ # Copyright (c) 2014--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -18,15 +18,15 @@ class Source
18
18
def initialize ( param )
19
19
case param
20
20
when nil
21
- fail OpenSCAPError , 'No filename specified!'
21
+ raise OpenSCAPError , 'No filename specified!'
22
22
when String
23
23
@raw = OpenSCAP . oscap_source_new_from_file ( param )
24
24
when Hash
25
25
@raw = create_from_memory param
26
26
when FFI ::Pointer
27
27
@raw = param
28
28
else
29
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Source with '#{ param } '"
29
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Source with '#{ param } '"
30
30
end
31
31
OpenSCAP . raise! if @raw . null?
32
32
end
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2014 Red Hat Inc.
2
+ # Copyright (c) 2014--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -23,8 +23,8 @@ def initialize(p)
23
23
when OpenSCAP ::Source
24
24
@raw = OpenSCAP . xccdf_benchmark_import_source p . raw
25
25
else
26
- fail OpenSCAP ::OpenSCAPError ,
27
- "Cannot initialize OpenSCAP::Xccdf::Benchmark with '#{ p } '"
26
+ raise OpenSCAP ::OpenSCAPError ,
27
+ "Cannot initialize OpenSCAP::Xccdf::Benchmark with '#{ p } '"
28
28
end
29
29
OpenSCAP . raise! if @raw . null?
30
30
end
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2015 Red Hat Inc.
2
+ # Copyright (c) 2015--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -13,7 +13,7 @@ module OpenSCAP
13
13
module Xccdf
14
14
class Fix
15
15
def initialize ( raw )
16
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
16
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
17
17
unless raw . is_a? ( FFI ::Pointer )
18
18
@raw = raw
19
19
end
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2015 Red Hat Inc.
2
+ # Copyright (c) 2015--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -19,7 +19,7 @@ module OpenSCAP
19
19
module Xccdf
20
20
class Item
21
21
def self . build ( t )
22
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Item with #{ t } " \
22
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Item with #{ t } " \
23
23
unless t . is_a? ( FFI ::Pointer )
24
24
# This is Abstract base class that enables you to build its child
25
25
case OpenSCAP . xccdf_item_get_type t
@@ -28,13 +28,13 @@ def self.build(t)
28
28
when :rule
29
29
OpenSCAP ::Xccdf ::Rule . new t
30
30
else
31
- fail OpenSCAP ::OpenSCAPError , "Unknown Xccdf::Item type: #{ OpenSCAP . xccdf_item_get_type t } "
31
+ raise OpenSCAP ::OpenSCAPError , "Unknown Xccdf::Item type: #{ OpenSCAP . xccdf_item_get_type t } "
32
32
end
33
33
end
34
34
35
35
def initialize ( t )
36
36
if self . class == OpenSCAP ::Xccdf ::Item
37
- fail OpenSCAP ::OpenSCAPError , 'Cannot initialize Xccdf::Item abstract base class.'
37
+ raise OpenSCAP ::OpenSCAPError , 'Cannot initialize Xccdf::Item abstract base class.'
38
38
end
39
39
@raw = t
40
40
end
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ def initialize(p)
21
21
when FFI ::Pointer
22
22
@raw = p
23
23
else
24
- fail OpenSCAP ::OpenSCAPError ,
25
- "Cannot initialize OpenSCAP::Xccdf::Policy with '#{ p } '"
24
+ raise OpenSCAP ::OpenSCAPError ,
25
+ "Cannot initialize OpenSCAP::Xccdf::Policy with '#{ p } '"
26
26
end
27
27
OpenSCAP . raise! if @raw . null?
28
28
end
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ def initialize(b)
23
23
when OpenSCAP ::Xccdf ::Benchmark
24
24
@raw = OpenSCAP . xccdf_policy_model_new ( b . raw )
25
25
else
26
- fail OpenSCAP ::OpenSCAPError ,
27
- "Cannot initialize OpenSCAP::Xccdf::PolicyModel with '#{ b } '"
26
+ raise OpenSCAP ::OpenSCAPError ,
27
+ "Cannot initialize OpenSCAP::Xccdf::PolicyModel with '#{ b } '"
28
28
end
29
29
OpenSCAP . raise! if @raw . null?
30
30
end
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def initialize(p)
21
21
when FFI ::Pointer
22
22
@raw = p
23
23
else
24
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Profile with #{ p } "
24
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Profile with #{ p } "
25
25
end
26
26
end
27
27
Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2015 Red Hat Inc.
2
+ # Copyright (c) 2015--2016 Red Hat Inc.
3
3
#
4
4
# This software is licensed to you under the GNU General Public License,
5
5
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -13,7 +13,7 @@ module OpenSCAP
13
13
module Xccdf
14
14
class Reference
15
15
def initialize ( raw )
16
- fail OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
16
+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
17
17
unless raw . is_a? ( FFI ::Pointer )
18
18
@raw = raw
19
19
end
You can’t perform that action at this time.
0 commit comments