/usr/lib/ruby/vendor_ruby/nokogiri/xml/node/save_options.rb is in ruby-nokogiri 1.6.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | module Nokogiri
module XML
class Node
###
# Save options for serializing nodes
class SaveOptions
# Format serialized xml
FORMAT = 1
# Do not include declarations
NO_DECLARATION = 2
# Do not include empty tags
NO_EMPTY_TAGS = 4
# Do not save XHTML
NO_XHTML = 8
# Save as XHTML
AS_XHTML = 16
# Save as XML
AS_XML = 32
# Save as HTML
AS_HTML = 64
if Nokogiri.jruby?
# Save builder created document
AS_BUILDER = 128
# the default for XML documents
DEFAULT_XML = AS_XML # https://github.com/sparklemotion/nokogiri/issues/#issue/415
# the default for HTML document
DEFAULT_HTML = NO_DECLARATION | NO_EMPTY_TAGS | AS_HTML
else
# the default for XML documents
DEFAULT_XML = FORMAT | AS_XML
# the default for HTML document
DEFAULT_HTML = FORMAT | NO_DECLARATION | NO_EMPTY_TAGS | AS_HTML
end
# the default for XHTML document
DEFAULT_XHTML = FORMAT | NO_DECLARATION | NO_EMPTY_TAGS | AS_XHTML
# Integer representation of the SaveOptions
attr_reader :options
# Create a new SaveOptions object with +options+
def initialize options = 0; @options = options; end
constants.each do |constant|
class_eval %{
def #{constant.downcase}
@options |= #{constant}
self
end
def #{constant.downcase}?
#{constant} & @options == #{constant}
end
}
end
alias :to_i :options
end
end
end
end
|