Class: Fastlane::Helper::GitlabDiffFile
- Inherits:
-
Object
- Object
- Fastlane::Helper::GitlabDiffFile
- Defined in:
- lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb
Instance Attribute Summary collapse
-
#line_numbers ⇒ Object
Returns the value of attribute line_numbers.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#new_path ⇒ Object
Returns the value of attribute new_path.
-
#old_path ⇒ Object
Returns the value of attribute old_path.
Instance Method Summary collapse
-
#initialize(oth, nth, diff) ⇒ GitlabDiffFile
constructor
A new instance of GitlabDiffFile.
Constructor Details
#initialize(oth, nth, diff) ⇒ GitlabDiffFile
Returns a new instance of GitlabDiffFile.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb', line 20 def initialize(oth, nth, diff) @old_path = oth @new_path = nth patch = GitDiffParser::Patch.new(diff) return unless patch @lines = patch.changed_lines.map do |git_diff_line| # #<GitDiffParser::Line:0x00007fd3cdb40ca0 # @content="+\n", # @number=66, # @patch_position=5> GitlabDiffLine.new(git_diff_line.content, git_diff_line.number, git_diff_line.patch_position) end @line_numbers = @lines.map(&:line) end |
Instance Attribute Details
#line_numbers ⇒ Object
Returns the value of attribute line_numbers.
18 19 20 |
# File 'lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb', line 18 def line_numbers @line_numbers end |
#lines ⇒ Object
Returns the value of attribute lines.
18 19 20 |
# File 'lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb', line 18 def lines @lines end |
#new_path ⇒ Object
Returns the value of attribute new_path.
18 19 20 |
# File 'lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb', line 18 def new_path @new_path end |
#old_path ⇒ Object
Returns the value of attribute old_path.
18 19 20 |
# File 'lib/fastlane/plugin/gitlab_increate_line_notes/helper/gitlab_diff_file.rb', line 18 def old_path @old_path end |