Class: Inch::API::Diff
- Inherits:
-
Object
- Object
- Inch::API::Diff
- Includes:
- Utils::ShellHelper
- Defined in:
- lib/inch/api/diff.rb
Overview
Returns a Compare::Codebases object for two revisions of the same codebase
Instance Attribute Summary collapse
-
#codebase_new ⇒ Object
readonly
Returns the value of attribute codebase_new.
-
#codebase_old ⇒ Object
readonly
Returns the value of attribute codebase_old.
-
#comparer ⇒ Object
readonly
Returns the value of attribute comparer.
-
#work_dir ⇒ Object
readonly
Returns the value of attribute work_dir.
Instance Method Summary collapse
-
#initialize(dir, before_rev, after_rev = nil) ⇒ Diff
constructor
A new instance of Diff.
Methods included from Utils::ShellHelper
Constructor Details
#initialize(dir, before_rev, after_rev = nil) ⇒ Diff
Returns a new instance of Diff.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/inch/api/diff.rb', line 19 def initialize(dir, before_rev, after_rev = nil) @work_dir = dir @codebase_old = codebase_for(before_rev) @codebase_new = if after_rev.nil? Codebase.parse(work_dir) else codebase_for(after_rev) end @comparer = API::Compare::Codebases.new(@codebase_old, @codebase_new) end |
Instance Attribute Details
#codebase_new ⇒ Object (readonly)
Returns the value of attribute codebase_new.
11 12 13 |
# File 'lib/inch/api/diff.rb', line 11 def codebase_new @codebase_new end |
#codebase_old ⇒ Object (readonly)
Returns the value of attribute codebase_old.
10 11 12 |
# File 'lib/inch/api/diff.rb', line 10 def codebase_old @codebase_old end |
#comparer ⇒ Object (readonly)
Returns the value of attribute comparer.
12 13 14 |
# File 'lib/inch/api/diff.rb', line 12 def comparer @comparer end |
#work_dir ⇒ Object (readonly)
Returns the value of attribute work_dir.
13 14 15 |
# File 'lib/inch/api/diff.rb', line 13 def work_dir @work_dir end |