summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/diff/file.rb')
-rw-r--r--lib/gitlab/diff/file.rb49
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
deleted file mode 100644
index 4daf65331e8..00000000000
--- a/lib/gitlab/diff/file.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-module Gitlab
- module Diff
- class File
- attr_reader :diff
-
- delegate :new_file, :deleted_file, :renamed_file,
- :old_path, :new_path, to: :diff, prefix: false
-
- def initialize(diff)
- @diff = diff
- end
-
- # Array of Gitlab::DIff::Line objects
- def diff_lines
- @lines ||= parser.parse(raw_diff.lines)
- end
-
- def mode_changed?
- !!(diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode)
- end
-
- def parser
- Gitlab::Diff::Parser.new
- end
-
- def raw_diff
- diff.diff.to_s
- end
-
- def next_line(index)
- diff_lines[index + 1]
- end
-
- def prev_line(index)
- if index > 0
- diff_lines[index - 1]
- end
- end
-
- def file_path
- if diff.new_path.present?
- diff.new_path
- elsif diff.old_path.present?
- diff.old_path
- end
- end
- end
- end
-end