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.5.1 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.14 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.13 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.12 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.11 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.10 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.9 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.8 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.7 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.6 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.5 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.4 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.3 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.1 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.4.0 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.3.5 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.3.4 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.3.2 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.3.1 lib/ohloh_scm/parsers/parser.rb
ohloh_scm-2.3.0 lib/ohloh_scm/parsers/parser.rb