scm: remove trailing white-spaces from repositories controller.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5874 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
331489e8b8
commit
782f7ca3bf
|
@ -1,16 +1,16 @@
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
@ -154,7 +154,7 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def is_entry_text_data?(ent, path)
|
def is_entry_text_data?(ent, path)
|
||||||
# UTF-16 contains "\x00".
|
# UTF-16 contains "\x00".
|
||||||
# It is very strict that file contains less than 30% of ascii symbols
|
# It is very strict that file contains less than 30% of ascii symbols
|
||||||
# in non Western Europe.
|
# in non Western Europe.
|
||||||
return true if Redmine::MimeType.is_type?('text', path)
|
return true if Redmine::MimeType.is_type?('text', path)
|
||||||
# Ruby 1.8.6 has a bug of integer divisions.
|
# Ruby 1.8.6 has a bug of integer divisions.
|
||||||
|
@ -198,7 +198,7 @@ class RepositoriesController < ApplicationController
|
||||||
else
|
else
|
||||||
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
|
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
|
||||||
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
|
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
|
||||||
|
|
||||||
# Save diff type as user preference
|
# Save diff type as user preference
|
||||||
if User.current.logged? && @diff_type != User.current.pref[:diff_type]
|
if User.current.logged? && @diff_type != User.current.pref[:diff_type]
|
||||||
User.current.pref[:diff_type] = @diff_type
|
User.current.pref[:diff_type] = @diff_type
|
||||||
|
@ -308,7 +308,7 @@ class RepositoriesController < ApplicationController
|
||||||
:data => changes_by_month[0..11].reverse,
|
:data => changes_by_month[0..11].reverse,
|
||||||
:title => l(:label_change_plural)
|
:title => l(:label_change_plural)
|
||||||
)
|
)
|
||||||
|
|
||||||
graph.burn
|
graph.burn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -318,18 +318,18 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
changes_by_author = repository.changes.count(:all, :group => :committer)
|
changes_by_author = repository.changes.count(:all, :group => :committer)
|
||||||
h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
|
h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
|
||||||
|
|
||||||
fields = commits_by_author.collect {|r| r.first}
|
fields = commits_by_author.collect {|r| r.first}
|
||||||
commits_data = commits_by_author.collect {|r| r.last}
|
commits_data = commits_by_author.collect {|r| r.last}
|
||||||
changes_data = commits_by_author.collect {|r| h[r.first] || 0}
|
changes_data = commits_by_author.collect {|r| h[r.first] || 0}
|
||||||
|
|
||||||
fields = fields + [""]*(10 - fields.length) if fields.length<10
|
fields = fields + [""]*(10 - fields.length) if fields.length<10
|
||||||
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
|
commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
|
||||||
changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
|
changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
|
||||||
|
|
||||||
# Remove email adress in usernames
|
# Remove email adress in usernames
|
||||||
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
|
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
|
||||||
|
|
||||||
graph = SVG::Graph::BarHorizontal.new(
|
graph = SVG::Graph::BarHorizontal.new(
|
||||||
:height => 400,
|
:height => 400,
|
||||||
:width => 800,
|
:width => 800,
|
||||||
|
|
Loading…
Reference in New Issue