vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/zone_reader.rb
#  Process the next line of the file
#  Returns a string representing the normalised line.
Process the next line of the file
Returns a string representing the normalised line.
Process the next line of the file Returns a string representing the normalised line .
def process_line(line, do_prefix_hack = false)
      return nil if (line[0,1] == ";")
      line = strip_comments(line)
      return nil if (line.strip.length == 0)
      return nil if (!line || (line.length == 0))
      @in_quoted_section = false if !@continued_line
      if (line.index("$ORIGIN") == 0)
        @origin = line.split()[1].strip 
        return nil
      end
      if (line.index("$TTL") == 0)
        @last_explicit_ttl = get_ttl(line.split()[1].strip) 
        return nil
      end
      if (@continued_line)
        @continued_line = strip_comments(@continued_line)
        line = @continued_line.rstrip.chomp + " " + line
        if (line.index(")"))
          @continued_line = false
        end
      end
      open_bracket = line.index("(")
      if (open_bracket)
        index = line.index(")")
        if (index && (index > open_bracket))
          @continued_line = false
        else
          @continued_line = line
        end
      end
      return nil if @continued_line
      line = strip_comments(line) + "\n"
      return normalise_line(line, do_prefix_hack)
    end
def process_line ( line , do_prefix_hack = false ) return nil if ( line [ 0 , 1 ] == ";" ) line = strip_comments ( line ) return nil if ( line . strip . length == 0 ) return nil if ( ! line || ( line . length == 0 ) ) @in_quoted_section = false if ! @continued_line if ( line . index ( "$ORIGIN" ) == 0 ) @origin = line . split ( ) [ 1 ] . strip return nil end if ( line . index ( "$TTL" ) == 0 ) @last_explicit_ttl = get_ttl ( line . split ( ) [ 1 ] . strip ) return nil end if ( @continued_line ) @continued_line = strip_comments ( @continued_line ) line = @continued_line . rstrip . chomp + " " + line if ( line . index ( ")" ) ) @continued_line = false end end open_bracket = line . index ( "(" ) if ( open_bracket ) index = line . index ( ")" ) if ( index && ( index > open_bracket ) ) @continued_line = false else @continued_line = line end end return nil if @continued_line line = strip_comments ( line ) + "\n" return normalise_line ( line , do_prefix_hack ) end
Process the next line of the file
Returns a string representing the normalised line.
Process the next line of the file Returns a string representing the normalised line .
#  $ORIGIN <domain-name> [<comment>] #                 print "Setting $ORIGIN to #{@origin}\n" #  $TTL <ttl> #                 print "Setting $TTL to #{ttl}\n" #  Add the next line until we see a ")" #  REMEMBER TO STRIP OFF COMMENTS!!! #  OK #  Keep going until we see ")" #  OK #  If SOA, then replace "3h" etc. with expanded seconds #       begin #       rescue Exception => e #         print "ERROR parsing line #{@line_num} : #{line}\n" #         return "\n", Types::ANY #       end
line
<not_specific>
do_prefix_hack
<not_specific>