class HappyMapperTools::StigAttributes::DescriptionDetailsType
Public Class Methods
apply(value)
click to toggle source
# File lib/happy_mapper_tools/stig_attributes.rb, line 159 def apply(value) value = value.gsub('&', 'and') value = value.gsub('"<"', 'less than (converted less than)') DescriptionDetails.parse("<Details>#{value}</Details>") rescue Nokogiri::XML::SyntaxError => e if report_disallowed_tags(value) # if there was a bad tag exit(1) else report_error(value, e) end end
apply?(value, _convert_to_type)
click to toggle source
# File lib/happy_mapper_tools/stig_attributes.rb, line 171 def apply?(value, _convert_to_type) value.is_a?(String) end
type()
click to toggle source
# File lib/happy_mapper_tools/stig_attributes.rb, line 155 def type DescriptionDetails end
Private Class Methods
report_error(value, error)
click to toggle source
# File lib/happy_mapper_tools/stig_attributes.rb, line 177 def report_error(value, error) puts error.to_s.colorize(:red) column = error.column - '<Details>'.length - 2 puts "Error around #{value[column-10..column+10].colorize(:light_yellow)}" exit(1) end