Class: FlakeySpecCatcher::ChangeSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/flakey_spec_catcher/change_summary.rb

Overview

ChangeSummary class

Takes in a git diff block summary and converts it to an object.

This class converts a block of changes (retrieved through use of git diff) into an object that will allow the created ChangeCapsule objects to more easily find and identify changes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(change_summary) ⇒ ChangeSummary

Returns a new instance of ChangeSummary.



16
17
18
19
20
21
22
23
24
# File 'lib/flakey_spec_catcher/change_summary.rb', line 16

def initialize(change_summary)
  @master_commit_line_number, @master_commit_lines_altered =
    change_summary.split[0].delete('-').split(',').map(&:to_i)
  @master_commit_lines_altered ||= 0
  @working_commit_line_number, @working_commit_lines_altered =
    change_summary.split[1].delete('+').split(',').map(&:to_i)
  @working_commit_lines_altered ||= 0
  initialize_change_type
end

Instance Attribute Details

#change_typeObject (readonly)

Returns the value of attribute change_type.



14
15
16
# File 'lib/flakey_spec_catcher/change_summary.rb', line 14

def change_type
  @change_type
end

#master_commit_line_numberObject (readonly)

Returns the value of attribute master_commit_line_number.



12
13
14
# File 'lib/flakey_spec_catcher/change_summary.rb', line 12

def master_commit_line_number
  @master_commit_line_number
end

#master_commit_lines_alteredObject (readonly)

Returns the value of attribute master_commit_lines_altered.



12
13
14
# File 'lib/flakey_spec_catcher/change_summary.rb', line 12

def master_commit_lines_altered
  @master_commit_lines_altered
end

#working_commit_line_numberObject (readonly)

Returns the value of attribute working_commit_line_number.



13
14
15
# File 'lib/flakey_spec_catcher/change_summary.rb', line 13

def working_commit_line_number
  @working_commit_line_number
end

#working_commit_lines_alteredObject (readonly)

Returns the value of attribute working_commit_lines_altered.



13
14
15
# File 'lib/flakey_spec_catcher/change_summary.rb', line 13

def working_commit_lines_altered
  @working_commit_lines_altered
end