Class: Redmine::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/unified_diff.rb

Overview

A line of diff

Since:

  • 0.8.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDiff

Returns a new instance of Diff



228
229
230
231
232
233
234
235
# File 'lib/redmine/unified_diff.rb', line 228

def initialize()
  self.nb_line_left = ''
  self.nb_line_right = ''
  self.line_left = ''
  self.line_right = ''
  self.type_diff_right = ''
  self.type_diff_left = ''
end

Instance Attribute Details

#line_leftObject

Returns the value of attribute line_left



221
222
223
# File 'lib/redmine/unified_diff.rb', line 221

def line_left
  @line_left
end

#line_rightObject

Returns the value of attribute line_right



223
224
225
# File 'lib/redmine/unified_diff.rb', line 223

def line_right
  @line_right
end

#nb_line_leftObject

Returns the value of attribute nb_line_left



220
221
222
# File 'lib/redmine/unified_diff.rb', line 220

def nb_line_left
  @nb_line_left
end

#nb_line_rightObject

Returns the value of attribute nb_line_right



222
223
224
# File 'lib/redmine/unified_diff.rb', line 222

def nb_line_right
  @nb_line_right
end

#offsetsObject

Returns the value of attribute offsets

Since:

  • 1.2.0



226
227
228
# File 'lib/redmine/unified_diff.rb', line 226

def offsets
  @offsets
end

#type_diff_leftObject

Returns the value of attribute type_diff_left



225
226
227
# File 'lib/redmine/unified_diff.rb', line 225

def type_diff_left
  @type_diff_left
end

#type_diff_rightObject

Returns the value of attribute type_diff_right



224
225
226
# File 'lib/redmine/unified_diff.rb', line 224

def type_diff_right
  @type_diff_right
end

Instance Method Details

#html_lineObject

Since:

  • 1.2.0



253
254
255
# File 'lib/redmine/unified_diff.rb', line 253

def html_line
  line_to_html(line, offsets)
end

#html_line_leftObject

Since:

  • 1.2.0



245
246
247
# File 'lib/redmine/unified_diff.rb', line 245

def html_line_left
  line_to_html(line_left, offsets)
end

#html_line_rightObject

Since:

  • 1.2.0



249
250
251
# File 'lib/redmine/unified_diff.rb', line 249

def html_line_right
  line_to_html(line_right, offsets)
end

#inspectObject



257
258
259
260
261
262
263
# File 'lib/redmine/unified_diff.rb', line 257

def inspect
  puts '### Start Line Diff ###'
  puts self.nb_line_left
  puts self.line_left
  puts self.nb_line_right
  puts self.line_right
end

#lineObject

Since:

  • 1.2.0



241
242
243
# File 'lib/redmine/unified_diff.rb', line 241

def line
  type_diff_right == 'diff_in' ? line_right : line_left
end

#type_diffObject

Since:

  • 1.2.0



237
238
239
# File 'lib/redmine/unified_diff.rb', line 237

def type_diff
  type_diff_right == 'diff_in' ? type_diff_right : type_diff_left
end