Class: Amp::Git::VersionedWorkingFile
- Inherits:
-
VersionedFile
- Object
- Core::Repositories::AbstractVersionedFile
- VersionedFile
- Amp::Git::VersionedWorkingFile
- Defined in:
- lib/amp-git/repo_format/versioned_file.rb
Overview
This is a VersionedFile, except it’s in the working directory, so its data is stored on disk in the actual file. Other than that, it’s basically the same in its interface!
Instance Attribute Summary
Attributes inherited from VersionedFile
Instance Method Summary collapse
- #changeset ⇒ Object
- #data ⇒ Object
-
#initialize(repo, path, opts = {}) ⇒ VersionedWorkingFile
constructor
Initializes a new working dir file - slightly different semantics here.
- #size ⇒ Object
Methods inherited from VersionedFile
#==, #cmp, #flags, #hash, #renamed?
Constructor Details
#initialize(repo, path, opts = {}) ⇒ VersionedWorkingFile
Initializes a new working dir file - slightly different semantics here
115 116 117 |
# File 'lib/amp-git/repo_format/versioned_file.rb', line 115 def initialize(repo, path, opts={}) super(repo, path, opts) end |
Instance Method Details
#changeset ⇒ Object
127 128 129 |
# File 'lib/amp-git/repo_format/versioned_file.rb', line 127 def changeset WorkingDirectoryChangeset.new repo end |
#data ⇒ Object
123 124 125 |
# File 'lib/amp-git/repo_format/versioned_file.rb', line 123 def data File.read repo.working_join(path) end |
#size ⇒ Object
119 120 121 |
# File 'lib/amp-git/repo_format/versioned_file.rb', line 119 def size File.stat(repo.join(path)).size end |