Class: PVN::Diff::DiffSet

Inherits:
Object
  • Object
show all
Includes:
Logue::Loggable
Defined in:
lib/pvn/diff/diffset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(display_path, from_lines, from_revision, to_lines, to_revision, whitespace) ⇒ DiffSet

Returns a new instance of DiffSet.



19
20
21
22
23
24
25
26
# File 'lib/pvn/diff/diffset.rb', line 19

def initialize display_path, from_lines, from_revision, to_lines, to_revision, whitespace
  @display_path = display_path
  @from_lines = from_lines
  @from_revision = from_revision
  @to_lines = to_lines
  @to_revision = to_revision
  @whitespace = whitespace
end

Instance Attribute Details

#display_pathObject (readonly)

Returns the value of attribute display_path.



12
13
14
# File 'lib/pvn/diff/diffset.rb', line 12

def display_path
  @display_path
end

#from_linesObject (readonly)

Returns the value of attribute from_lines.



13
14
15
# File 'lib/pvn/diff/diffset.rb', line 13

def from_lines
  @from_lines
end

#from_revisionObject (readonly)

Returns the value of attribute from_revision.



14
15
16
# File 'lib/pvn/diff/diffset.rb', line 14

def from_revision
  @from_revision
end

#to_linesObject (readonly)

Returns the value of attribute to_lines.



15
16
17
# File 'lib/pvn/diff/diffset.rb', line 15

def to_lines
  @to_lines
end

#to_revisionObject (readonly)

Returns the value of attribute to_revision.



16
17
18
# File 'lib/pvn/diff/diffset.rb', line 16

def to_revision
  @to_revision
end

#whitespaceObject (readonly)

Returns the value of attribute whitespace.



17
18
19
# File 'lib/pvn/diff/diffset.rb', line 17

def whitespace
  @whitespace
end

Instance Method Details

#run_diffObject



28
29
30
31
32
33
34
# File 'lib/pvn/diff/diffset.rb', line 28

def run_diff
  info "display_path: #{@display_path}".color("fafa33")
  ext = Pathname.new(@display_path).extname
  info "ext: #{ext}".color("fafa11")

  Cmd.new @display_path, @from_revision, @to_revision, @from_lines, @to_lines, @whitespace
end