Class: PVN::Diff::RepositoryDiffer
- Includes:
- Logue::Loggable
- Defined in:
- lib/pvn/diff/repository_differ.rb
Instance Attribute Summary collapse
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#whitespace ⇒ Object
readonly
Returns the value of attribute whitespace.
Instance Method Summary collapse
-
#initialize(options) ⇒ RepositoryDiffer
constructor
A new instance of RepositoryDiffer.
Constructor Details
#initialize(options) ⇒ RepositoryDiffer
Returns a new instance of RepositoryDiffer.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/pvn/diff/repository_differ.rb', line 18 def initialize super paths = .paths paths = %w{ . } if paths.empty? info "paths: #{paths}" # we sort only the sub-entries, so the order in which paths were specified is preserved rev = .revision change = .change # this is for getting revisions only later than the given revision # (argument); this only handling revision numbers (not dates) for now. rev = change ? [ change.to_i - 1, change.to_i ] : .revision info "rev: #{rev}" @revision = PVN::Revision::Range.new(*rev) info "@revision: #{@revision}" # this indicates that this should be split into two classes: if @revision.working_copy? chgpaths = ChangedPaths.new paths chgpaths.diff_revision_to_working_copy @revision, @whitespace else logpaths = LogPaths.new @revision, paths logpaths.diff_revision_to_revision @revision, @whitespace end end |
Instance Attribute Details
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
16 17 18 |
# File 'lib/pvn/diff/repository_differ.rb', line 16 def revision @revision end |
#whitespace ⇒ Object (readonly)
Returns the value of attribute whitespace.
15 16 17 |
# File 'lib/pvn/diff/repository_differ.rb', line 15 def whitespace @whitespace end |