Skip to content

Commit f85becb

Browse files
committed
moving frmo item to rule and clearing up whitespace
1 parent 2fbeabc commit f85becb

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

lib/openscap/xccdf/ident.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,8 @@ def system
2525
def id
2626
OpenSCAP.xccdf_ident_get_id(@raw)
2727
end
28-
29-
3028
end
3129
end
3230
attach_function :xccdf_ident_get_system, [:pointer], :string
3331
attach_function :xccdf_ident_get_id, [:pointer], :string
34-
end
35-
36-
37-
32+
end

lib/openscap/xccdf/item.rb

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,7 @@ def rationale(prefered_lang = nil)
6262
rationale = textlist.plaintext(prefered_lang)
6363
textlist.destroy
6464
rationale
65-
end
66-
67-
def idents
68-
idenss = []
69-
idenss_it = OpenSCAP.xccdf_rule_get_idents(@raw)
70-
while OpenSCAP.xccdf_ident_iterator_has_more idenss_it
71-
idens = OpenSCAP::Xccdf::Ident.new(OpenSCAP.xccdf_ident_iterator_next(idenss_it))
72-
idenss << idens
73-
end
74-
OpenSCAP.xccdf_ident_iterator_free idenss_it
75-
idenss
76-
end
65+
end
7766

7867
def references
7968
refs = []
@@ -135,9 +124,4 @@ def sub_items_init
135124
attach_function :oscap_reference_iterator_has_more, [:pointer], :bool
136125
attach_function :oscap_reference_iterator_next, [:pointer], :pointer
137126
attach_function :oscap_reference_iterator_free, [:pointer], :void
138-
139-
attach_function :xccdf_rule_get_idents, [:pointer], :pointer
140-
attach_function :xccdf_ident_iterator_has_more, [:pointer], :bool
141-
attach_function :xccdf_ident_iterator_next, [:pointer], :pointer
142-
attach_function :xccdf_ident_iterator_free, [:pointer], :void
143127
end

lib/openscap/xccdf/rule.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ def fixes
3838
OpenSCAP.xccdf_fix_iterator_free items_it
3939
fixes
4040
end
41+
42+
def idents
43+
idenss = []
44+
idenss_it = OpenSCAP.xccdf_rule_get_idents(@raw)
45+
while OpenSCAP.xccdf_ident_iterator_has_more idenss_it
46+
idens = OpenSCAP::Xccdf::Ident.new(OpenSCAP.xccdf_ident_iterator_next(idenss_it))
47+
idenss << idens
48+
end
49+
OpenSCAP.xccdf_ident_iterator_free idenss_it
50+
idenss
51+
end
4152
end
4253
end
4354
XccdfSeverity = enum(
@@ -53,4 +64,9 @@ def fixes
5364
attach_function :xccdf_fix_iterator_has_more, [:pointer], :bool
5465
attach_function :xccdf_fix_iterator_next, [:pointer], :pointer
5566
attach_function :xccdf_fix_iterator_free, [:pointer], :void
67+
68+
attach_function :xccdf_rule_get_idents, [:pointer], :pointer
69+
attach_function :xccdf_ident_iterator_has_more, [:pointer], :bool
70+
attach_function :xccdf_ident_iterator_next, [:pointer], :pointer
71+
attach_function :xccdf_ident_iterator_free, [:pointer], :void
5672
end

0 commit comments

Comments
 (0)