Sha256: c0a98315acc1f53e47073d3da9e37073bd135350474ccf15747d4f16d1204488

Contents?: true

Size: 610 Bytes

Versions: 37

Compression:

Stored size: 610 Bytes

Contents

require 'stringio'

module OhlohScm::Parsers
	class Parser
		def self.parse(buffer='', opts={})
			buffer = StringIO.new(buffer) if buffer.is_a? String
			opts = opts.merge(:scm => self.scm)

			writer = (opts[:writer] || ArrayWriter.new) unless block_given?
			writer.write_preamble(opts) if writer

			internal_parse(buffer, opts) do |commit|
				if commit
					yield commit if block_given?
					writer.write_commit(commit) if writer
				end
			end

			if writer
				writer.write_postamble
				writer.buffer
			else
				nil
			end
		end

		def self.internal_parse
		end

		def self.scm
			nil
		end
	end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ohloh_scm-2.2.13 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.12 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.11 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.10 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.9 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.8 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.7 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.6 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.5 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.4 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.3 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.2 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.1 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.2.0 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.1.0 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.0.1 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.0.0 lib/ohloh_scm/parsers/parser.rb