Class: Moab::FileInstanceDifference
- Inherits:
-
Serializable
- Object
- Serializable
- Moab::FileInstanceDifference
- Includes:
- HappyMapper
- Defined in:
- lib/moab/file_instance_difference.rb
Overview
Copyright © 2012 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved. See LICENSE for details.
A container for recording difference information at the file level
-
If there was no change, the change type is set to identical
-
If the signature is unchanged, but the path has moved, the change type is set to renamed
-
If path is unchanged, but the signature has changed, the change type is set to modified and both signatures are reported
-
If the signature and path are only in the basis inventory, the change type is set to deleted
-
If the signature and path are only in the other inventory, the change type is set to added
This is a child element of FileGroupDifferenceSubset, which is in turn a descendent of FileInventoryDifference, the documentation of which contains a full example
Data Model
-
FileInventoryDifference = compares two FileInventory instances based on file signatures and pathnames
-
FileGroupDifference [1..*] = performs analysis and reports differences between two matching FileGroup objects
-
FileGroupDifferenceSubset [1..5] = collects a set of file-level differences of a give change type
-
FileInstanceDifference [1..*] = contains difference information at the file level
-
FileSignature [1..2] = contains the file signature(s) of two file instances being compared
-
-
-
-
Instance Attribute Summary collapse
-
#basis_path ⇒ String
The file’s path in the basis inventory (usually for an old version).
-
#change ⇒ String
The type of file change.
-
#other_path ⇒ String
The file’s path in the other inventory (usually for an new version) compared against the basis.
-
#signatures ⇒ Array<FileSignature>
The fixity data of the file manifestation(s) (plural if change was a content modification).
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ FileInstanceDifference
constructor
A new instance of FileInstanceDifference.
Constructor Details
#initialize(opts = {}) ⇒ FileInstanceDifference
Returns a new instance of FileInstanceDifference.
31 32 33 34 |
# File 'lib/moab/file_instance_difference.rb', line 31 def initialize(opts={}) @signatures = Array.new super(opts) end |
Instance Attribute Details
#basis_path ⇒ String
Returns The file’s path in the basis inventory (usually for an old version).
42 |
# File 'lib/moab/file_instance_difference.rb', line 42 attribute :basis_path, String, :tag => 'basisPath', :on_save => Proc.new { |s| s.to_s } |
#change ⇒ String
Returns The type of file change.
38 |
# File 'lib/moab/file_instance_difference.rb', line 38 attribute :change, String |
#other_path ⇒ String
Returns The file’s path in the other inventory (usually for an new version) compared against the basis.
46 |
# File 'lib/moab/file_instance_difference.rb', line 46 attribute :other_path, String, :tag => 'otherPath', :on_save => Proc.new { |s| s.to_s } |
#signatures ⇒ Array<FileSignature>
Returns The fixity data of the file manifestation(s) (plural if change was a content modification).
50 |
# File 'lib/moab/file_instance_difference.rb', line 50 has_many :signatures, FileSignature, :tag => 'fileSignature' |