'
tree.keys.sort.each do |file|
- style = 'change'
+ style = +'change'
text = File.basename(h(file))
if s = tree[file][:s]
style << ' folder'
Index: app/helpers/search_helper.rb
===================================================================
--- app/helpers/search_helper.rb (revision 17930)
+++ app/helpers/search_helper.rb (working copy)
@@ -22,7 +22,7 @@
return text unless text && tokens && !tokens.empty?
re_tokens = tokens.collect {|t| Regexp.escape(t)}
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
- result = ''
+ result = +''
text.split(regexp).each_with_index do |words, i|
if result.length > 1200
# maximum length of the preview reached
Index: app/helpers/wiki_helper.rb
===================================================================
--- app/helpers/wiki_helper.rb (revision 17930)
+++ app/helpers/wiki_helper.rb (working copy)
@@ -22,10 +22,10 @@
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0)
pages = pages.group_by(&:parent) unless pages.is_a?(Hash)
- s = ''.html_safe
+ s = (+'').html_safe
if pages.has_key?(parent)
pages[parent].each do |page|
- attrs = "value='#{page.id}'"
+ attrs = +"value='#{page.id}'"
attrs << " selected='selected'" if selected == page
indent = (level > 0) ? (' ' * level * 2 + '» ') : ''
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb (revision 17930)
+++ app/models/issue.rb (working copy)
@@ -1350,7 +1350,7 @@
# Returns a string of css classes that apply to the issue
def css_classes(user=User.current)
- s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
+ s = +"issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
s << ' closed' if closed?
s << ' overdue' if overdue?
s << ' child' if child?
Index: app/models/journal.rb
===================================================================
--- app/models/journal.rb (revision 17930)
+++ app/models/journal.rb (working copy)
@@ -124,7 +124,7 @@
# Returns a string of css classes
def css_classes
- s = 'journal'
+ s = +'journal'
s << ' has-notes' unless notes.blank?
s << ' has-details' unless details.blank?
s << ' private-notes' if private_notes?
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 17930)
+++ app/models/mailer.rb (working copy)
@@ -78,8 +78,8 @@
@user = user
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]"
- subject << " (#{issue.status.name})" if Setting.show_status_changes_in_mail_subject?
- subject << " #{issue.subject}"
+ subject += " (#{issue.status.name})" if Setting.show_status_changes_in_mail_subject?
+ subject += " #{issue.subject}"
mail :to => user,
:subject => subject
end
@@ -106,8 +106,8 @@
references issue
@author = journal.user
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
- s << "(#{issue.status.name}) " if journal.new_value_for('status_id') && Setting.show_status_changes_in_mail_subject?
- s << issue.subject
+ s += "(#{issue.status.name}) " if journal.new_value_for('status_id') && Setting.show_status_changes_in_mail_subject?
+ s += issue.subject
@issue = issue
@user = user
@journal = journal
Index: app/models/principal.rb
===================================================================
--- app/models/principal.rb (revision 17930)
+++ app/models/principal.rb (working copy)
@@ -69,7 +69,7 @@
where({})
else
pattern = "%#{q}%"
- sql = "LOWER(#{table_name}.login) LIKE LOWER(:p)"
+ sql = +"LOWER(#{table_name}.login) LIKE LOWER(:p)"
sql << " OR #{table_name}.id IN (SELECT user_id FROM #{EmailAddress.table_name} WHERE LOWER(address) LIKE LOWER(:p))"
params = {:p => pattern}
Index: app/models/project.rb
===================================================================
--- app/models/project.rb (revision 17930)
+++ app/models/project.rb (working copy)
@@ -179,7 +179,7 @@
base_statement = (perm && perm.read? ? "#{Project.table_name}.status <> #{Project::STATUS_ARCHIVED}" : "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}")
if !options[:skip_pre_condition] && perm && perm.project_module
# If the permission belongs to a project module, make sure the module is enabled
- base_statement << " AND EXISTS (SELECT 1 AS one FROM #{EnabledModule.table_name} em WHERE em.project_id = #{Project.table_name}.id AND em.name='#{perm.project_module}')"
+ base_statement += " AND EXISTS (SELECT 1 AS one FROM #{EnabledModule.table_name} em WHERE em.project_id = #{Project.table_name}.id AND em.name='#{perm.project_module}')"
end
if project = options[:project]
project_statement = project.project_condition(options[:with_subprojects])
@@ -620,7 +620,7 @@
end
def css_classes
- s = 'project'
+ s = +'project'
s << ' root' if root?
s << ' child' if child?
s << (leaf? ? ' leaf' : ' parent')
Index: app/models/query.rb
===================================================================
--- app/models/query.rb (revision 17930)
+++ app/models/query.rb (working copy)
@@ -1142,10 +1142,10 @@
end
when "!*"
sql = "#{db_table}.#{db_field} IS NULL"
- sql << " OR #{db_table}.#{db_field} = ''" if (is_custom_filter || [:text, :string].include?(type_for(field)))
+ sql += " OR #{db_table}.#{db_field} = ''" if (is_custom_filter || [:text, :string].include?(type_for(field)))
when "*"
sql = "#{db_table}.#{db_field} IS NOT NULL"
- sql << " AND #{db_table}.#{db_field} <> ''" if is_custom_filter
+ sql += " AND #{db_table}.#{db_field} <> ''" if is_custom_filter
when ">="
if [:date, :date_past].include?(type_for(field))
sql = date_clause(db_table, db_field, parse_date(value.first), nil, is_custom_filter)
Index: app/models/repository.rb
===================================================================
--- app/models/repository.rb (revision 17930)
+++ app/models/repository.rb (working copy)
@@ -232,8 +232,8 @@
def diff_format_revisions(cs, cs_to, sep=':')
text = ""
- text << cs_to.format_identifier + sep if cs_to
- text << cs.format_identifier if cs
+ text += cs_to.format_identifier + sep if cs_to
+ text += cs.format_identifier if cs
text
end
Index: app/models/user.rb
===================================================================
--- app/models/user.rb (revision 17930)
+++ app/models/user.rb (working copy)
@@ -367,7 +367,7 @@
def random_password(length=40)
chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
chars -= %w(0 O 1 l)
- password = ''
+ password = +''
length.times {|i| password << chars[SecureRandom.random_number(chars.size)] }
self.password = password
self.password_confirmation = password
Index: config/initializers/10-patches.rb
===================================================================
--- config/initializers/10-patches.rb (revision 17930)
+++ config/initializers/10-patches.rb (working copy)
@@ -125,7 +125,7 @@
module ActionMailer
class LogSubscriber < ActiveSupport::LogSubscriber
def deliver(event)
- recipients = [:to, :cc, :bcc].inject("") do |s, header|
+ recipients = [:to, :cc, :bcc].inject(+"") do |s, header|
r = Array.wrap(event.payload[header])
if r.any?
s << "\n #{header}: #{r.join(', ')}"
Index: lib/plugins/gravatar/lib/gravatar.rb
===================================================================
--- lib/plugins/gravatar/lib/gravatar.rb (revision 17930)
+++ lib/plugins/gravatar/lib/gravatar.rb (working copy)
@@ -61,7 +61,7 @@
# Returns the base Gravatar URL for the given email hash
def gravatar_api_url(hash)
- "//www.gravatar.com/avatar/#{hash}"
+ +"//www.gravatar.com/avatar/#{hash}"
end
# Return the gravatar URL for the given email address.
Index: lib/plugins/open_id_authentication/lib/open_id_authentication.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication.rb (revision 17930)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication.rb (working copy)
@@ -87,7 +87,7 @@
# dodge XRIs -- TODO: validate, don't just skip.
unless ['=', '@', '+', '$', '!', '('].include?(identifier.at(0))
# does it begin with http? if not, add it.
- identifier = "http://#{identifier}" unless identifier =~ /^http/i
+ identifier = +"http://#{identifier}" unless identifier =~ /^http/i
# strip any fragments
identifier.gsub!(/\#(.*)$/, '')
Index: lib/redmine/codeset_util.rb
===================================================================
--- lib/redmine/codeset_util.rb (revision 17930)
+++ lib/redmine/codeset_util.rb (working copy)
@@ -4,6 +4,7 @@
def self.replace_invalid_utf8(str)
return str if str.nil?
+ str = str.dup if str.frozen?
str.force_encoding('UTF-8')
if ! str.valid_encoding?
str = str.encode("UTF-16LE", :invalid => :replace,
@@ -14,6 +15,7 @@
def self.to_utf8(str, encoding)
return str if str.nil?
+ str = str.dup if str.frozen?
str.force_encoding("ASCII-8BIT")
if str.empty?
str.force_encoding("UTF-8")
@@ -37,6 +39,7 @@
def self.to_utf8_by_setting_internal(str)
return str if str.nil?
+ str = str.dup if str.frozen?
str.force_encoding('ASCII-8BIT')
return str if str.empty?
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
@@ -56,6 +59,7 @@
def self.from_utf8(str, encoding)
str ||= ''
+ str = str.dup if str.frozen?
str.force_encoding('UTF-8')
if encoding.upcase != 'UTF-8'
str = str.encode(encoding, :invalid => :replace,
Index: lib/redmine/export/csv.rb
===================================================================
--- lib/redmine/export/csv.rb (revision 17930)
+++ lib/redmine/export/csv.rb (working copy)
@@ -35,10 +35,10 @@
col_sep = l(:general_csv_separator)
encoding = Encoding.find(options[:encoding]) rescue Encoding.find(l(:general_csv_encoding))
- str = ''.force_encoding(encoding)
+ str = (+'').force_encoding(encoding)
if encoding == Encoding::UTF_8
# BOM
- str = "\xEF\xBB\xBF".force_encoding(encoding)
+ str = (+"\xEF\xBB\xBF").force_encoding(encoding)
end
super(str, :col_sep => col_sep, :encoding => encoding, &block)
Index: lib/redmine/export/pdf.rb
===================================================================
--- lib/redmine/export/pdf.rb (revision 17930)
+++ lib/redmine/export/pdf.rb (working copy)
@@ -91,7 +91,7 @@
'
# Strip {{toc}} tags
- txt.gsub!(/\{\{([<>]?)toc\}\}<\/p>/i, '')
+ txt = txt.gsub(/
\{\{([<>]?)toc\}\}<\/p>/i, '')
writeHTMLCell(w, h, x, y, css_tag + txt, border, ln, fill)
end
Index: lib/redmine/export/pdf/issues_pdf_helper.rb
===================================================================
--- lib/redmine/export/pdf/issues_pdf_helper.rb (revision 17930)
+++ lib/redmine/export/pdf/issues_pdf_helper.rb (working copy)
@@ -305,7 +305,7 @@
if query.grouped? &&
(group = query.group_by_column.group_value(issue)) != previous_group
pdf.SetFontStyle('B',10)
- group_label = group.blank? ? 'None' : group.to_s.dup
+ group_label = group.blank? ? +'None' : group.to_s.dup
group_label << " (#{result_count_by_group[group]})"
pdf.bookmark group_label, 0, -1
pdf.RDMCell(table_width, row_height * 2, group_label, 'LR', 1, 'L')
Index: lib/redmine/field_format.rb
===================================================================
--- lib/redmine/field_format.rb (revision 17930)
+++ lib/redmine/field_format.rb (working copy)
@@ -184,6 +184,7 @@
def parse_keyword(custom_field, keyword, &block)
separator = Regexp.escape ","
keyword = keyword.to_s
+ keyword = keyword.dup if keyword.frozen?
if custom_field.multiple?
values = []
Index: lib/redmine/helpers/diff.rb
===================================================================
--- lib/redmine/helpers/diff.rb (revision 17930)
+++ lib/redmine/helpers/diff.rb (working copy)
@@ -44,7 +44,7 @@
add_at = nil
add_to = nil
del_at = nil
- deleted = ""
+ deleted = +""
diff.each do |change|
pos = change[1]
if change[0] == "+"
Index: lib/redmine/helpers/gantt.rb
===================================================================
--- lib/redmine/helpers/gantt.rb (revision 17930)
+++ lib/redmine/helpers/gantt.rb (working copy)
@@ -74,8 +74,8 @@
end
@date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 1
- @subjects = ''
- @lines = ''
+ @subjects = +''
+ @lines = +''
@number_of_rows = nil
@truncated = false
if options.has_key?(:max_rows)
@@ -196,8 +196,8 @@
:indent_increment => 20, :render => :subject,
:format => :html}.merge(options)
indent = options[:indent] || 4
- @subjects = '' unless options[:only] == :lines
- @lines = '' unless options[:only] == :subjects
+ @subjects = +'' unless options[:only] == :lines
+ @lines = +'' unless options[:only] == :subjects
@number_of_rows = 0
begin
Project.project_tree(projects) do |project, level|
@@ -650,7 +650,7 @@
case object
when Issue
issue = object
- css_classes = ''
+ css_classes = +''
css_classes << ' issue-overdue' if issue.overdue?
css_classes << ' issue-behind-schedule' if issue.behind_schedule?
css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
@@ -661,7 +661,7 @@
css_classes << ' behind-start-date' if progress_date < self.date_from
css_classes << ' over-end-date' if progress_date > self.date_to
end
- s = "".html_safe
+ s = (+"").html_safe
if issue.assigned_to.present?
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
s << view.avatar(issue.assigned_to,
@@ -674,7 +674,7 @@
view.content_tag(:span, s, :class => css_classes).html_safe
when Version
version = object
- html_class = ""
+ html_class = +""
html_class << 'icon icon-package '
html_class << (version.behind_schedule? ? 'version-behind-schedule' : '') << " "
html_class << (version.overdue? ? 'version-overdue' : '')
@@ -689,7 +689,7 @@
view.content_tag(:span, s, :class => html_class).html_safe
when Project
project = object
- html_class = ""
+ html_class = +""
html_class << 'icon icon-projects '
html_class << (project.overdue? ? 'project-overdue' : '')
s = view.link_to_project(project).html_safe
@@ -725,7 +725,7 @@
end
if has_children
content = view.content_tag(:span, nil, :class => :expander) + content
- tag_options[:class] << ' open'
+ tag_options[:class] += ' open'
else
if params[:indent]
params = params.dup
@@ -733,7 +733,7 @@
end
end
style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
- style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
+ style += "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
tag_options[:style] = style
output = view.content_tag(:div, content, tag_options)
@subjects << output
@@ -772,7 +772,7 @@
end
def html_task(params, coords, markers, label, object)
- output = ''
+ output = +''
data_options = {}
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase if object
@@ -790,7 +790,7 @@
# Renders the task bar, with progress and late
if coords[:bar_start] && coords[:bar_end]
width = coords[:bar_end] - coords[:bar_start] - 2
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -810,7 +810,7 @@
output << view.content_tag(:div, ' '.html_safe, content_opt)
if coords[:bar_late_end]
width = coords[:bar_late_end] - coords[:bar_start] - 2
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -821,7 +821,7 @@
end
if coords[:bar_progress_end]
width = coords[:bar_progress_end] - coords[:bar_start] - 2
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -837,7 +837,7 @@
# Renders the markers
if markers
if coords[:start]
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{coords[:start]}px;"
style << "width:15px;"
@@ -847,7 +847,7 @@
:data => data_options)
end
if coords[:end]
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{coords[:end] + params[:zoom]}px;"
style << "width:15px;"
@@ -859,7 +859,7 @@
end
# Renders the label on the right
if label
- style = ""
+ style = +""
style << "top:#{params[:top]}px;"
style << "left:#{(coords[:bar_end] || 0) + 8}px;"
style << "width:15px;"
@@ -874,7 +874,7 @@
view.render_issue_tooltip(object).html_safe,
:class => "tip")
s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => object.id, :style => 'display:none;', :class => 'toggle-selection')
- style = ""
+ style = +""
style << "position: absolute;"
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
Index: lib/redmine/info.rb
===================================================================
--- lib/redmine/info.rb (revision 17930)
+++ lib/redmine/info.rb (working copy)
@@ -7,7 +7,7 @@
def versioned_name; "#{app_name} #{Redmine::VERSION}" end
def environment
- s = "Environment:\n"
+ s = +"Environment:\n"
s << [
["Redmine version", Redmine::VERSION],
["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
Index: lib/redmine/pagination.rb
===================================================================
--- lib/redmine/pagination.rb (revision 17930)
+++ lib/redmine/pagination.rb (working copy)
@@ -159,7 +159,7 @@
per_page_links = false if count.nil?
page_param = paginator.page_param
- html = '
'
+ html = +''
if paginator.multiple_pages?
# \xc2\xab(utf-8) = «
Index: lib/redmine/scm/adapters/abstract_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/abstract_adapter.rb (revision 17930)
+++ lib/redmine/scm/adapters/abstract_adapter.rb (working copy)
@@ -276,6 +276,7 @@
def scm_iconv(to, from, str)
return nil if str.nil?
return str if to == from && str.encoding.to_s == from
+ str = str.dup if str.frozen?
str.force_encoding(from)
begin
str.encode(to)
Index: lib/redmine/scm/adapters/cvs_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/cvs_adapter.rb (revision 17930)
+++ lib/redmine/scm/adapters/cvs_adapter.rb (working copy)
@@ -91,7 +91,7 @@
def entries(path=nil, identifier=nil, options={})
logger.debug " entries '#{path}' with identifier '#{identifier}'"
path_locale = scm_iconv(@path_encoding, 'UTF-8', path)
- path_locale.force_encoding("ASCII-8BIT")
+ path_locale = path_locale.dup.force_encoding("ASCII-8BIT")
entries = Entries.new
cmd_args = %w|-q rls -e|
cmd_args << "-D" << time_to_cvstime_rlog(identifier) if identifier
Index: lib/redmine/scm/adapters/git_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/git_adapter.rb (revision 17930)
+++ lib/redmine/scm/adapters/git_adapter.rb (working copy)
@@ -201,7 +201,7 @@
cmd_args << "--" << scm_iconv(@path_encoding, 'UTF-8', path) if path && !path.empty?
revisions = []
if identifier_from || identifier_to
- revisions << ""
+ revisions << +""
revisions[0] << "#{identifier_from}.." if identifier_from
revisions[0] << "#{identifier_to}" if identifier_to
else
@@ -259,7 +259,7 @@
end
elsif (parsing_descr == 0) && line.chomp.to_s == ""
parsing_descr = 1
- changeset[:description] = ""
+ changeset[:description] = +""
elsif (parsing_descr == 1 || parsing_descr == 2) \
&& line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
parsing_descr = 2
Index: lib/redmine/scm/adapters/subversion_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/subversion_adapter.rb (revision 17930)
+++ lib/redmine/scm/adapters/subversion_adapter.rb (working copy)
@@ -89,7 +89,7 @@
path ||= ''
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
entries = Entries.new
- cmd = "#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}"
+ cmd = +"#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}"
cmd << credentials_string
shellout(cmd) do |io|
output = io.read.force_encoding('UTF-8')
@@ -242,7 +242,7 @@
private
def credentials_string
- str = ''
+ str = +''
str << " --username #{shell_quote(@login)}" unless @login.blank?
str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
str << " --no-auth-cache --non-interactive"
Index: lib/redmine/unified_diff.rb
===================================================================
--- lib/redmine/unified_diff.rb (revision 17930)
+++ lib/redmine/unified_diff.rb (working copy)
@@ -272,7 +272,7 @@
def line_to_html_raw(line, offsets)
if offsets
- s = ''
+ s = +''
unless offsets.first == 0
s << CGI.escapeHTML(line[0..offsets.first-1])
end
Index: lib/redmine/wiki_formatting/markdown/formatter.rb
===================================================================
--- lib/redmine/wiki_formatting/markdown/formatter.rb (revision 17930)
+++ lib/redmine/wiki_formatting/markdown/formatter.rb (working copy)
@@ -81,7 +81,7 @@
end
def extract_sections(index)
- sections = ['', '', '']
+ sections = [+'', +'', +'']
offset = 0
i = 0
l = 1
Index: lib/redmine/wiki_formatting/textile/formatter.rb
===================================================================
--- lib/redmine/wiki_formatting/textile/formatter.rb (revision 17930)
+++ lib/redmine/wiki_formatting/textile/formatter.rb (working copy)
@@ -63,9 +63,9 @@
@pre_list = []
text = self.dup
rip_offtags text, false, false
- before = ''
- s = ''
- after = ''
+ before = +''
+ s = +''
+ after = +''
i = 0
l = 1
started = false
Index: lib/redmine/wiki_formatting/textile/redcloth3.rb
===================================================================
--- lib/redmine/wiki_formatting/textile/redcloth3.rb (revision 17930)
+++ lib/redmine/wiki_formatting/textile/redcloth3.rb (working copy)
@@ -466,7 +466,7 @@
# Parses Textile attribute lists and builds an HTML attribute string
def pba( text_in, element = "" )
- return '' unless text_in
+ return +'' unless text_in
style = []
text = text_in.dup
@@ -504,7 +504,7 @@
id = id.starts_with?('wiki-id-') ? id : "wiki-id-#{id}" if id
- atts = ''
+ atts = +''
atts << " style=\"#{ style.join }\"" unless style.empty?
atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
atts << " lang=\"#{ lang }\"" if lang
@@ -585,9 +585,9 @@
depth << tl
atts = pba( atts )
atts = shelve( atts ) if atts
- lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t- #{ content }"
+ lines[line_id] = +"\t<#{ lT(tl) }l#{ atts }>\n\t
- #{ content }"
else
- lines[line_id] = "\t\t
- #{ content }"
+ lines[line_id] = +"\t\t
- #{ content }"
end
last_line = line_id
@@ -610,7 +610,7 @@
def block_textile_quotes( text )
text.gsub!( QUOTES_RE ) do |match|
lines = match.split( /\n/ )
- quotes = ''
+ quotes = +''
indent = 0
lines.each do |line|
line =~ QUOTES_CONTENT_RE
@@ -638,7 +638,7 @@
text.gsub!( CODE_RE ) do |m|
before,lang,code,after = $~[1..4]
lang = " lang=\"#{ lang }\"" if lang
- rip_offtags( "#{ before }
#{ code }
#{ after }", false )
+ rip_offtags( +"#{ before }#{ code }
#{ after }", false )
end
end
@@ -850,7 +850,7 @@
post = ")"+post # add closing parenth to post
end
atts = pba( atts )
- atts = " href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
+ atts = +" href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
atts << " title=\"#{ htmlesc title }\"" if title
atts = shelve( atts ) if atts
@@ -961,7 +961,7 @@
stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
htmlesc title
atts = pba( atts )
- atts = " src=\"#{ htmlesc url.dup }\"#{ atts }"
+ atts = +" src=\"#{ htmlesc url.dup }\"#{ atts }"
atts << " title=\"#{ title }\"" if title
atts << " alt=\"#{ title }\""
# size = @getimagesize($url);
@@ -972,7 +972,7 @@
next m unless uri_with_safe_scheme?(url)
- out = ''
+ out = +''
out << "" if href
out << ""
out << "#{ href_a1 }#{ href_a2 }" if href
@@ -1095,7 +1095,7 @@
if codepre - used_offtags.length > 0
htmlesc( line, :NoQuotes ) if escape_line
@pre_list.last << line
- line = ""
+ line = +""
else
### htmlesc is disabled between CODE tags which will be parsed with highlighter
### Regexp in formatter.rb is : /\s?(.+)/m
@@ -1102,18 +1102,18 @@
### NB: some changes were made not to use $N variables, because we use "match"
### and it breaks following lines
htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag && !first.match(//)
- line = ""
+ line = +""
first.match(/<#{ OFFTAGS }([^>]*)>/)
tag = $1
$2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
tag << " #{$1}" if $1 && tag == 'code'
- @pre_list << "<#{ tag }>#{ aftertag }"
+ @pre_list << +"<#{ tag }>#{ aftertag }"
end
elsif $1 and codepre > 0
if codepre - used_offtags.length > 0
htmlesc( line, :NoQuotes ) if escape_line
@pre_list.last << line
- line = ""
+ line = +""
end
codepre -= 1 unless codepre.zero?
used_offtags = {} if codepre.zero?
Index: test/functional/attachments_controller_test.rb
===================================================================
--- test/functional/attachments_controller_test.rb (revision 17930)
+++ test/functional/attachments_controller_test.rb (working copy)
@@ -143,7 +143,7 @@
assert a.save
assert_equal 'japanese-utf-8.txt', a.filename
- str_japanese = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e".force_encoding('UTF-8')
+ str_japanese = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e").force_encoding('UTF-8')
get :show, :params => {
:id => a.id
Index: test/functional/issues_controller_test.rb
===================================================================
--- test/functional/issues_controller_test.rb (revision 17930)
+++ test/functional/issues_controller_test.rb (working copy)
@@ -770,8 +770,8 @@
def test_index_csv_big_5
with_settings :default_language => "zh-TW" do
- str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8')
- str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5')
+ str_utf8 = (+"\xe4\xb8\x80\xe6\x9c\x88").force_encoding('UTF-8')
+ str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5')
issue = Issue.generate!(:subject => str_utf8)
get :index, :params => {
@@ -782,7 +782,7 @@
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
header = lines[0]
- status = "\xaa\xac\xbaA".force_encoding('Big5')
+ status = (+"\xaa\xac\xbaA").force_encoding('Big5')
assert_include status, header
issue_line = lines.find {|l| l =~ /^#{issue.id},/}
assert_include str_big5, issue_line
@@ -791,7 +791,7 @@
def test_index_csv_cannot_convert_should_be_replaced_big_5
with_settings :default_language => "zh-TW" do
- str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8')
+ str_utf8 = (+"\xe4\xbb\xa5\xe5\x86\x85").force_encoding('UTF-8')
issue = Issue.generate!(:subject => str_utf8)
get :index, :params => {
@@ -805,10 +805,10 @@
lines = @response.body.chomp.split("\n")
header = lines[0]
issue_line = lines.find {|l| l =~ /^#{issue.id},/}
- s1 = "\xaa\xac\xbaA".force_encoding('Big5') # status
+ s1 = (+"\xaa\xac\xbaA").force_encoding('Big5') # status
assert header.include?(s1)
s2 = issue_line.split(",")[2]
- s3 = "\xa5H?".force_encoding('Big5') # subject
+ s3 = (+"\xa5H?").force_encoding('Big5') # subject
assert_equal s3, s2
end
end
@@ -2344,8 +2344,8 @@
def test_export_to_pdf_with_utf8_u_fffd
# U+FFFD
- s = "\xef\xbf\xbd"
- s.force_encoding('UTF-8') if s.respond_to?(:force_encoding)
+ s = +"\xef\xbf\xbd"
+ s.force_encoding('UTF-8')
issue = Issue.generate!(:subject => s)
["en", "zh", "zh-TW", "ja", "ko"].each do |lang|
with_settings :default_language => lang do
Index: test/functional/repositories_filesystem_controller_test.rb
===================================================================
--- test/functional/repositories_filesystem_controller_test.rb (revision 17930)
+++ test/functional/repositories_filesystem_controller_test.rb (working copy)
@@ -110,7 +110,7 @@
"when Encoding.default_external is not UTF-8. " +
"Current value is '#{Encoding.default_external.to_s}'"
else
- str_japanese = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e".force_encoding('UTF-8')
+ str_japanese = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e").force_encoding('UTF-8')
assert_select 'tr#L3 td.line-code', :text => /#{str_japanese}/
end
end
Index: test/functional/repositories_git_controller_test.rb
===================================================================
--- test/functional/repositories_git_controller_test.rb (revision 17930)
+++ test/functional/repositories_git_controller_test.rb (working copy)
@@ -26,8 +26,8 @@
REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
PRJ_ID = 3
- CHAR_1_HEX = "\xc3\x9c".force_encoding('UTF-8')
- FELIX_HEX = "Felix Sch\xC3\xA4fer".force_encoding('UTF-8')
+ CHAR_1_HEX = (+"\xc3\x9c").force_encoding('UTF-8')
+ FELIX_HEX = (+"Felix Sch\xC3\xA4fer").force_encoding('UTF-8')
NUM_REV = 28
## Git, Mercurial and CVS path encodings are binary.
Index: test/functional/repositories_mercurial_controller_test.rb
===================================================================
--- test/functional/repositories_mercurial_controller_test.rb (revision 17930)
+++ test/functional/repositories_mercurial_controller_test.rb (working copy)
@@ -42,9 +42,9 @@
assert @repository
@diff_c_support = true
@char_1 = CHAR_1_HEX.dup.force_encoding('UTF-8')
- @tag_char_1 = "tag-#{CHAR_1_HEX}-00".force_encoding('UTF-8')
- @branch_char_0 = "branch-#{CHAR_1_HEX}-00".force_encoding('UTF-8')
- @branch_char_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8')
+ @tag_char_1 = (+"tag-#{CHAR_1_HEX}-00").force_encoding('UTF-8')
+ @branch_char_0 = (+"branch-#{CHAR_1_HEX}-00").force_encoding('UTF-8')
+ @branch_char_1 = (+"branch-#{CHAR_1_HEX}-01").force_encoding('UTF-8')
end
if ruby19_non_utf8_pass
Index: test/functional/timelog_report_test.rb
===================================================================
--- test/functional/timelog_report_test.rb (revision 17930)
+++ test/functional/timelog_report_test.rb (working copy)
@@ -259,8 +259,8 @@
end
def test_csv_big_5
- str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8')
- str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5')
+ str_utf8 = (+"\xe4\xb8\x80\xe6\x9c\x88").force_encoding('UTF-8')
+ str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5')
user = User.find_by_id(3)
user.firstname = str_utf8
user.lastname = "test-lastname"
@@ -292,14 +292,14 @@
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
# Headers
- s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5')
- s2 = "\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5')
+ s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5')
+ s2 = (+"\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5')
assert_equal s1, lines.first
# Total row
assert_equal "#{str_big5} #{user.lastname},7.30,7.30", lines[1]
assert_equal "#{s2},7.30,7.30", lines[2]
- str_tw = "Chinese/Traditional (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".force_encoding('UTF-8')
+ str_tw = (+"Chinese/Traditional (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)").force_encoding('UTF-8')
assert_equal str_tw, l(:general_lang_name)
assert_equal 'Big5', l(:general_csv_encoding)
assert_equal ',', l(:general_csv_separator)
@@ -307,7 +307,7 @@
end
def test_csv_cannot_convert_should_be_replaced_big_5
- str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8')
+ str_utf8 = (+"\xe4\xbb\xa5\xe5\x86\x85").force_encoding('UTF-8')
user = User.find_by_id(3)
user.firstname = str_utf8
user.lastname = "test-lastname"
@@ -339,10 +339,10 @@
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
# Headers
- s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5')
+ s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5')
assert_equal s1, lines.first
# Total row
- s2 = "\xa5H?".force_encoding('Big5')
+ s2 = (+"\xa5H?").force_encoding('Big5')
assert_equal "#{s2} #{user.lastname},7.30,7.30", lines[1]
end
@@ -374,14 +374,14 @@
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
# Headers
- s1 = "Utilisateur;2011-11-11;Temps total".force_encoding('ISO-8859-1')
- s2 = "Temps total".force_encoding('ISO-8859-1')
+ s1 = (+"Utilisateur;2011-11-11;Temps total").force_encoding('ISO-8859-1')
+ s2 = (+"Temps total").force_encoding('ISO-8859-1')
assert_equal s1, lines.first
# Total row
assert_equal "#{user.firstname} #{user.lastname};7,30;7,30", lines[1]
assert_equal "#{s2};7,30;7,30", lines[2]
- str_fr = "French (Fran\xc3\xa7ais)".force_encoding('UTF-8')
+ str_fr = (+"French (Fran\xc3\xa7ais)").force_encoding('UTF-8')
assert_equal str_fr, l(:general_lang_name)
assert_equal 'ISO-8859-1', l(:general_csv_encoding)
assert_equal ';', l(:general_csv_separator)
Index: test/helpers/application_helper_test.rb
===================================================================
--- test/helpers/application_helper_test.rb (revision 17930)
+++ test/helpers/application_helper_test.rb (working copy)
@@ -37,7 +37,7 @@
def setup
super
set_tmp_attachments_directory
- @russian_test = "\xd1\x82\xd0\xb5\xd1\x81\xd1\x82".force_encoding('UTF-8')
+ @russian_test = (+"\xd1\x82\xd0\xb5\xd1\x81\xd1\x82").force_encoding('UTF-8')
end
test "#link_to_if_authorized for authorized user should allow using the :controller and :action for the target link" do
@@ -1424,7 +1424,7 @@
end
def test_parse_redmine_links_should_handle_a_tag_without_attributes
- text = 'http://example.com'
+ text = +'http://example.com'
expected = text.dup
parse_redmine_links(text, nil, nil, nil, true, {})
assert_equal expected, text
@@ -1779,7 +1779,7 @@
end
def test_truncate_single_line_non_ascii
- ja = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e".force_encoding('UTF-8')
+ ja = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e").force_encoding('UTF-8')
result = truncate_single_line_raw("#{ja}\n#{ja}\n#{ja}", 10)
assert_equal "#{ja} #{ja}...", result
assert !result.html_safe?
Index: test/integration/api_test/authentication_test.rb
===================================================================
--- test/integration/api_test/authentication_test.rb (revision 17930)
+++ test/integration/api_test/authentication_test.rb (working copy)
@@ -110,7 +110,7 @@
end
def test_invalid_utf8_credentials_should_not_trigger_an_error
- invalid_utf8 = "\x82".force_encoding('UTF-8')
+ invalid_utf8 = (+"\x82").force_encoding('UTF-8')
assert !invalid_utf8.valid_encoding?
assert_nothing_raised do
get '/users/current.xml', :headers => credentials(invalid_utf8, "foo")
Index: test/object_helpers.rb
===================================================================
--- test/object_helpers.rb (revision 17930)
+++ test/object_helpers.rb (working copy)
@@ -1,6 +1,6 @@
module ObjectHelpers
def User.generate!(attributes={})
- @generated_user_login ||= 'user0'
+ @generated_user_login ||= +'user0'
@generated_user_login.succ!
user = User.new(attributes)
user.login = @generated_user_login.dup if user.login.blank?
@@ -19,7 +19,7 @@
end
def Group.generate!(attributes={})
- @generated_group_name ||= 'Group 0'
+ @generated_group_name ||= +'Group 0'
@generated_group_name.succ!
group = Group.new(attributes)
group.name = @generated_group_name.dup if group.name.blank?
@@ -29,7 +29,7 @@
end
def Project.generate!(attributes={})
- @generated_project_identifier ||= 'project-0000'
+ @generated_project_identifier ||= +'project-0000'
@generated_project_identifier.succ!
project = Project.new(attributes)
project.name = @generated_project_identifier.dup if project.name.blank?
@@ -51,7 +51,7 @@
end
def IssueStatus.generate!(attributes={})
- @generated_status_name ||= 'Status 0'
+ @generated_status_name ||= +'Status 0'
@generated_status_name.succ!
status = IssueStatus.new(attributes)
status.name = @generated_status_name.dup if status.name.blank?
@@ -61,7 +61,7 @@
end
def Tracker.generate(attributes={})
- @generated_tracker_name ||= 'Tracker 0'
+ @generated_tracker_name ||= +'Tracker 0'
@generated_tracker_name.succ!
tracker = Tracker.new(attributes)
tracker.name = @generated_tracker_name.dup if tracker.name.blank?
@@ -77,7 +77,7 @@
end
def Role.generate!(attributes={})
- @generated_role_name ||= 'Role 0'
+ @generated_role_name ||= +'Role 0'
@generated_role_name.succ!
role = Role.new(attributes)
role.name = @generated_role_name.dup if role.name.blank?
@@ -131,7 +131,7 @@
end
def Version.generate!(attributes={})
- @generated_version_name ||= 'Version 0'
+ @generated_version_name ||= +'Version 0'
@generated_version_name.succ!
version = Version.new(attributes)
version.name = @generated_version_name.dup if version.name.blank?
@@ -160,7 +160,7 @@
end
def AuthSource.generate!(attributes={})
- @generated_auth_source_name ||= 'Auth 0'
+ @generated_auth_source_name ||= +'Auth 0'
@generated_auth_source_name.succ!
source = AuthSource.new(attributes)
source.name = @generated_auth_source_name.dup if source.name.blank?
@@ -170,7 +170,7 @@
end
def Board.generate!(attributes={})
- @generated_board_name ||= 'Forum 0'
+ @generated_board_name ||= +'Forum 0'
@generated_board_name.succ!
board = Board.new(attributes)
board.name = @generated_board_name.dup if board.name.blank?
@@ -181,7 +181,7 @@
end
def Attachment.generate!(attributes={})
- @generated_filename ||= 'testfile0'
+ @generated_filename ||= +'testfile0'
@generated_filename.succ!
attributes = attributes.dup
attachment = Attachment.new(attributes)
@@ -193,7 +193,7 @@
end
def CustomField.generate!(attributes={})
- @generated_custom_field_name ||= 'Custom field 0'
+ @generated_custom_field_name ||= +'Custom field 0'
@generated_custom_field_name.succ!
field = new(attributes)
field.name = @generated_custom_field_name.dup if field.name.blank?
@@ -211,7 +211,7 @@
end
def Changeset.generate!(attributes={})
- @generated_changeset_rev ||= '123456'
+ @generated_changeset_rev ||= +'123456'
@generated_changeset_rev.succ!
changeset = new(attributes)
changeset.repository ||= Project.find(1).repository
Index: test/unit/attachment_test.rb
===================================================================
--- test/unit/attachment_test.rb (revision 17930)
+++ test/unit/attachment_test.rb (working copy)
@@ -408,7 +408,7 @@
end
def test_latest_attach_should_not_error_with_string_with_invalid_encoding
- string = "width:50\xFE-Image.jpg".force_encoding('UTF-8')
+ string = (+"width:50\xFE-Image.jpg").force_encoding('UTF-8')
assert_equal false, string.valid_encoding?
Attachment.latest_attach(Attachment.limit(2).to_a, string)
Index: test/unit/changeset_test.rb
===================================================================
--- test/unit/changeset_test.rb (revision 17930)
+++ test/unit/changeset_test.rb (working copy)
@@ -449,7 +449,7 @@
def test_comments_should_be_converted_to_utf8
proj = Project.find(3)
# str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
- str = "Texte encod\xe9 en ISO-8859-1.".force_encoding("ASCII-8BIT")
+ str = (+"Texte encod\xe9 en ISO-8859-1.").force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -461,7 +461,7 @@
:scmid => '12345',
:comments => str)
assert( c.save )
- str_utf8 = "Texte encod\xc3\xa9 en ISO-8859-1.".force_encoding("UTF-8")
+ str_utf8 = (+"Texte encod\xc3\xa9 en ISO-8859-1.").force_encoding("UTF-8")
assert_equal str_utf8, c.comments
end
@@ -468,8 +468,8 @@
def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1
proj = Project.find(3)
# str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
- str1 = "Texte encod\xe9 en ISO-8859-1.".force_encoding("UTF-8")
- str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".force_encoding("ASCII-8BIT")
+ str1 = (+"Texte encod\xe9 en ISO-8859-1.").force_encoding("UTF-8")
+ str2 = (+"\xe9a\xe9b\xe9c\xe9d\xe9e test").force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -488,7 +488,7 @@
def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis
proj = Project.find(3)
- str = "test\xb5\xfetest\xb5\xfe".force_encoding('ASCII-8BIT')
+ str = (+"test\xb5\xfetest\xb5\xfe").force_encoding('ASCII-8BIT')
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -504,8 +504,8 @@
end
def test_comments_should_be_converted_all_latin1_to_utf8
- s1 = "\xC2\x80"
- s2 = "\xc3\x82\xc2\x80"
+ s1 = +"\xC2\x80"
+ s2 = +"\xc3\x82\xc2\x80"
s4 = s2.dup
s3 = s1.dup
s1.force_encoding('ASCII-8BIT')
@@ -530,8 +530,8 @@
def test_invalid_utf8_sequences_in_paths_should_be_replaced
proj = Project.find(3)
- str1 = "Texte encod\xe9 en ISO-8859-1".force_encoding("UTF-8")
- str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".force_encoding("ASCII-8BIT")
+ str1 = (+"Texte encod\xe9 en ISO-8859-1").force_encoding("UTF-8")
+ str2 = (+"\xe9a\xe9b\xe9c\xe9d\xe9e test").force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
Index: test/unit/custom_field_test.rb
===================================================================
--- test/unit/custom_field_test.rb (revision 17930)
+++ test/unit/custom_field_test.rb (working copy)
@@ -105,7 +105,7 @@
def test_possible_values_should_return_utf8_encoded_strings
field = CustomField.new
- s = "Value".force_encoding('BINARY')
+ s = "Value".b
field.possible_values = s
assert_equal [s], field.possible_values
assert_equal 'UTF-8', field.possible_values.first.encoding.name
Index: test/unit/group_test.rb
===================================================================
--- test/unit/group_test.rb (revision 17930)
+++ test/unit/group_test.rb (working copy)
@@ -56,7 +56,7 @@
def test_blank_name_error_message_fr
set_language_if_valid 'fr'
- str = "Nom doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Nom doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
g = Group.new
assert !g.save
assert_include str, g.errors.full_messages
Index: test/unit/lib/redmine/codeset_util_test.rb
===================================================================
--- test/unit/lib/redmine/codeset_util_test.rb (revision 17930)
+++ test/unit/lib/redmine/codeset_util_test.rb (working copy)
@@ -21,8 +21,8 @@
def test_to_utf8_by_setting_from_latin1
with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
- s1 = "Texte encod\xc3\xa9".force_encoding("UTF-8")
- s2 = "Texte encod\xe9".force_encoding("ASCII-8BIT")
+ s1 = (+"Texte encod\xc3\xa9").force_encoding("UTF-8")
+ s2 = (+"Texte encod\xe9").force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
@@ -31,8 +31,8 @@
def test_to_utf8_by_setting_from_euc_jp
with_settings :repositories_encodings => 'UTF-8,EUC-JP' do
- s1 = "\xe3\x83\xac\xe3\x83\x83\xe3\x83\x89\xe3\x83\x9e\xe3\x82\xa4\xe3\x83\xb3".force_encoding("UTF-8")
- s2 = "\xa5\xec\xa5\xc3\xa5\xc9\xa5\xde\xa5\xa4\xa5\xf3".force_encoding("ASCII-8BIT")
+ s1 = (+"\xe3\x83\xac\xe3\x83\x83\xe3\x83\x89\xe3\x83\x9e\xe3\x82\xa4\xe3\x83\xb3").force_encoding("UTF-8")
+ s2 = (+"\xa5\xec\xa5\xc3\xa5\xc9\xa5\xde\xa5\xa4\xa5\xf3").force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
@@ -41,8 +41,8 @@
def test_to_utf8_by_setting_should_be_converted_all_latin1
with_settings :repositories_encodings => 'ISO-8859-1' do
- s1 = "\xc3\x82\xc2\x80".force_encoding("UTF-8")
- s2 = "\xC2\x80".force_encoding("ASCII-8BIT")
+ s1 = (+"\xc3\x82\xc2\x80").force_encoding("UTF-8")
+ s2 = (+"\xC2\x80").force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
@@ -55,7 +55,7 @@
end
def test_to_utf8_by_setting_returns_ascii_as_utf8
- s1 = "ASCII".force_encoding("UTF-8")
+ s1 = (+"ASCII").force_encoding("UTF-8")
s2 = s1.dup.force_encoding("ISO-8859-1")
str1 = Redmine::CodesetUtil.to_utf8_by_setting(s1)
str2 = Redmine::CodesetUtil.to_utf8_by_setting(s2)
@@ -68,7 +68,7 @@
def test_to_utf8_by_setting_invalid_utf8_sequences_should_be_stripped
with_settings :repositories_encodings => '' do
# s1 = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
- s1 = "Texte encod\xe9 en ISO-8859-1.".force_encoding("ASCII-8BIT")
+ s1 = (+"Texte encod\xe9 en ISO-8859-1.").force_encoding("ASCII-8BIT")
str = Redmine::CodesetUtil.to_utf8_by_setting(s1)
assert str.valid_encoding?
assert_equal "UTF-8", str.encoding.to_s
@@ -78,7 +78,7 @@
def test_to_utf8_by_setting_invalid_utf8_sequences_should_be_stripped_ja_jis
with_settings :repositories_encodings => 'ISO-2022-JP' do
- s1 = "test\xb5\xfetest\xb5\xfe".force_encoding("ASCII-8BIT")
+ s1 = (+"test\xb5\xfetest\xb5\xfe").force_encoding("ASCII-8BIT")
str = Redmine::CodesetUtil.to_utf8_by_setting(s1)
assert str.valid_encoding?
assert_equal "UTF-8", str.encoding.to_s
@@ -87,18 +87,18 @@
end
test "#replace_invalid_utf8 should replace invalid utf8" do
- s1 = "\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1\xE3\x81\xFF".force_encoding("UTF-8")
+ s1 = (+"\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1\xE3\x81\xFF").force_encoding("UTF-8")
s2 = Redmine::CodesetUtil.replace_invalid_utf8(s1)
assert s2.valid_encoding?
assert_equal "UTF-8", s2.encoding.to_s
- assert_equal "\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1??".force_encoding("UTF-8"), s2
+ assert_equal (+"\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1??").force_encoding("UTF-8"), s2
end
test "#to_utf8 should replace invalid non utf8" do
- s1 = "\xa4\xb3\xa4\xf3\xa4\xcb\xa4\xc1\xa4".force_encoding("EUC-JP")
+ s1 = (+"\xa4\xb3\xa4\xf3\xa4\xcb\xa4\xc1\xa4").force_encoding("EUC-JP")
s2 = Redmine::CodesetUtil.to_utf8(s1, "EUC-JP")
assert s2.valid_encoding?
assert_equal "UTF-8", s2.encoding.to_s
- assert_equal "\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1?".force_encoding("UTF-8"), s2
+ assert_equal (+"\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1?").force_encoding("UTF-8"), s2
end
end
Index: test/unit/lib/redmine/export/csv_test.rb
===================================================================
--- test/unit/lib/redmine/export/csv_test.rb (revision 17930)
+++ test/unit/lib/redmine/export/csv_test.rb (working copy)
@@ -19,7 +19,7 @@
class CsvTest < ActiveSupport::TestCase
include Redmine::I18n
- BOM = "\xEF\xBB\xBF".force_encoding('UTF-8')
+ BOM = (+"\xEF\xBB\xBF").force_encoding('UTF-8')
def test_should_include_bom_when_utf8_encoded
with_locale 'sk' do
Index: test/unit/lib/redmine/export/pdf_test.rb
===================================================================
--- test/unit/lib/redmine/export/pdf_test.rb (revision 17930)
+++ test/unit/lib/redmine/export/pdf_test.rb (working copy)
@@ -34,9 +34,9 @@
txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(utf8_txt_1, encoding)
txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(utf8_txt_2, encoding)
txt_3 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(utf8_txt_3, encoding)
- assert_equal "?\x91\xd4".force_encoding("ASCII-8BIT"), txt_1
- assert_equal "?\x91\xd4?".force_encoding("ASCII-8BIT"), txt_2
- assert_equal "??\x91\xd4?".force_encoding("ASCII-8BIT"), txt_3
+ assert_equal (+"?\x91\xd4").force_encoding("ASCII-8BIT"), txt_1
+ assert_equal (+"?\x91\xd4?").force_encoding("ASCII-8BIT"), txt_2
+ assert_equal (+"??\x91\xd4?").force_encoding("ASCII-8BIT"), txt_3
assert_equal "ASCII-8BIT", txt_1.encoding.to_s
assert_equal "ASCII-8BIT", txt_2.encoding.to_s
assert_equal "ASCII-8BIT", txt_3.encoding.to_s
@@ -44,8 +44,8 @@
end
def test_rdm_pdf_iconv_invalid_utf8_should_be_replaced_en
- str1 = "Texte encod\xe9 en ISO-8859-1".force_encoding("UTF-8")
- str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".force_encoding("ASCII-8BIT")
+ str1 = (+"Texte encod\xe9 en ISO-8859-1").force_encoding("UTF-8")
+ str2 = (+"\xe9a\xe9b\xe9c\xe9d\xe9e test").force_encoding("ASCII-8BIT")
txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str1, 'UTF-8')
txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str2, 'UTF-8')
assert_equal "ASCII-8BIT", txt_1.encoding.to_s
@@ -55,8 +55,8 @@
end
def test_rdm_pdf_iconv_invalid_utf8_should_be_replaced_ja
- str1 = "Texte encod\xe9 en ISO-8859-1".force_encoding("UTF-8")
- str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".force_encoding("ASCII-8BIT")
+ str1 = (+"Texte encod\xe9 en ISO-8859-1").force_encoding("UTF-8")
+ str2 = (+"\xe9a\xe9b\xe9c\xe9d\xe9e test").force_encoding("ASCII-8BIT")
encoding = ( RUBY_PLATFORM == 'java' ? "SJIS" : "CP932" )
txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str1, encoding)
txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str2, encoding)
@@ -70,7 +70,7 @@
["CP932", "SJIS"].each do |encoding|
set_fixtures_attachments_directory
- str2 = "\x83e\x83X\x83g".force_encoding("ASCII-8BIT")
+ str2 = (+"\x83e\x83X\x83g").force_encoding("ASCII-8BIT")
a1 = Attachment.find(17)
a2 = Attachment.find(19)
Index: test/unit/lib/redmine/i18n_test.rb
===================================================================
--- test/unit/lib/redmine/i18n_test.rb (revision 17930)
+++ test/unit/lib/redmine/i18n_test.rb (working copy)
@@ -163,7 +163,7 @@
set_language_if_valid 'bs'
assert_equal "KM -1000,20", number_to_currency(-1000.2)
set_language_if_valid 'de'
- euro_sign = "\xe2\x82\xac".force_encoding('UTF-8')
+ euro_sign = (+"\xe2\x82\xac").force_encoding('UTF-8')
assert_equal "-1000,20 #{euro_sign}", number_to_currency(-1000.2)
end
@@ -189,7 +189,7 @@
assert_nil options.detect {|option| option.size != 2}
assert_nil options.detect {|option| !option.first.is_a?(String) || !option.last.is_a?(String)}
assert_include ["English", "en"], options
- ja = "Japanese (\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e)".force_encoding('UTF-8')
+ ja = (+"Japanese (\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e)").force_encoding('UTF-8')
assert_include [ja, "ja"], options
end
@@ -241,7 +241,7 @@
def test_utf8
set_language_if_valid 'ja'
- str_ja_yes = "\xe3\x81\xaf\xe3\x81\x84".force_encoding('UTF-8')
+ str_ja_yes = (+"\xe3\x81\xaf\xe3\x81\x84").force_encoding('UTF-8')
i18n_ja_yes = l(:general_text_Yes)
assert_equal str_ja_yes, i18n_ja_yes
assert_equal "UTF-8", i18n_ja_yes.encoding.to_s
@@ -249,13 +249,13 @@
def test_traditional_chinese_locale
set_language_if_valid 'zh-TW'
- str_tw = "Chinese/Traditional (\xE7\xB9\x81\xE9\xAB\x94\xE4\xB8\xAD\xE6\x96\x87)".force_encoding('UTF-8')
+ str_tw = (+"Chinese/Traditional (\xE7\xB9\x81\xE9\xAB\x94\xE4\xB8\xAD\xE6\x96\x87)").force_encoding('UTF-8')
assert_equal str_tw, l(:general_lang_name)
end
def test_french_locale
set_language_if_valid 'fr'
- str_fr = "French (Fran\xc3\xa7ais)".force_encoding('UTF-8')
+ str_fr = (+"French (Fran\xc3\xa7ais)").force_encoding('UTF-8')
assert_equal str_fr, l(:general_lang_name)
end
end
Index: test/unit/lib/redmine/unified_diff_test.rb
===================================================================
--- test/unit/lib/redmine/unified_diff_test.rb (revision 17930)
+++ test/unit/lib/redmine/unified_diff_test.rb (working copy)
@@ -273,7 +273,7 @@
def test_utf8_ja
ja = " text_tip_issue_end_day: "
- ja += "\xe3\x81\x93\xe3\x81\xae\xe6\x97\xa5\xe3\x81\xab\xe7\xb5\x82\xe4\xba\x86\xe3\x81\x99\xe3\x82\x8b\xe3\x82\xbf\xe3\x82\xb9\xe3\x82\xaf".force_encoding('UTF-8')
+ ja += (+"\xe3\x81\x93\xe3\x81\xae\xe6\x97\xa5\xe3\x81\xab\xe7\xb5\x82\xe4\xba\x86\xe3\x81\x99\xe3\x82\x8b\xe3\x82\xbf\xe3\x82\xb9\xe3\x82\xaf").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(read_diff_fixture('issue-12641-ja.diff'), :type => 'inline')
assert_equal 1, diff.size
@@ -283,7 +283,7 @@
end
def test_utf8_ru
- ru = " other: "\xd0\xbe\xd0\xba\xd0\xbe\xd0\xbb\xd0\xbe %{count} \xd1\x87\xd0\xb0\xd1\x81\xd0\xb0"".force_encoding('UTF-8')
+ ru = (+" other: "\xd0\xbe\xd0\xba\xd0\xbe\xd0\xbb\xd0\xbe %{count} \xd1\x87\xd0\xb0\xd1\x81\xd0\xb0"").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(read_diff_fixture('issue-12641-ru.diff'), :type => 'inline')
assert_equal 1, diff.size
@@ -327,8 +327,8 @@
end
def test_offset_range_japanese_1
- ja1 = "\xe6\x97\xa5\xe6\x9c\xac".force_encoding('UTF-8')
- ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e".force_encoding('UTF-8')
+ ja1 = (+"\xe6\x97\xa5\xe6\x9c\xac").force_encoding('UTF-8')
+ ja2 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-1.diff'), :type => 'sbs')
@@ -340,8 +340,8 @@
end
def test_offset_range_japanese_2
- ja1 = "\xe6\x97\xa5\xe6\x9c\xac".force_encoding('UTF-8')
- ja2 = "\xe3\x81\xab\xe3\x81\xa3\xe3\x81\xbd\xe3\x82\x93\xe6\x97\xa5\xe6\x9c\xac".force_encoding('UTF-8')
+ ja1 = (+"\xe6\x97\xa5\xe6\x9c\xac").force_encoding('UTF-8')
+ ja2 = (+"\xe3\x81\xab\xe3\x81\xa3\xe3\x81\xbd\xe3\x82\x93\xe6\x97\xa5\xe6\x9c\xac").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-2.diff'), :type => 'sbs')
@@ -354,8 +354,8 @@
def test_offset_range_japanese_3
# UTF-8 The 1st byte differs.
- ja1 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98".force_encoding('UTF-8')
- ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe5\xa8\x98".force_encoding('UTF-8')
+ ja1 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98").force_encoding('UTF-8')
+ ja2 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe5\xa8\x98").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-3.diff'), :type => 'sbs')
@@ -368,8 +368,8 @@
def test_offset_range_japanese_4
# UTF-8 The 2nd byte differs.
- ja1 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98".force_encoding('UTF-8')
- ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98".force_encoding('UTF-8')
+ ja1 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98").force_encoding('UTF-8')
+ ja2 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-4.diff'), :type => 'sbs')
@@ -382,8 +382,8 @@
def test_offset_range_japanese_5
# UTF-8 The 2nd byte differs.
- ja1 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98ok".force_encoding('UTF-8')
- ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98ok".force_encoding('UTF-8')
+ ja1 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xa8\x98ok").force_encoding('UTF-8')
+ ja2 = (+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98ok").force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-5.diff'), :type => 'sbs')
Index: test/unit/mail_handler_test.rb
===================================================================
--- test/unit/mail_handler_test.rb (revision 17930)
+++ test/unit/mail_handler_test.rb (working copy)
@@ -515,7 +515,7 @@
end
def test_add_issue_with_japanese_keywords
- ja_dev = "\xe9\x96\x8b\xe7\x99\xba".force_encoding('UTF-8')
+ ja_dev = (+"\xe9\x96\x8b\xe7\x99\xba").force_encoding('UTF-8')
tracker = Tracker.generate!(:name => ja_dev)
Project.find(1).trackers << tracker
issue = submit_email(
@@ -550,7 +550,7 @@
)
assert_kind_of Issue, issue
assert_equal 1, issue.attachments.size
- ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt".force_encoding('UTF-8')
+ ja = (+"\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt").force_encoding('UTF-8')
attachment = issue.attachments.first
assert_equal ja, attachment.filename
assert_equal 5, attachment.filesize
@@ -565,7 +565,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- description = "\xD0\x97\xD0\xB4\xD1\x80\xD0\xB0\xD0\xB2\xD1\x81\xD1\x82\xD0\xB2\xD1\x83\xD0\xB9\xD1\x82\xD0\xB5?".force_encoding('UTF-8')
+ description = (+"\xD0\x97\xD0\xB4\xD1\x80\xD0\xB0\xD0\xB2\xD1\x81\xD1\x82\xD0\xB2\xD1\x83\xD0\xB9\xD1\x82\xD0\xB5?").force_encoding('UTF-8')
assert_equal description, issue.description
end
@@ -576,7 +576,7 @@
)
assert_kind_of Issue, issue
assert_equal 1, issue.attachments.size
- ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt".force_encoding('UTF-8')
+ ja = (+"\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt").force_encoding('UTF-8')
attachment = issue.attachments.first
assert_equal ja, attachment.filename
assert_equal 5, attachment.filesize
@@ -592,8 +592,8 @@
)
assert_kind_of Issue, issue
assert_equal 1, issue.attachments.size
- u = "".force_encoding('UTF-8')
- u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc".force_encoding('UTF-8')
+ u = (+"").force_encoding('UTF-8')
+ u1 = (+"\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc").force_encoding('UTF-8')
11.times { u << u1 }
attachment = issue.attachments.first
assert_equal "#{u}.png", attachment.filename
@@ -610,8 +610,8 @@
)
assert_kind_of Issue, issue
assert_equal 1, issue.attachments.size
- u = "".force_encoding('UTF-8')
- u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc".force_encoding('UTF-8')
+ u = (+"").force_encoding('UTF-8')
+ u1 = (+"\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc").force_encoding('UTF-8')
11.times { u << u1 }
attachment = issue.attachments.first
assert_equal "#{u}.txt", attachment.filename
@@ -633,7 +633,7 @@
assert_equal 19, attachment.filesize
assert File.exist?(attachment.diskfile)
assert_equal 19, File.size(attachment.diskfile)
- content = "p\xF8\xEDli\xB9 \xBEluou\xE8k\xFD k\xF9n".force_encoding('CP852')
+ content = (+"p\xF8\xEDli\xB9 \xBEluou\xE8k\xFD k\xF9n").force_encoding('CP852')
assert_equal content, File.read(attachment.diskfile).force_encoding('CP852')
end
@@ -686,7 +686,7 @@
'subject_as_iso-8859-1.eml',
:issue => {:project => 'ecookbook'}
)
- str = "Testmail from Webmail: \xc3\xa4 \xc3\xb6 \xc3\xbc...".force_encoding('UTF-8')
+ str = (+"Testmail from Webmail: \xc3\xa4 \xc3\xb6 \xc3\xbc...").force_encoding('UTF-8')
assert_kind_of Issue, issue
assert_equal str, issue.subject
end
@@ -697,7 +697,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- str = "Freundliche Gr\xc3\xbcsse".force_encoding('UTF-8')
+ str = (+"Freundliche Gr\xc3\xbcsse").force_encoding('UTF-8')
assert_equal str, issue.description
end
@@ -707,7 +707,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- str = "Na \xc5\xa1triku se su\xc5\xa1i \xc5\xa1osi\xc4\x87.".force_encoding('UTF-8')
+ str = (+"Na \xc5\xa1triku se su\xc5\xa1i \xc5\xa1osi\xc4\x87.").force_encoding('UTF-8')
assert issue.description.include?(str)
end
@@ -717,7 +717,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88".force_encoding('UTF-8')
+ ja = (+"\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88").force_encoding('UTF-8')
assert_equal ja, issue.subject
end
@@ -724,7 +724,7 @@
def test_add_issue_with_korean_body
# Make sure mail bodies with a charset unknown to Ruby
# but known to the Mail gem 2.5.4 are handled correctly
- kr = "\xEA\xB3\xA0\xEB\xA7\x99\xEC\x8A\xB5\xEB\x8B\x88\xEB\x8B\xA4.".force_encoding('UTF-8')
+ kr = (+"\xEA\xB3\xA0\xEB\xA7\x99\xEC\x8A\xB5\xEB\x8B\x88\xEB\x8B\xA4.").force_encoding('UTF-8')
issue = submit_email(
'body_ks_c_5601-1987.eml',
:issue => {:project => 'ecookbook'}
@@ -748,7 +748,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- ja = "Re: \xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88".force_encoding('UTF-8')
+ ja = (+"Re: \xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88").force_encoding('UTF-8')
assert_equal ja, issue.subject
end
@@ -1187,8 +1187,8 @@
end
user = User.order('id DESC').first
assert_equal "foo@example.org", user.mail
- str1 = "\xc3\x84\xc3\xa4".force_encoding('UTF-8')
- str2 = "\xc3\x96\xc3\xb6".force_encoding('UTF-8')
+ str1 = (+"\xc3\x84\xc3\xa4").force_encoding('UTF-8')
+ str2 = (+"\xc3\x96\xc3\xb6").force_encoding('UTF-8')
assert_equal str1, user.firstname
assert_equal str2, user.lastname
end
Index: test/unit/member_test.rb
===================================================================
--- test/unit/member_test.rb (revision 17930)
+++ test/unit/member_test.rb (working copy)
@@ -86,7 +86,7 @@
member = Member.new(:project_id => 1, :user_id => user.id, :role_ids => [])
assert !member.save
assert_include I18n.translate('activerecord.errors.messages.empty'), member.errors[:role]
- assert_equal "R\xc3\xb4le doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8'),
+ assert_equal (+"R\xc3\xb4le doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8'),
[member.errors.full_messages].flatten.join
end
Index: test/unit/query_test.rb
===================================================================
--- test/unit/query_test.rb (revision 17930)
+++ test/unit/query_test.rb (working copy)
@@ -1826,7 +1826,7 @@
def test_label_for_fr
set_language_if_valid 'fr'
q = IssueQuery.new
- assert_equal "Assign\xc3\xa9 \xc3\xa0".force_encoding('UTF-8'), q.label_for('assigned_to_id')
+ assert_equal (+"Assign\xc3\xa9 \xc3\xa0").force_encoding('UTF-8'), q.label_for('assigned_to_id')
end
def test_editable_by
Index: test/unit/repository_bazaar_test.rb
===================================================================
--- test/unit/repository_bazaar_test.rb (revision 17930)
+++ test/unit/repository_bazaar_test.rb (working copy)
@@ -44,8 +44,8 @@
RUN_LATIN1_OUTPUT_TEST = (RUBY_PLATFORM != 'java' &&
Encoding.locale_charmap == "ISO-8859-1")
- CHAR_1_UTF8_HEX = "\xc3\x9c".force_encoding('UTF-8')
- CHAR_1_LATIN1_HEX = "\xdc".force_encoding('ASCII-8BIT')
+ CHAR_1_UTF8_HEX = (+"\xc3\x9c").force_encoding('UTF-8')
+ CHAR_1_LATIN1_HEX = (+"\xdc").force_encoding('ASCII-8BIT')
def setup
User.current = nil
@@ -70,7 +70,7 @@
def test_blank_path_to_repository_error_message_fr
set_language_if_valid 'fr'
- str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Bazaar.new(
:project => @project,
:url => "",
Index: test/unit/repository_cvs_test.rb
===================================================================
--- test/unit/repository_cvs_test.rb (revision 17930)
+++ test/unit/repository_cvs_test.rb (working copy)
@@ -53,7 +53,7 @@
def test_blank_module_error_message_fr
set_language_if_valid 'fr'
- str = "Module doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Module doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Cvs.new(
:project => @project,
:identifier => 'test',
@@ -81,7 +81,7 @@
def test_blank_cvsroot_error_message_fr
set_language_if_valid 'fr'
- str = "CVSROOT doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"CVSROOT doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Cvs.new(
:project => @project,
:identifier => 'test',
Index: test/unit/repository_filesystem_test.rb
===================================================================
--- test/unit/repository_filesystem_test.rb (revision 17930)
+++ test/unit/repository_filesystem_test.rb (working copy)
@@ -48,7 +48,7 @@
def test_blank_root_directory_error_message_fr
set_language_if_valid 'fr'
- str = "R\xc3\xa9pertoire racine doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"R\xc3\xa9pertoire racine doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Filesystem.new(
:project => @project,
:url => "",
Index: test/unit/repository_git_test.rb
===================================================================
--- test/unit/repository_git_test.rb (revision 17930)
+++ test/unit/repository_git_test.rb (working copy)
@@ -28,8 +28,8 @@
NUM_REV = 28
NUM_HEAD = 6
- FELIX_HEX = "Felix Sch\xC3\xA4fer".force_encoding('UTF-8')
- CHAR_1_HEX = "\xc3\x9c".force_encoding('UTF-8')
+ FELIX_HEX = (+"Felix Sch\xC3\xA4fer").force_encoding('UTF-8')
+ CHAR_1_HEX = (+"\xc3\x9c").force_encoding('UTF-8')
## Git, Mercurial and CVS path encodings are binary.
## Subversion supports URL encoding for path.
@@ -94,7 +94,7 @@
def test_blank_path_to_repository_error_message_fr
set_language_if_valid 'fr'
- str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Git.new(
:project => @project,
:url => "",
Index: test/unit/repository_mercurial_test.rb
===================================================================
--- test/unit/repository_mercurial_test.rb (revision 17930)
+++ test/unit/repository_mercurial_test.rb (working copy)
@@ -25,8 +25,8 @@
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
NUM_REV = 34
- CHAR_1_HEX = "\xc3\x9c".force_encoding('UTF-8')
- BRANCH_CHAR_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8')
+ CHAR_1_HEX = (+"\xc3\x9c").force_encoding('UTF-8')
+ BRANCH_CHAR_1 = (+"branch-#{CHAR_1_HEX}-01").force_encoding('UTF-8')
def setup
User.current = nil
@@ -52,7 +52,7 @@
def test_blank_path_to_repository_error_message_fr
set_language_if_valid 'fr'
- str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Mercurial.new(
:project => @project,
:url => "",
Index: test/unit/repository_test.rb
===================================================================
--- test/unit/repository_test.rb (revision 17930)
+++ test/unit/repository_test.rb (working copy)
@@ -58,7 +58,7 @@
def test_blank_log_encoding_error_message_fr
set_language_if_valid 'fr'
- str = "Encodage des messages de commit doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8')
+ str = (+"Encodage des messages de commit doit \xc3\xaatre renseign\xc3\xa9(e)").force_encoding('UTF-8')
repo = Repository::Bazaar.new(
:project => Project.find(3),
:url => "/test"
@@ -285,7 +285,7 @@
:url => '/foo/bar/baz' )
long_whitespace = " "
expected_comment = "This is a loooooooooooooooooooooooooooong comment"
- comment = "#{expected_comment}#{long_whitespace}\n"
+ comment = +"#{expected_comment}#{long_whitespace}\n"
3.times {comment << "#{long_whitespace}\n"}
changeset = Changeset.new(
:comments => comment, :commit_date => Time.now,
Index: test/unit/wiki_test.rb
===================================================================
--- test/unit/wiki_test.rb (revision 17930)
+++ test/unit/wiki_test.rb (working copy)
@@ -82,7 +82,7 @@
end
def test_titleize
- ja_test = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88".force_encoding('UTF-8')
+ ja_test = (+"\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88").force_encoding('UTF-8')
assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES')
assert_equal ja_test, Wiki.titleize(ja_test)
end