Class: Git::Stream
- Inherits:
-
Object
- Object
- Git::Stream
- 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
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
- #commit {|cmt| ... } ⇒ Object
-
#initialize ⇒ Stream
constructor
A new instance of Stream.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Stream
Returns a new instance of Stream.
170 171 172 |
# File 'lib/git/stream.rb', line 170 def initialize @commands = [] end |
Instance Attribute Details
#commands ⇒ Object (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
174 175 176 177 178 |
# File 'lib/git/stream.rb', line 174 def commit cmt = Git::StreamCommit.new yield cmt commands << cmt end |
#to_s ⇒ Object
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 |