summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-13 12:40:25 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-13 12:40:25 +0000
commit9b10341df8270498438cf04d4a04956c21f71b0a (patch)
tree1d27cabf8c88626ffe862d232d772d2d50d5bd2c /lib
parent8a0ca5db226872f250c65e6ddd4ff812439d1a76 (diff)
downloadredmine-9b10341df8270498438cf04d4a04956c21f71b0a.tar.gz
redmine-9b10341df8270498438cf04d4a04956c21f71b0a.zip
use "do end" instead of {} at lib/redmine/export/pdf/issues_pdf_helper.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20358 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/export/pdf/issues_pdf_helper.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 575d3950a..8fba67f65 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -163,14 +163,14 @@ module Redmine
pdf.RDMCell(35+155,5, l(:label_related_issues) + ":", "LTR")
pdf.ln
relations.each do |relation|
- buf = relation.to_s(issue) {|other|
+ buf = relation.to_s(issue) do |other|
text = ""
if Setting.cross_project_issue_relations?
text += "#{relation.other_issue(issue).project} - "
end
text += "#{other.tracker} ##{other.id}: #{other.subject}"
text
- }
+ end
buf = buf.truncate(truncate_length)
pdf.SetFontStyle('', 8)
pdf.RDMCell(35+155-60, 5, buf, border_first)
@@ -422,32 +422,32 @@ module Redmine
return col_width = col_width_avg.map {|w| w * ratio}
end
end
- word_width_max = query.inline_columns.map {|c|
+ word_width_max = query.inline_columns.map do |c|
n = 10
- c.caption.split.each {|w|
+ c.caption.split.each do |w|
x = pdf.get_string_width(w) + col_padding
n = x if n < x
- }
+ end
n
- }
+ end
# by properties of issues
pdf.SetFontStyle('',8)
k = 1
- issue_list(issues) {|issue, level|
+ issue_list(issues) do |issue, level|
k += 1
values = fetch_row_values(issue, query, level)
- values.each_with_index {|v,i|
+ values.each_with_index do |v,i|
n = pdf.get_string_width(v) + col_padding * 2
col_width_max[i] = n if col_width_max[i] < n
col_width_min[i] = n if col_width_min[i] > n
col_width_avg[i] += n
- v.split.each {|w|
+ v.split.each do |w|
x = pdf.get_string_width(w) + col_padding
word_width_max[i] = x if word_width_max[i] < x
- }
- }
- }
+ end
+ end
+ end
col_width_avg.map! {|x| x / k}
# calculate columns width