Class: Darcs::Chunk::Binary
Overview
Chunk which replaces a binary file’s contents
Constant Summary collapse
- ENCODED_LINE_LENGTH =
78
Instance Attribute Summary collapse
-
#new ⇒ Object
readonly
Returns the value of attribute new.
-
#old ⇒ Object
readonly
Returns the value of attribute old.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, old, new) ⇒ Binary
constructor
Creates a new Binary chunk.
- #write(io, patch) ⇒ Object
Constructor Details
#initialize(path, old, new) ⇒ Binary
Creates a new Binary chunk. Old and new data are in their binary (non-encoded) form.
108 109 110 111 112 |
# File 'lib/darcs/patchwriter.rb', line 108 def initialize(path, old, new) @path = path @old = old @new = new end |
Instance Attribute Details
#new ⇒ Object (readonly)
Returns the value of attribute new.
114 115 116 |
# File 'lib/darcs/patchwriter.rb', line 114 def new @new end |
#old ⇒ Object (readonly)
Returns the value of attribute old.
114 115 116 |
# File 'lib/darcs/patchwriter.rb', line 114 def old @old end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
114 115 116 |
# File 'lib/darcs/patchwriter.rb', line 114 def path @path end |
Instance Method Details
#write(io, patch) ⇒ Object
116 117 118 |
# File 'lib/darcs/patchwriter.rb', line 116 def write(io, patch) io.write("binary #{path}\noldhex\n#{hex_encode old}newhex\n#{hex_encode new}") end |