Class: Git::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/git/stream.rb

Overview

This is an initial implementation of git fast-import/export streams It is not complete!

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStream

Returns a new instance of Stream.



170
171
172
# File 'lib/git/stream.rb', line 170

def initialize
  @commands = []
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



168
169
170
# File 'lib/git/stream.rb', line 168

def commands
  @commands
end

Instance Method Details

#commit {|cmt| ... } ⇒ Object

Yields:

  • (cmt)


174
175
176
177
178
# File 'lib/git/stream.rb', line 174

def commit
  cmt = Git::StreamCommit.new
  yield cmt
  commands << cmt
end

#to_sObject



180
181
182
183
184
185
186
# File 'lib/git/stream.rb', line 180

def to_s
  s = ""
  commands.each do |cmd|
    s << cmd.to_s
  end
  return s
end