lib/dns/zone/rr/record.rb
# Load 'general' RR data/params and return the remaining RDATA for further parsing.
#
# @param string [String] RR ASCII string data
# @param options [Hash] additional data required to correctly parse a 'whole' zone
# @return [String] remaining RDATA
Load 'general' RR data/params and return the remaining RDATA for further parsing.
Load ' general ' RR data / params and return the remaining RDATA for further parsing .
def load_general_and_get_rdata(string, options = {})
    string.gsub!(/((?<!\\);)(?=(?:[^"]|"[^"]*")*$).*/o, "")
    captures = string.match(DNS::Zone::RR::REGEX_RR)
    return nil unless captures
    if [' ', nil].include?(captures[:label])
      @label = options[:last_label]
    else
      @label = captures[:label]
    end
    unrolled_origin = options[:last_origin].sub(options[:origin], '').chomp('.') if options[:last_origin]
    if unrolled_origin && !unrolled_origin.empty?
      @label = @label == '@' ? unrolled_origin : "#{@label}.#{unrolled_origin}"
    end
    @ttl = captures[:ttl]
    captures[:rdata]
  end
def load_general_and_get_rdata ( string , options = { } ) string . gsub! ( / ((?<! \\ );)(?=(?:[^"]|"[^"]*")*$).* /o , "" ) captures = string . match ( DNS :: Zone :: RR :: REGEX_RR ) return nil unless captures if [ ' ' , nil ] . include? ( captures [ :label ] ) @label = options [ :last_label ] else @label = captures [ :label ] end unrolled_origin = options [ :last_origin ] . sub ( options [ :origin ] , '' ) . chomp ( '.' ) if options [ :last_origin ] if unrolled_origin && ! unrolled_origin . empty? @label = @label == '@' ? unrolled_origin : "#{@label}.#{unrolled_origin}" end @ttl = captures [ :ttl ] captures [ :rdata ] end
Load 'general' RR data/params and return the remaining RDATA for further parsing.
Load ' general ' RR data / params and return the remaining RDATA for further parsing .
# strip comments, unless its escaped. # skip semicolons within "quote segments" (TXT records) # unroll records nested under other origins
None
String
string
RR ASCII string data
RR ASCII string data
options
additional data required to correctly parse a 'whole' zone
additional data required to correctly parse a ' whole ' zone