summaryrefslogtreecommitdiffstats
path: root/lib/redmine/unified_diff.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-01 00:44:26 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-01 00:44:26 +0000
commit9957c3c98a835ed70c138c3596696060ee797c1d (patch)
tree2a46909cd48f3b25bea80de7016debf79d79c0e6 /lib/redmine/unified_diff.rb
parent86d6f2fe372ee2725a6993e618d83f42d593f1e9 (diff)
downloadredmine-9957c3c98a835ed70c138c3596696060ee797c1d.tar.gz
redmine-9957c3c98a835ed70c138c3596696060ee797c1d.zip
remove trailing white-spaces from lib/redmine/unified_diff.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6938 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/unified_diff.rb')
-rw-r--r--lib/redmine/unified_diff.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb
index f77721d6f..3aa348f41 100644
--- a/lib/redmine/unified_diff.rb
+++ b/lib/redmine/unified_diff.rb
@@ -5,12 +5,12 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -19,7 +19,7 @@ module Redmine
# Class used to parse unified diffs
class UnifiedDiff < Array
attr_reader :diff_type
-
+
def initialize(diff, options={})
options.assert_valid_keys(:type, :max_lines)
diff = diff.split("\n") if diff.is_a?(String)
@@ -55,7 +55,7 @@ module Redmine
end
# Class that represents a file diff
- class DiffTable < Array
+ class DiffTable < Array
attr_reader :file_name
# Initialize with a Diff file and the type of Diff View
@@ -86,12 +86,12 @@ module Redmine
@line_num_l = $2.to_i
@line_num_r = $5.to_i
else
- parse_line(line, @type)
+ parse_line(line, @type)
end
end
return true
end
-
+
def each_line
prev_line_left, prev_line_right = nil, nil
each do |line|
@@ -116,7 +116,7 @@ module Redmine
def escapeHTML(line)
CGI.escapeHTML(line)
end
-
+
def diff_for_added_line
if @type == 'sbs' && @removed > 0 && @added < @removed
self[-(@removed - @added)]
@@ -164,7 +164,7 @@ module Redmine
end
end
end
-
+
def write_offsets
if @added > 0 && @added == @removed
@added.times do |i|
@@ -177,7 +177,7 @@ module Redmine
@added = 0
@removed = 0
end
-
+
def offsets(line_left, line_right)
if line_left.present? && line_right.present? && line_left != line_right
max = [line_left.size, line_right.size].min
@@ -197,7 +197,7 @@ module Redmine
end
# A line of diff
- class Diff
+ class Diff
attr_accessor :nb_line_left
attr_accessor :line_left
attr_accessor :nb_line_right
@@ -205,7 +205,7 @@ module Redmine
attr_accessor :type_diff_right
attr_accessor :type_diff_left
attr_accessor :offsets
-
+
def initialize()
self.nb_line_left = ''
self.nb_line_right = ''
@@ -214,15 +214,15 @@ module Redmine
self.type_diff_right = ''
self.type_diff_left = ''
end
-
+
def type_diff
type_diff_right == 'diff_in' ? type_diff_right : type_diff_left
end
-
+
def line
type_diff_right == 'diff_in' ? line_right : line_left
end
-
+
def html_line_left
if offsets
line_left.dup.insert(offsets.first, '<span>').insert(offsets.last, '</span>')
@@ -230,7 +230,7 @@ module Redmine
line_left
end
end
-
+
def html_line_right
if offsets
line_right.dup.insert(offsets.first, '<span>').insert(offsets.last, '</span>')
@@ -238,7 +238,7 @@ module Redmine
line_right
end
end
-
+
def html_line
if offsets
line.dup.insert(offsets.first, '<span>').insert(offsets.last, '</span>')