Class: Amp::Git::VersionedWorkingFile

Inherits:
VersionedFile show all
Defined in:
lib/amp/repository/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

#path, #repo, #revision

Instance Method Summary collapse

Methods inherited from VersionedFile

#==, #cmp, #flags, #hash, #renamed?

Methods inherited from Repositories::AbstractVersionedFile

#==, #cmp, #flags, #hash, #path, #renamed?, #repo, #revision

Methods included from Repositories::CommonVersionedFileMethods

#===, #branch, #children, #clean?, #date, #description, #unified_diff_with, #user

Constructor Details

#initialize(repo, path, opts = {}) ⇒ VersionedWorkingFile

Initializes a new working dir file - slightly different semantics here



101
102
103
# File 'lib/amp/repository/git/repo_format/versioned_file.rb', line 101

def initialize(repo, path, opts={})
  super(repo, path, opts)
end

Instance Method Details

#changesetObject



113
114
115
# File 'lib/amp/repository/git/repo_format/versioned_file.rb', line 113

def changeset
  WorkingDirectoryChangeset.new repo
end

#dataObject



109
110
111
# File 'lib/amp/repository/git/repo_format/versioned_file.rb', line 109

def data
  File.read repo.working_join(path)
end

#sizeObject



105
106
107
# File 'lib/amp/repository/git/repo_format/versioned_file.rb', line 105

def size
  File.stat(repo.join(path)).size
end