Class: Darcs::Chunk::AddFile

Inherits:
Base
  • Object
show all
Defined in:
lib/darcs/patchwriter.rb

Overview

Chunk which adds record of a file to the repository. The file contents are not a part of this; those must be added separately with Chunk::Hunk or Chunk::Binary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ AddFile

Returns a new instance of AddFile.



68
69
70
# File 'lib/darcs/patchwriter.rb', line 68

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



72
73
74
# File 'lib/darcs/patchwriter.rb', line 72

def path
  @path
end

Instance Method Details

#write(io, patch) ⇒ Object



74
75
76
# File 'lib/darcs/patchwriter.rb', line 74

def write(io, patch)
  io.write("addfile #{path}\n")
end