Sha256: 19ffa13ba70ed24caa650c49acce83e8a92950c38dc5b8cdbb94fb6d0e92cc7c

Contents?: true

Size: 761 Bytes

Versions: 11

Compression:

Stored size: 761 Bytes

Contents

module RSCM
  
  # NOTE: It is recommended to use the Parser class in parser.rb
  # as a basis for new SCM parsers
  #
  # Some utilities for log-parsers
  # TODO: make this a module and remove the attr_reader
  class AbstractLogParser
  
    def initialize(io)
      @io = io
    end
  
    def read_until_matching_line(regexp)
      return nil if @io.eof?
      result = ""
      @io.each_line do |line|
        line.gsub!(/\r\n$/, "\n")
        break if line =~ regexp
        result << line
      end
      if result.strip == ""
        read_until_matching_line(regexp) 
      else
        result
      end
    end
    
    def convert_all_slashes_to_forward_slashes(file)
      file.gsub(/\\/, "/")
    end
    
  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rscm-0.3.16 lib/rscm/abstract_log_parser.rb
rscm-0.3.15 lib/rscm/abstract_log_parser.rb
rscm-0.4.0 lib/rscm/abstract_log_parser.rb
rscm-0.4.4 lib/rscm/abstract_log_parser.rb
rscm-0.5.1 lib/rscm/abstract_log_parser.rb
rscm-0.5.0 lib/rscm/abstract_log_parser.rb
rscm-0.4.3 lib/rscm/abstract_log_parser.rb
rscm-0.4.5 lib/rscm/abstract_log_parser.rb
rscm-0.4.2 lib/rscm/abstract_log_parser.rb
whistle-0.1 vendor/rscm-0.5.1-patched-stripped/lib/rscm/abstract_log_parser.rb
whistle-0.1.1 vendor/rscm-0.5.1-patched-stripped/lib/rscm/abstract_log_parser.rb