Module: Suggestible
Constant Summary
collapse
- MAX_LINES_CONTEXT =
This translates into limiting suggestion changes to `suggestion:-100+100`.
100.freeze
Instance Method Summary
collapse
#clear_memoization, #strong_memoize, #strong_memoized?
Instance Method Details
#diff_file ⇒ Object
30
31
32
|
# File 'app/services/concerns/suggestible.rb', line 30
def diff_file
raise NotImplementedError
end
|
#fetch_from_content ⇒ Object
16
17
18
|
# File 'app/services/concerns/suggestible.rb', line 16
def fetch_from_content
diff_file.new_blob_lines_between(from_line, to_line).join
end
|
#from_line ⇒ Object
20
21
22
23
|
# File 'app/services/concerns/suggestible.rb', line 20
def from_line
real_above = [lines_above, MAX_LINES_CONTEXT].min
[target_line - real_above, 1].max
end
|
#target_line ⇒ Object
34
35
36
|
# File 'app/services/concerns/suggestible.rb', line 34
def target_line
raise NotImplementedError
end
|
#to_line ⇒ Object
25
26
27
28
|
# File 'app/services/concerns/suggestible.rb', line 25
def to_line
real_below = [lines_below, MAX_LINES_CONTEXT].min
target_line + real_below
end
|