'.dup
tree.keys.sort.each do |file|
- style = 'change'
+ style = 'change'.dup
text = File.basename(h(file))
if s = tree[file][:s]
style << ' folder'
Index: app/helpers/roles_helper.rb
===================================================================
--- app/helpers/roles_helper.rb (revision 16900)
+++ app/helpers/roles_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/routes_helper.rb
===================================================================
--- app/helpers/routes_helper.rb (revision 16900)
+++ app/helpers/routes_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/search_helper.rb
===================================================================
--- app/helpers/search_helper.rb (revision 16900)
+++ app/helpers/search_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -22,7 +23,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 = ''.dup
text.split(regexp).each_with_index do |words, i|
if result.length > 1200
# maximum length of the preview reached
@@ -63,7 +64,7 @@
:all_words => params[:all_words], :scope => params[:scope], t => 1)
end
(''.html_safe +
- links.map {|link| content_tag('li', link)}.join(' ').html_safe +
+ links.map {|link| content_tag('li', link)}.join(' ').html_safe +
'
'.html_safe) unless links.empty?
end
end
Index: app/helpers/settings_helper.rb
===================================================================
--- app/helpers/settings_helper.rb (revision 16900)
+++ app/helpers/settings_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -35,7 +36,7 @@
def render_settings_error(errors)
return if errors.blank?
- s = ''.html_safe
+ s = ''.dup.html_safe
errors.each do |name, message|
s << content_tag('li', content_tag('b', l("setting_#{name}")) + " " + message)
end
Index: app/helpers/sort_helper.rb
===================================================================
--- app/helpers/sort_helper.rb (revision 16900)
+++ app/helpers/sort_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Helpers to sort tables using clickable column headers.
#
Index: app/helpers/timelog_helper.rb
===================================================================
--- app/helpers/timelog_helper.rb (revision 16900)
+++ app/helpers/timelog_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/trackers_helper.rb
===================================================================
--- app/helpers/trackers_helper.rb (revision 16900)
+++ app/helpers/trackers_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/users_helper.rb
===================================================================
--- app/helpers/users_helper.rb (revision 16900)
+++ app/helpers/users_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/versions_helper.rb
===================================================================
--- app/helpers/versions_helper.rb (revision 16900)
+++ app/helpers/versions_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/watchers_helper.rb
===================================================================
--- app/helpers/watchers_helper.rb (revision 16900)
+++ app/helpers/watchers_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -46,9 +47,9 @@
# Returns a comma separated list of users watching the given object
def watchers_list(object)
remove_allowed = User.current.allowed_to?("delete_#{object.class.name.underscore}_watchers".to_sym, object.project)
- content = ''.html_safe
+ content = ''.dup.html_safe
lis = object.watcher_users.preload(:email_address).collect do |user|
- s = ''.html_safe
+ s = ''.dup.html_safe
s << avatar(user, :size => "16").to_s
s << link_to_user(user, :class => 'user')
if remove_allowed
Index: app/helpers/welcome_helper.rb
===================================================================
--- app/helpers/welcome_helper.rb (revision 16900)
+++ app/helpers/welcome_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: app/helpers/wiki_helper.rb
===================================================================
--- app/helpers/wiki_helper.rb (revision 16900)
+++ app/helpers/wiki_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -22,10 +23,11 @@
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 = ''.dup.html_safe
if pages.has_key?(parent)
pages[parent].each do |page|
- attrs = "value='#{page.id}'"
+ attrs = ''.dup
+ attrs << "value='#{page.id}'"
attrs << " selected='selected'" if selected == page
indent = (level > 0) ? (' ' * level * 2 + '» ') : ''
Index: app/helpers/workflows_helper.rb
===================================================================
--- app/helpers/workflows_helper.rb (revision 16900)
+++ app/helpers/workflows_helper.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -19,9 +20,9 @@
module WorkflowsHelper
def options_for_workflow_select(name, objects, selected, options={})
- option_tags = ''.html_safe
+ option_tags = ''.dup.html_safe
multiple = false
- if selected
+ if selected
if selected.size == objects.size
selected = 'all'
else
@@ -51,7 +52,7 @@
options = [["", ""], [l(:label_readonly), "readonly"]]
options << [l(:label_required), "required"] unless field_required?(field)
html_options = {}
-
+
if perm = permissions[status.id][name]
if perm.uniq.size > 1 || perm.size < @roles.size * @trackers.size
options << [l(:label_no_change_option), "no_change"]
@@ -76,10 +77,10 @@
def transition_tag(workflows, old_status, new_status, name)
w = workflows.select {|w| w.old_status == old_status && w.new_status == new_status}.size
-
+
tag_name = "transitions[#{ old_status.try(:id) || 0 }][#{new_status.id}][#{name}]"
if w == 0 || w == @roles.size * @trackers.size
-
+
hidden_field_tag(tag_name, "0", :id => nil) +
check_box_tag(tag_name, "1", w != 0,
:class => "old-status-#{old_status.try(:id) || 0} new-status-#{new_status.id}")
Index: app/models/attachment.rb
===================================================================
--- app/models/attachment.rb (revision 16900)
+++ app/models/attachment.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/auth_source.rb
===================================================================
--- app/models/auth_source.rb (revision 16900)
+++ app/models/auth_source.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/auth_source_ldap.rb
===================================================================
--- app/models/auth_source_ldap.rb (revision 16900)
+++ app/models/auth_source_ldap.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/board.rb
===================================================================
--- app/models/board.rb (revision 16900)
+++ app/models/board.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/comment.rb
===================================================================
--- app/models/comment.rb (revision 16900)
+++ app/models/comment.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/custom_field.rb
===================================================================
--- app/models/custom_field.rb (revision 16900)
+++ app/models/custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/custom_field_enumeration.rb
===================================================================
--- app/models/custom_field_enumeration.rb (revision 16900)
+++ app/models/custom_field_enumeration.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/custom_field_value.rb
===================================================================
--- app/models/custom_field_value.rb (revision 16900)
+++ app/models/custom_field_value.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/custom_value.rb
===================================================================
--- app/models/custom_value.rb (revision 16900)
+++ app/models/custom_value.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/document.rb
===================================================================
--- app/models/document.rb (revision 16900)
+++ app/models/document.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/document_category.rb
===================================================================
--- app/models/document_category.rb (revision 16900)
+++ app/models/document_category.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/document_category_custom_field.rb
===================================================================
--- app/models/document_category_custom_field.rb (revision 16900)
+++ app/models/document_category_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/document_custom_field.rb
===================================================================
--- app/models/document_custom_field.rb (revision 16900)
+++ app/models/document_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/email_address.rb
===================================================================
--- app/models/email_address.rb (revision 16900)
+++ app/models/email_address.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/enabled_module.rb
===================================================================
--- app/models/enabled_module.rb (revision 16900)
+++ app/models/enabled_module.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/enumeration.rb
===================================================================
--- app/models/enumeration.rb (revision 16900)
+++ app/models/enumeration.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/group.rb
===================================================================
--- app/models/group.rb (revision 16900)
+++ app/models/group.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/group_anonymous.rb
===================================================================
--- app/models/group_anonymous.rb (revision 16900)
+++ app/models/group_anonymous.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/group_builtin.rb
===================================================================
--- app/models/group_builtin.rb (revision 16900)
+++ app/models/group_builtin.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/group_custom_field.rb
===================================================================
--- app/models/group_custom_field.rb (revision 16900)
+++ app/models/group_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/group_non_member.rb
===================================================================
--- app/models/group_non_member.rb (revision 16900)
+++ app/models/group_non_member.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/change.rb
===================================================================
--- app/models/change.rb (revision 16900)
+++ app/models/change.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/changeset.rb
===================================================================
--- app/models/changeset.rb (revision 16900)
+++ app/models/changeset.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/import.rb
===================================================================
--- app/models/import.rb (revision 16900)
+++ app/models/import.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/import_item.rb
===================================================================
--- app/models/import_item.rb (revision 16900)
+++ app/models/import_item.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb (revision 16900)
+++ app/models/issue.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -1357,7 +1358,8 @@
# 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 = ''.dup
+ 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/issue_category.rb
===================================================================
--- app/models/issue_category.rb (revision 16900)
+++ app/models/issue_category.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_custom_field.rb
===================================================================
--- app/models/issue_custom_field.rb (revision 16900)
+++ app/models/issue_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_import.rb
===================================================================
--- app/models/issue_import.rb (revision 16900)
+++ app/models/issue_import.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_priority.rb
===================================================================
--- app/models/issue_priority.rb (revision 16900)
+++ app/models/issue_priority.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_priority_custom_field.rb
===================================================================
--- app/models/issue_priority_custom_field.rb (revision 16900)
+++ app/models/issue_priority_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_query.rb
===================================================================
--- app/models/issue_query.rb (revision 16900)
+++ app/models/issue_query.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_relation.rb
===================================================================
--- app/models/issue_relation.rb (revision 16900)
+++ app/models/issue_relation.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/issue_status.rb
===================================================================
--- app/models/issue_status.rb (revision 16900)
+++ app/models/issue_status.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/journal.rb
===================================================================
--- app/models/journal.rb (revision 16900)
+++ app/models/journal.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -137,7 +138,7 @@
# Returns a string of css classes
def css_classes
- s = 'journal'
+ s = 'journal'.dup
s << ' has-notes' unless notes.blank?
s << ' has-details' unless details.blank?
s << ' private-notes' if private_notes?
Index: app/models/journal_detail.rb
===================================================================
--- app/models/journal_detail.rb (revision 16900)
+++ app/models/journal_detail.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/mail_handler.rb
===================================================================
--- app/models/mail_handler.rb (revision 16900)
+++ app/models/mail_handler.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 16900)
+++ app/models/mailer.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -75,7 +76,8 @@
message_id journal
references issue
@author = journal.user
- s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
+ s = ''.dup
+ s << "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
@issue = issue
Index: app/models/member.rb
===================================================================
--- app/models/member.rb (revision 16900)
+++ app/models/member.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/member_role.rb
===================================================================
--- app/models/member_role.rb (revision 16900)
+++ app/models/member_role.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/message.rb
===================================================================
--- app/models/message.rb (revision 16900)
+++ app/models/message.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/news.rb
===================================================================
--- app/models/news.rb (revision 16900)
+++ app/models/news.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/principal.rb
===================================================================
--- app/models/principal.rb (revision 16900)
+++ app/models/principal.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/project.rb
===================================================================
--- app/models/project.rb (revision 16900)
+++ app/models/project.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -179,7 +180,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])
@@ -624,7 +625,7 @@
end
def css_classes
- s = 'project'
+ s = 'project'.dup
s << ' root' if root?
s << ' child' if child?
s << (leaf? ? ' leaf' : ' parent')
Index: app/models/project_custom_field.rb
===================================================================
--- app/models/project_custom_field.rb (revision 16900)
+++ app/models/project_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/query.rb
===================================================================
--- app/models/query.rb (revision 16900)
+++ app/models/query.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -1063,7 +1064,7 @@
# Helper method to generate the WHERE sql for a +field+, +operator+ and a +value+
def sql_for_field(field, operator, value, db_table, db_field, is_custom_filter=false)
- sql = ''
+ sql = ''.dup
case operator
when "="
if value.any?
@@ -1103,10 +1104,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 16900)
+++ app/models/repository.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/repository/bazaar.rb
===================================================================
--- app/models/repository/bazaar.rb (revision 16900)
+++ app/models/repository/bazaar.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/repository/cvs.rb
===================================================================
--- app/models/repository/cvs.rb (revision 16900)
+++ app/models/repository/cvs.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/repository/filesystem.rb
===================================================================
--- app/models/repository/filesystem.rb (revision 16900)
+++ app/models/repository/filesystem.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/repository/git.rb
===================================================================
--- app/models/repository/git.rb (revision 16900)
+++ app/models/repository/git.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
# Copyright (C) 2007 Patrick Aljord patcito@ŋmail.com
@@ -45,7 +46,7 @@
return false if v.nil?
v.to_s != '0'
end
-
+
def report_last_commit=(arg)
merge_extra_info "extra_report_last_commit" => arg
end
Index: app/models/repository/mercurial.rb
===================================================================
--- app/models/repository/mercurial.rb (revision 16900)
+++ app/models/repository/mercurial.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/repository/subversion.rb
===================================================================
--- app/models/repository/subversion.rb (revision 16900)
+++ app/models/repository/subversion.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/role.rb
===================================================================
--- app/models/role.rb (revision 16900)
+++ app/models/role.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/setting.rb
===================================================================
--- app/models/setting.rb (revision 16900)
+++ app/models/setting.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/time_entry.rb
===================================================================
--- app/models/time_entry.rb (revision 16900)
+++ app/models/time_entry.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/time_entry_activity.rb
===================================================================
--- app/models/time_entry_activity.rb (revision 16900)
+++ app/models/time_entry_activity.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/time_entry_activity_custom_field.rb
===================================================================
--- app/models/time_entry_activity_custom_field.rb (revision 16900)
+++ app/models/time_entry_activity_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/time_entry_custom_field.rb
===================================================================
--- app/models/time_entry_custom_field.rb (revision 16900)
+++ app/models/time_entry_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/time_entry_query.rb
===================================================================
--- app/models/time_entry_query.rb (revision 16900)
+++ app/models/time_entry_query.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/token.rb
===================================================================
--- app/models/token.rb (revision 16900)
+++ app/models/token.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/tracker.rb
===================================================================
--- app/models/tracker.rb (revision 16900)
+++ app/models/tracker.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/user.rb
===================================================================
--- app/models/user.rb (revision 16900)
+++ app/models/user.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -361,10 +362,10 @@
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 = ''
- length.times {|i| password << chars[SecureRandom.random_number(chars.size)] }
- self.password = password
- self.password_confirmation = password
+ pwd = ''.dup
+ length.times { pwd << chars[SecureRandom.random_number(chars.size)] }
+ self.password = pwd
+ self.password_confirmation = pwd
self
end
@@ -604,24 +605,24 @@
# eg. project.children.visible(user)
Project.unscoped do
return @project_ids_by_role if @project_ids_by_role
-
+
group_class = anonymous? ? GroupAnonymous : GroupNonMember
group_id = group_class.pluck(:id).first
-
+
members = Member.joins(:project, :member_roles).
where("#{Project.table_name}.status <> 9").
where("#{Member.table_name}.user_id = ? OR (#{Project.table_name}.is_public = ? AND #{Member.table_name}.user_id = ?)", self.id, true, group_id).
pluck(:user_id, :role_id, :project_id)
-
+
hash = {}
members.each do |user_id, role_id, project_id|
# Ignore the roles of the builtin group if the user is a member of the project
next if user_id != id && project_ids.include?(project_id)
-
+
hash[role_id] ||= []
hash[role_id] << project_id
end
-
+
result = Hash.new([])
if hash.present?
roles = Role.where(:id => hash.keys).to_a
Index: app/models/user_custom_field.rb
===================================================================
--- app/models/user_custom_field.rb (revision 16900)
+++ app/models/user_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/user_preference.rb
===================================================================
--- app/models/user_preference.rb (revision 16900)
+++ app/models/user_preference.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/version.rb
===================================================================
--- app/models/version.rb (revision 16900)
+++ app/models/version.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/version_custom_field.rb
===================================================================
--- app/models/version_custom_field.rb (revision 16900)
+++ app/models/version_custom_field.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/watcher.rb
===================================================================
--- app/models/watcher.rb (revision 16900)
+++ app/models/watcher.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/wiki.rb
===================================================================
--- app/models/wiki.rb (revision 16900)
+++ app/models/wiki.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/wiki_content.rb
===================================================================
--- app/models/wiki_content.rb (revision 16900)
+++ app/models/wiki_content.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/wiki_content_version.rb
===================================================================
--- app/models/wiki_content_version.rb (revision 16900)
+++ app/models/wiki_content_version.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/wiki_page.rb
===================================================================
--- app/models/wiki_page.rb (revision 16900)
+++ app/models/wiki_page.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/wiki_redirect.rb
===================================================================
--- app/models/wiki_redirect.rb (revision 16900)
+++ app/models/wiki_redirect.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/workflow_permission.rb
===================================================================
--- app/models/workflow_permission.rb (revision 16900)
+++ app/models/workflow_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/workflow_rule.rb
===================================================================
--- app/models/workflow_rule.rb (revision 16900)
+++ app/models/workflow_rule.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: app/models/workflow_transition.rb
===================================================================
--- app/models/workflow_transition.rb (revision 16900)
+++ app/models/workflow_transition.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: config/application.rb
===================================================================
--- config/application.rb (revision 16900)
+++ config/application.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Index: config/boot.rb
===================================================================
--- config/boot.rb (revision 16900)
+++ config/boot.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
Index: config/environment.rb
===================================================================
--- config/environment.rb (revision 16900)
+++ config/environment.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Load the Rails application
require File.expand_path('../application', __FILE__)
Index: config/environments/development.rb
===================================================================
--- config/environments/development.rb (revision 16900)
+++ config/environments/development.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
Index: config/environments/production.rb
===================================================================
--- config/environments/production.rb (revision 16900)
+++ config/environments/production.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
Index: config/environments/test.rb
===================================================================
--- config/environments/test.rb (revision 16900)
+++ config/environments/test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
Index: config/environments/test_pgsql.rb
===================================================================
--- config/environments/test_pgsql.rb (revision 16900)
+++ config/environments/test_pgsql.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
# Same as test.rb
instance_eval File.read(File.join(File.dirname(__FILE__), 'test.rb'))
Index: config/environments/test_sqlite3.rb
===================================================================
--- config/environments/test_sqlite3.rb (revision 16900)
+++ config/environments/test_sqlite3.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
# Same as test.rb
instance_eval File.read(File.join(File.dirname(__FILE__), 'test.rb'))
Index: config/initializers/00-core_plugins.rb
===================================================================
--- config/initializers/00-core_plugins.rb (revision 16900)
+++ config/initializers/00-core_plugins.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Loads the core plugins located in lib/plugins
Dir.glob(File.join(Rails.root, "lib/plugins/*")).sort.each do |directory|
if File.directory?(directory)
Index: config/initializers/10-patches.rb
===================================================================
--- config/initializers/10-patches.rb (revision 16900)
+++ config/initializers/10-patches.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require 'active_record'
module ActiveRecord
@@ -142,7 +143,7 @@
module ActionMailer
class LogSubscriber < ActiveSupport::LogSubscriber
def deliver(event)
- recipients = [:to, :cc, :bcc].inject("") do |s, header|
+ recipients = [:to, :cc, :bcc].inject(''.dup) do |s, header|
r = Array.wrap(event.payload[header])
if r.any?
s << "\n #{header}: #{r.join(', ')}"
Index: config/initializers/20-mime_types.rb
===================================================================
--- config/initializers/20-mime_types.rb (revision 16900)
+++ config/initializers/20-mime_types.rb (working copy)
@@ -1 +1,2 @@
+# frozen_string_literal: true
# Add new mime types for use in respond_to blocks:
Index: config/initializers/30-redmine.rb
===================================================================
--- config/initializers/30-redmine.rb (revision 16900)
+++ config/initializers/30-redmine.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
I18n.default_locale = 'en'
I18n.backend = Redmine::I18n::Backend.new
# Forces I18n to load available locales from the backend
Index: config/initializers/backtrace_silencers.rb
===================================================================
--- config/initializers/backtrace_silencers.rb (revision 16900)
+++ config/initializers/backtrace_silencers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Index: config/initializers/inflections.rb
===================================================================
--- config/initializers/inflections.rb (revision 16900)
+++ config/initializers/inflections.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
Index: config/routes.rb
===================================================================
--- config/routes.rb (revision 16900)
+++ config/routes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -157,7 +158,7 @@
end
end
end
-
+
match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
resources :wiki, :except => [:index, :create], :as => 'wiki_page' do
member do
Index: db/migrate/001_setup.rb
===================================================================
--- db/migrate/001_setup.rb (revision 16900)
+++ db/migrate/001_setup.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
Index: db/migrate/002_issue_move.rb
===================================================================
--- db/migrate/002_issue_move.rb (revision 16900)
+++ db/migrate/002_issue_move.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class IssueMove < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/003_issue_add_note.rb
===================================================================
--- db/migrate/003_issue_add_note.rb (revision 16900)
+++ db/migrate/003_issue_add_note.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class IssueAddNote < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/004_export_pdf.rb
===================================================================
--- db/migrate/004_export_pdf.rb (revision 16900)
+++ db/migrate/004_export_pdf.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ExportPdf < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/005_issue_start_date.rb
===================================================================
--- db/migrate/005_issue_start_date.rb (revision 16900)
+++ db/migrate/005_issue_start_date.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class IssueStartDate < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :start_date, :date
Index: db/migrate/006_calendar_and_activity.rb
===================================================================
--- db/migrate/006_calendar_and_activity.rb (revision 16900)
+++ db/migrate/006_calendar_and_activity.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CalendarAndActivity < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/007_create_journals.rb
===================================================================
--- db/migrate/007_create_journals.rb (revision 16900)
+++ db/migrate/007_create_journals.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateJournals < ActiveRecord::Migration[4.2]
# model removed, but needed for data migration
Index: db/migrate/008_create_user_preferences.rb
===================================================================
--- db/migrate/008_create_user_preferences.rb (revision 16900)
+++ db/migrate/008_create_user_preferences.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: trues
class CreateUserPreferences < ActiveRecord::Migration[4.2]
def self.up
create_table :user_preferences do |t|
Index: db/migrate/009_add_hide_mail_pref.rb
===================================================================
--- db/migrate/009_add_hide_mail_pref.rb (revision 16900)
+++ db/migrate/009_add_hide_mail_pref.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddHideMailPref < ActiveRecord::Migration[4.2]
def self.up
add_column :user_preferences, :hide_mail, :boolean, :default => false
Index: db/migrate/010_create_comments.rb
===================================================================
--- db/migrate/010_create_comments.rb (revision 16900)
+++ db/migrate/010_create_comments.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateComments < ActiveRecord::Migration[4.2]
def self.up
create_table :comments do |t|
Index: db/migrate/011_add_news_comments_count.rb
===================================================================
--- db/migrate/011_add_news_comments_count.rb (revision 16900)
+++ db/migrate/011_add_news_comments_count.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddNewsCommentsCount < ActiveRecord::Migration[4.2]
def self.up
add_column :news, :comments_count, :integer, :default => 0, :null => false
Index: db/migrate/012_add_comments_permissions.rb
===================================================================
--- db/migrate/012_add_comments_permissions.rb (revision 16900)
+++ db/migrate/012_add_comments_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCommentsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/013_create_queries.rb
===================================================================
--- db/migrate/013_create_queries.rb (revision 16900)
+++ db/migrate/013_create_queries.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateQueries < ActiveRecord::Migration[4.2]
def self.up
create_table :queries, :force => true do |t|
Index: db/migrate/014_add_queries_permissions.rb
===================================================================
--- db/migrate/014_add_queries_permissions.rb (revision 16900)
+++ db/migrate/014_add_queries_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/015_create_repositories.rb
===================================================================
--- db/migrate/015_create_repositories.rb (revision 16900)
+++ db/migrate/015_create_repositories.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateRepositories < ActiveRecord::Migration[4.2]
def self.up
create_table :repositories, :force => true do |t|
Index: db/migrate/016_add_repositories_permissions.rb
===================================================================
--- db/migrate/016_add_repositories_permissions.rb (revision 16900)
+++ db/migrate/016_add_repositories_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/017_create_settings.rb
===================================================================
--- db/migrate/017_create_settings.rb (revision 16900)
+++ db/migrate/017_create_settings.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateSettings < ActiveRecord::Migration[4.2]
def self.up
create_table :settings, :force => true do |t|
Index: db/migrate/018_set_doc_and_files_notifications.rb
===================================================================
--- db/migrate/018_set_doc_and_files_notifications.rb (revision 16900)
+++ db/migrate/018_set_doc_and_files_notifications.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SetDocAndFilesNotifications < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/019_add_issue_status_position.rb
===================================================================
--- db/migrate/019_add_issue_status_position.rb (revision 16900)
+++ db/migrate/019_add_issue_status_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssueStatusPosition < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_statuses, :position, :integer, :default => 1
Index: db/migrate/020_add_role_position.rb
===================================================================
--- db/migrate/020_add_role_position.rb (revision 16900)
+++ db/migrate/020_add_role_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolePosition < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :position, :integer, :default => 1
Index: db/migrate/021_add_tracker_position.rb
===================================================================
--- db/migrate/021_add_tracker_position.rb (revision 16900)
+++ db/migrate/021_add_tracker_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTrackerPosition < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :position, :integer, :default => 1
Index: db/migrate/022_serialize_possibles_values.rb
===================================================================
--- db/migrate/022_serialize_possibles_values.rb (revision 16900)
+++ db/migrate/022_serialize_possibles_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SerializePossiblesValues < ActiveRecord::Migration[4.2]
def self.up
CustomField.all.each do |field|
Index: db/migrate/023_add_tracker_is_in_roadmap.rb
===================================================================
--- db/migrate/023_add_tracker_is_in_roadmap.rb (revision 16900)
+++ db/migrate/023_add_tracker_is_in_roadmap.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTrackerIsInRoadmap < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :is_in_roadmap, :boolean, :default => true, :null => false
Index: db/migrate/024_add_roadmap_permission.rb
===================================================================
--- db/migrate/024_add_roadmap_permission.rb (revision 16900)
+++ db/migrate/024_add_roadmap_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRoadmapPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/025_add_search_permission.rb
===================================================================
--- db/migrate/025_add_search_permission.rb (revision 16900)
+++ db/migrate/025_add_search_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddSearchPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/026_add_repository_login_and_password.rb
===================================================================
--- db/migrate/026_add_repository_login_and_password.rb (revision 16900)
+++ db/migrate/026_add_repository_login_and_password.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoryLoginAndPassword < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :login, :string, :limit => 60, :default => ""
Index: db/migrate/027_create_wikis.rb
===================================================================
--- db/migrate/027_create_wikis.rb (revision 16900)
+++ db/migrate/027_create_wikis.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateWikis < ActiveRecord::Migration[4.2]
def self.up
create_table :wikis do |t|
Index: db/migrate/028_create_wiki_pages.rb
===================================================================
--- db/migrate/028_create_wiki_pages.rb (revision 16900)
+++ db/migrate/028_create_wiki_pages.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateWikiPages < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_pages do |t|
Index: db/migrate/029_create_wiki_contents.rb
===================================================================
--- db/migrate/029_create_wiki_contents.rb (revision 16900)
+++ db/migrate/029_create_wiki_contents.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateWikiContents < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_contents do |t|
Index: db/migrate/030_add_projects_feeds_permissions.rb
===================================================================
--- db/migrate/030_add_projects_feeds_permissions.rb (revision 16900)
+++ db/migrate/030_add_projects_feeds_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectsFeedsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/031_add_repository_root_url.rb
===================================================================
--- db/migrate/031_add_repository_root_url.rb (revision 16900)
+++ db/migrate/031_add_repository_root_url.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoryRootUrl < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :root_url, :string, :limit => 255, :default => ""
Index: db/migrate/032_create_time_entries.rb
===================================================================
--- db/migrate/032_create_time_entries.rb (revision 16900)
+++ db/migrate/032_create_time_entries.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateTimeEntries < ActiveRecord::Migration[4.2]
def self.up
create_table :time_entries do |t|
Index: db/migrate/033_add_timelog_permissions.rb
===================================================================
--- db/migrate/033_add_timelog_permissions.rb (revision 16900)
+++ db/migrate/033_add_timelog_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTimelogPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/034_create_changesets.rb
===================================================================
--- db/migrate/034_create_changesets.rb (revision 16900)
+++ db/migrate/034_create_changesets.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateChangesets < ActiveRecord::Migration[4.2]
def self.up
create_table :changesets do |t|
Index: db/migrate/035_create_changes.rb
===================================================================
--- db/migrate/035_create_changes.rb (revision 16900)
+++ db/migrate/035_create_changes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateChanges < ActiveRecord::Migration[4.2]
def self.up
create_table :changes do |t|
Index: db/migrate/036_add_changeset_commit_date.rb
===================================================================
--- db/migrate/036_add_changeset_commit_date.rb (revision 16900)
+++ db/migrate/036_add_changeset_commit_date.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddChangesetCommitDate < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :commit_date, :date
Index: db/migrate/037_add_project_identifier.rb
===================================================================
--- db/migrate/037_add_project_identifier.rb (revision 16900)
+++ db/migrate/037_add_project_identifier.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectIdentifier < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :identifier, :string, :limit => 20
Index: db/migrate/038_add_custom_field_is_filter.rb
===================================================================
--- db/migrate/038_add_custom_field_is_filter.rb (revision 16900)
+++ db/migrate/038_add_custom_field_is_filter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldIsFilter < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :is_filter, :boolean, :null => false, :default => false
Index: db/migrate/039_create_watchers.rb
===================================================================
--- db/migrate/039_create_watchers.rb (revision 16900)
+++ db/migrate/039_create_watchers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateWatchers < ActiveRecord::Migration[4.2]
def self.up
create_table :watchers do |t|
Index: db/migrate/040_create_changesets_issues.rb
===================================================================
--- db/migrate/040_create_changesets_issues.rb (revision 16900)
+++ db/migrate/040_create_changesets_issues.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateChangesetsIssues < ActiveRecord::Migration[4.2]
def self.up
create_table :changesets_issues, :id => false do |t|
Index: db/migrate/041_rename_comment_to_comments.rb
===================================================================
--- db/migrate/041_rename_comment_to_comments.rb (revision 16900)
+++ db/migrate/041_rename_comment_to_comments.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RenameCommentToComments < ActiveRecord::Migration[4.2]
def self.up
rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns(Comment.table_name).detect{|c| c.name == "comment"}
Index: db/migrate/042_create_issue_relations.rb
===================================================================
--- db/migrate/042_create_issue_relations.rb (revision 16900)
+++ db/migrate/042_create_issue_relations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateIssueRelations < ActiveRecord::Migration[4.2]
def self.up
create_table :issue_relations do |t|
Index: db/migrate/043_add_relations_permissions.rb
===================================================================
--- db/migrate/043_add_relations_permissions.rb (revision 16900)
+++ db/migrate/043_add_relations_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRelationsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/044_set_language_length_to_five.rb
===================================================================
--- db/migrate/044_set_language_length_to_five.rb (revision 16900)
+++ db/migrate/044_set_language_length_to_five.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SetLanguageLengthToFive < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :language, :string, :limit => 5, :default => ""
Index: db/migrate/045_create_boards.rb
===================================================================
--- db/migrate/045_create_boards.rb (revision 16900)
+++ db/migrate/045_create_boards.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateBoards < ActiveRecord::Migration[4.2]
def self.up
create_table :boards do |t|
Index: db/migrate/046_create_messages.rb
===================================================================
--- db/migrate/046_create_messages.rb (revision 16900)
+++ db/migrate/046_create_messages.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateMessages < ActiveRecord::Migration[4.2]
def self.up
create_table :messages do |t|
Index: db/migrate/047_add_boards_permissions.rb
===================================================================
--- db/migrate/047_add_boards_permissions.rb (revision 16900)
+++ db/migrate/047_add_boards_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddBoardsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/048_allow_null_version_effective_date.rb
===================================================================
--- db/migrate/048_allow_null_version_effective_date.rb (revision 16900)
+++ db/migrate/048_allow_null_version_effective_date.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AllowNullVersionEffectiveDate < ActiveRecord::Migration[4.2]
def self.up
change_column :versions, :effective_date, :date, :default => nil, :null => true
Index: db/migrate/049_add_wiki_destroy_page_permission.rb
===================================================================
--- db/migrate/049_add_wiki_destroy_page_permission.rb (revision 16900)
+++ db/migrate/049_add_wiki_destroy_page_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWikiDestroyPagePermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/050_add_wiki_attachments_permissions.rb
===================================================================
--- db/migrate/050_add_wiki_attachments_permissions.rb (revision 16900)
+++ db/migrate/050_add_wiki_attachments_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWikiAttachmentsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/051_add_project_status.rb
===================================================================
--- db/migrate/051_add_project_status.rb (revision 16900)
+++ db/migrate/051_add_project_status.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :status, :integer, :default => 1, :null => false
Index: db/migrate/052_add_changes_revision.rb
===================================================================
--- db/migrate/052_add_changes_revision.rb (revision 16900)
+++ db/migrate/052_add_changes_revision.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddChangesRevision < ActiveRecord::Migration[4.2]
def self.up
add_column :changes, :revision, :string
Index: db/migrate/053_add_changes_branch.rb
===================================================================
--- db/migrate/053_add_changes_branch.rb (revision 16900)
+++ db/migrate/053_add_changes_branch.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddChangesBranch < ActiveRecord::Migration[4.2]
def self.up
add_column :changes, :branch, :string
Index: db/migrate/054_add_changesets_scmid.rb
===================================================================
--- db/migrate/054_add_changesets_scmid.rb (revision 16900)
+++ db/migrate/054_add_changesets_scmid.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddChangesetsScmid < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :scmid, :string
Index: db/migrate/055_add_repositories_type.rb
===================================================================
--- db/migrate/055_add_repositories_type.rb (revision 16900)
+++ db/migrate/055_add_repositories_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesType < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :type, :string
Index: db/migrate/056_add_repositories_changes_permission.rb
===================================================================
--- db/migrate/056_add_repositories_changes_permission.rb (revision 16900)
+++ db/migrate/056_add_repositories_changes_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesChangesPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
Index: db/migrate/057_add_versions_wiki_page_title.rb
===================================================================
--- db/migrate/057_add_versions_wiki_page_title.rb (revision 16900)
+++ db/migrate/057_add_versions_wiki_page_title.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: trues
class AddVersionsWikiPageTitle < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :wiki_page_title, :string
Index: db/migrate/058_add_issue_categories_assigned_to_id.rb
===================================================================
--- db/migrate/058_add_issue_categories_assigned_to_id.rb (revision 16900)
+++ db/migrate/058_add_issue_categories_assigned_to_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_categories, :assigned_to_id, :integer
Index: db/migrate/059_add_roles_assignable.rb
===================================================================
--- db/migrate/059_add_roles_assignable.rb (revision 16900)
+++ db/migrate/059_add_roles_assignable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesAssignable < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :assignable, :boolean, :default => true
Index: db/migrate/060_change_changesets_committer_limit.rb
===================================================================
--- db/migrate/060_change_changesets_committer_limit.rb (revision 16900)
+++ db/migrate/060_change_changesets_committer_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :changesets, :committer, :string, :limit => nil
Index: db/migrate/061_add_roles_builtin.rb
===================================================================
--- db/migrate/061_add_roles_builtin.rb (revision 16900)
+++ db/migrate/061_add_roles_builtin.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesBuiltin < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :builtin, :integer, :default => 0, :null => false
Index: db/migrate/062_insert_builtin_roles.rb
===================================================================
--- db/migrate/062_insert_builtin_roles.rb (revision 16900)
+++ db/migrate/062_insert_builtin_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class InsertBuiltinRoles < ActiveRecord::Migration[4.2]
def self.up
Role.reset_column_information
Index: db/migrate/063_add_roles_permissions.rb
===================================================================
--- db/migrate/063_add_roles_permissions.rb (revision 16900)
+++ db/migrate/063_add_roles_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesPermissions < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :permissions, :text
Index: db/migrate/064_drop_permissions.rb
===================================================================
--- db/migrate/064_drop_permissions.rb (revision 16900)
+++ db/migrate/064_drop_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class DropPermissions < ActiveRecord::Migration[4.2]
def self.up
drop_table :permissions
Index: db/migrate/065_add_settings_updated_on.rb
===================================================================
--- db/migrate/065_add_settings_updated_on.rb (revision 16900)
+++ db/migrate/065_add_settings_updated_on.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddSettingsUpdatedOn < ActiveRecord::Migration[4.2]
def self.up
add_column :settings, :updated_on, :timestamp
Index: db/migrate/066_add_custom_value_customized_index.rb
===================================================================
--- db/migrate/066_add_custom_value_customized_index.rb (revision 16900)
+++ db/migrate/066_add_custom_value_customized_index.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomValueCustomizedIndex < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
Index: db/migrate/067_create_wiki_redirects.rb
===================================================================
--- db/migrate/067_create_wiki_redirects.rb (revision 16900)
+++ db/migrate/067_create_wiki_redirects.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateWikiRedirects < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_redirects do |t|
Index: db/migrate/068_create_enabled_modules.rb
===================================================================
--- db/migrate/068_create_enabled_modules.rb (revision 16900)
+++ db/migrate/068_create_enabled_modules.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateEnabledModules < ActiveRecord::Migration[4.2]
def self.up
create_table :enabled_modules do |t|
Index: db/migrate/069_add_issues_estimated_hours.rb
===================================================================
--- db/migrate/069_add_issues_estimated_hours.rb (revision 16900)
+++ db/migrate/069_add_issues_estimated_hours.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssuesEstimatedHours < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :estimated_hours, :float
Index: db/migrate/070_change_attachments_content_type_limit.rb
===================================================================
--- db/migrate/070_change_attachments_content_type_limit.rb (revision 16900)
+++ db/migrate/070_change_attachments_content_type_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :attachments, :content_type, :string, :limit => nil
Index: db/migrate/071_add_queries_column_names.rb
===================================================================
--- db/migrate/071_add_queries_column_names.rb (revision 16900)
+++ db/migrate/071_add_queries_column_names.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesColumnNames < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :column_names, :text
Index: db/migrate/072_add_enumerations_position.rb
===================================================================
--- db/migrate/072_add_enumerations_position.rb (revision 16900)
+++ db/migrate/072_add_enumerations_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddEnumerationsPosition < ActiveRecord::Migration[4.2]
def self.up
add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
Index: db/migrate/073_add_enumerations_is_default.rb
===================================================================
--- db/migrate/073_add_enumerations_is_default.rb (revision 16900)
+++ db/migrate/073_add_enumerations_is_default.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddEnumerationsIsDefault < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :is_default, :boolean, :default => false, :null => false
Index: db/migrate/074_add_auth_sources_tls.rb
===================================================================
--- db/migrate/074_add_auth_sources_tls.rb (revision 16900)
+++ db/migrate/074_add_auth_sources_tls.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddAuthSourcesTls < ActiveRecord::Migration[4.2]
def self.up
add_column :auth_sources, :tls, :boolean, :default => false, :null => false
Index: db/migrate/075_add_members_mail_notification.rb
===================================================================
--- db/migrate/075_add_members_mail_notification.rb (revision 16900)
+++ db/migrate/075_add_members_mail_notification.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMembersMailNotification < ActiveRecord::Migration[4.2]
def self.up
add_column :members, :mail_notification, :boolean, :default => false, :null => false
Index: db/migrate/076_allow_null_position.rb
===================================================================
--- db/migrate/076_allow_null_position.rb (revision 16900)
+++ db/migrate/076_allow_null_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AllowNullPosition < ActiveRecord::Migration[4.2]
def self.up
Enumeration.reset_column_information
Index: db/migrate/077_remove_issue_statuses_html_color.rb
===================================================================
--- db/migrate/077_remove_issue_statuses_html_color.rb (revision 16900)
+++ db/migrate/077_remove_issue_statuses_html_color.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveIssueStatusesHtmlColor < ActiveRecord::Migration[4.2]
def self.up
remove_column :issue_statuses, :html_color
Index: db/migrate/078_add_custom_fields_position.rb
===================================================================
--- db/migrate/078_add_custom_fields_position.rb (revision 16900)
+++ db/migrate/078_add_custom_fields_position.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsPosition < ActiveRecord::Migration[4.2]
def self.up
add_column(:custom_fields, :position, :integer, :default => 1)
Index: db/migrate/079_add_user_preferences_time_zone.rb
===================================================================
--- db/migrate/079_add_user_preferences_time_zone.rb (revision 16900)
+++ db/migrate/079_add_user_preferences_time_zone.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUserPreferencesTimeZone < ActiveRecord::Migration[4.2]
def self.up
add_column :user_preferences, :time_zone, :string
Index: db/migrate/080_add_users_type.rb
===================================================================
--- db/migrate/080_add_users_type.rb (revision 16900)
+++ db/migrate/080_add_users_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUsersType < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :type, :string
Index: db/migrate/081_create_projects_trackers.rb
===================================================================
--- db/migrate/081_create_projects_trackers.rb (revision 16900)
+++ db/migrate/081_create_projects_trackers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateProjectsTrackers < ActiveRecord::Migration[4.2]
def self.up
create_table :projects_trackers, :id => false do |t|
Index: db/migrate/082_add_messages_locked.rb
===================================================================
--- db/migrate/082_add_messages_locked.rb (revision 16900)
+++ db/migrate/082_add_messages_locked.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMessagesLocked < ActiveRecord::Migration[4.2]
def self.up
add_column :messages, :locked, :boolean, :default => false
Index: db/migrate/083_add_messages_sticky.rb
===================================================================
--- db/migrate/083_add_messages_sticky.rb (revision 16900)
+++ db/migrate/083_add_messages_sticky.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMessagesSticky < ActiveRecord::Migration[4.2]
def self.up
add_column :messages, :sticky, :integer, :default => 0
Index: db/migrate/084_change_auth_sources_account_limit.rb
===================================================================
--- db/migrate/084_change_auth_sources_account_limit.rb (revision 16900)
+++ db/migrate/084_change_auth_sources_account_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeAuthSourcesAccountLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :auth_sources, :account, :string, :limit => nil
Index: db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb
===================================================================
--- db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb (revision 16900)
+++ db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => :wkfs_role_tracker_old_status
Index: db/migrate/086_add_custom_fields_searchable.rb
===================================================================
--- db/migrate/086_add_custom_fields_searchable.rb (revision 16900)
+++ db/migrate/086_add_custom_fields_searchable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsSearchable < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :searchable, :boolean, :default => false
Index: db/migrate/087_change_projects_description_to_text.rb
===================================================================
--- db/migrate/087_change_projects_description_to_text.rb (revision 16900)
+++ db/migrate/087_change_projects_description_to_text.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeProjectsDescriptionToText < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :description, :text, :null => true, :default => nil
Index: db/migrate/088_add_custom_fields_default_value.rb
===================================================================
--- db/migrate/088_add_custom_fields_default_value.rb (revision 16900)
+++ db/migrate/088_add_custom_fields_default_value.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsDefaultValue < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :default_value, :text
Index: db/migrate/089_add_attachments_description.rb
===================================================================
--- db/migrate/089_add_attachments_description.rb (revision 16900)
+++ db/migrate/089_add_attachments_description.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddAttachmentsDescription < ActiveRecord::Migration[4.2]
def self.up
add_column :attachments, :description, :string
Index: db/migrate/090_change_versions_name_limit.rb
===================================================================
--- db/migrate/090_change_versions_name_limit.rb (revision 16900)
+++ db/migrate/090_change_versions_name_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeVersionsNameLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :versions, :name, :string, :limit => nil
Index: db/migrate/091_change_changesets_revision_to_string.rb
===================================================================
--- db/migrate/091_change_changesets_revision_to_string.rb (revision 16900)
+++ db/migrate/091_change_changesets_revision_to_string.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeChangesetsRevisionToString < ActiveRecord::Migration[4.2]
def self.up
# Some backends (eg. SQLServer 2012) do not support changing the type
Index: db/migrate/092_change_changes_from_revision_to_string.rb
===================================================================
--- db/migrate/092_change_changes_from_revision_to_string.rb (revision 16900)
+++ db/migrate/092_change_changes_from_revision_to_string.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeChangesFromRevisionToString < ActiveRecord::Migration[4.2]
def self.up
change_column :changes, :from_revision, :string
Index: db/migrate/093_add_wiki_pages_protected.rb
===================================================================
--- db/migrate/093_add_wiki_pages_protected.rb (revision 16900)
+++ db/migrate/093_add_wiki_pages_protected.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWikiPagesProtected < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_pages, :protected, :boolean, :default => false, :null => false
Index: db/migrate/094_change_projects_homepage_limit.rb
===================================================================
--- db/migrate/094_change_projects_homepage_limit.rb (revision 16900)
+++ db/migrate/094_change_projects_homepage_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeProjectsHomepageLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :homepage, :string, :limit => nil, :default => ''
Index: db/migrate/095_add_wiki_pages_parent_id.rb
===================================================================
--- db/migrate/095_add_wiki_pages_parent_id.rb (revision 16900)
+++ db/migrate/095_add_wiki_pages_parent_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWikiPagesParentId < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_pages, :parent_id, :integer, :default => nil
Index: db/migrate/096_add_commit_access_permission.rb
===================================================================
--- db/migrate/096_add_commit_access_permission.rb (revision 16900)
+++ db/migrate/096_add_commit_access_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCommitAccessPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.select { |r| not r.builtin? }.each do |r|
Index: db/migrate/097_add_view_wiki_edits_permission.rb
===================================================================
--- db/migrate/097_add_view_wiki_edits_permission.rb (revision 16900)
+++ db/migrate/097_add_view_wiki_edits_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddViewWikiEditsPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |r|
Index: db/migrate/098_set_topic_authors_as_watchers.rb
===================================================================
--- db/migrate/098_set_topic_authors_as_watchers.rb (revision 16900)
+++ db/migrate/098_set_topic_authors_as_watchers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SetTopicAuthorsAsWatchers < ActiveRecord::Migration[4.2]
def self.up
# Sets active users who created/replied a topic as watchers of the topic
Index: db/migrate/099_add_delete_wiki_pages_attachments_permission.rb
===================================================================
--- db/migrate/099_add_delete_wiki_pages_attachments_permission.rb (revision 16900)
+++ db/migrate/099_add_delete_wiki_pages_attachments_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |r|
Index: db/migrate/100_add_changesets_user_id.rb
===================================================================
--- db/migrate/100_add_changesets_user_id.rb (revision 16900)
+++ db/migrate/100_add_changesets_user_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddChangesetsUserId < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :user_id, :integer, :default => nil
Index: db/migrate/101_populate_changesets_user_id.rb
===================================================================
--- db/migrate/101_populate_changesets_user_id.rb (revision 16900)
+++ db/migrate/101_populate_changesets_user_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateChangesetsUserId < ActiveRecord::Migration[4.2]
def self.up
committers = Changeset.connection.select_values("SELECT DISTINCT committer FROM #{Changeset.table_name}")
Index: db/migrate/102_add_custom_fields_editable.rb
===================================================================
--- db/migrate/102_add_custom_fields_editable.rb (revision 16900)
+++ db/migrate/102_add_custom_fields_editable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsEditable < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :editable, :boolean, :default => true
Index: db/migrate/103_set_custom_fields_editable.rb
===================================================================
--- db/migrate/103_set_custom_fields_editable.rb (revision 16900)
+++ db/migrate/103_set_custom_fields_editable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SetCustomFieldsEditable < ActiveRecord::Migration[4.2]
def self.up
UserCustomField.update_all("editable = #{CustomField.connection.quoted_false}")
Index: db/migrate/104_add_projects_lft_and_rgt.rb
===================================================================
--- db/migrate/104_add_projects_lft_and_rgt.rb (revision 16900)
+++ db/migrate/104_add_projects_lft_and_rgt.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectsLftAndRgt < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :lft, :integer
Index: db/migrate/105_build_projects_tree.rb
===================================================================
--- db/migrate/105_build_projects_tree.rb (revision 16900)
+++ db/migrate/105_build_projects_tree.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class BuildProjectsTree < ActiveRecord::Migration[4.2]
def self.up
Project.rebuild_tree!
Index: db/migrate/106_remove_projects_projects_count.rb
===================================================================
--- db/migrate/106_remove_projects_projects_count.rb (revision 16900)
+++ db/migrate/106_remove_projects_projects_count.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveProjectsProjectsCount < ActiveRecord::Migration[4.2]
def self.up
remove_column :projects, :projects_count
Index: db/migrate/107_add_open_id_authentication_tables.rb
===================================================================
--- db/migrate/107_add_open_id_authentication_tables.rb (revision 16900)
+++ db/migrate/107_add_open_id_authentication_tables.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddOpenIdAuthenticationTables < ActiveRecord::Migration[4.2]
def self.up
create_table :open_id_authentication_associations, :force => true do |t|
Index: db/migrate/108_add_identity_url_to_users.rb
===================================================================
--- db/migrate/108_add_identity_url_to_users.rb (revision 16900)
+++ db/migrate/108_add_identity_url_to_users.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIdentityUrlToUsers < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :identity_url, :string
Index: db/migrate/20090214190337_add_watchers_user_id_type_index.rb
===================================================================
--- db/migrate/20090214190337_add_watchers_user_id_type_index.rb (revision 16900)
+++ db/migrate/20090214190337_add_watchers_user_id_type_index.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWatchersUserIdTypeIndex < ActiveRecord::Migration[4.2]
def self.up
add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type
Index: db/migrate/20090312172426_add_queries_sort_criteria.rb
===================================================================
--- db/migrate/20090312172426_add_queries_sort_criteria.rb (revision 16900)
+++ db/migrate/20090312172426_add_queries_sort_criteria.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesSortCriteria < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :sort_criteria, :text
Index: db/migrate/20090312194159_add_projects_trackers_unique_index.rb
===================================================================
--- db/migrate/20090312194159_add_projects_trackers_unique_index.rb (revision 16900)
+++ db/migrate/20090312194159_add_projects_trackers_unique_index.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectsTrackersUniqueIndex < ActiveRecord::Migration[4.2]
def self.up
remove_duplicates
Index: db/migrate/20090318181151_extend_settings_name.rb
===================================================================
--- db/migrate/20090318181151_extend_settings_name.rb (revision 16900)
+++ db/migrate/20090318181151_extend_settings_name.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ExtendSettingsName < ActiveRecord::Migration[4.2]
def self.up
change_column :settings, :name, :string, :limit => 255, :default => '', :null => false
Index: db/migrate/20090323224724_add_type_to_enumerations.rb
===================================================================
--- db/migrate/20090323224724_add_type_to_enumerations.rb (revision 16900)
+++ db/migrate/20090323224724_add_type_to_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTypeToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :type, :string
Index: db/migrate/20090401221305_update_enumerations_to_sti.rb
===================================================================
--- db/migrate/20090401221305_update_enumerations_to_sti.rb (revision 16900)
+++ db/migrate/20090401221305_update_enumerations_to_sti.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class UpdateEnumerationsToSti < ActiveRecord::Migration[4.2]
def self.up
Enumeration.where("opt = 'IPRI'").update_all("type = 'IssuePriority'")
Index: db/migrate/20090401231134_add_active_field_to_enumerations.rb
===================================================================
--- db/migrate/20090401231134_add_active_field_to_enumerations.rb (revision 16900)
+++ db/migrate/20090401231134_add_active_field_to_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddActiveFieldToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :active, :boolean, :default => true, :null => false
Index: db/migrate/20090403001910_add_project_to_enumerations.rb
===================================================================
--- db/migrate/20090403001910_add_project_to_enumerations.rb (revision 16900)
+++ db/migrate/20090403001910_add_project_to_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :project_id, :integer, :null => true, :default => nil
Index: db/migrate/20090406161854_add_parent_id_to_enumerations.rb
===================================================================
--- db/migrate/20090406161854_add_parent_id_to_enumerations.rb (revision 16900)
+++ db/migrate/20090406161854_add_parent_id_to_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddParentIdToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :parent_id, :integer, :null => true, :default => nil
Index: db/migrate/20090425161243_add_queries_group_by.rb
===================================================================
--- db/migrate/20090425161243_add_queries_group_by.rb (revision 16900)
+++ db/migrate/20090425161243_add_queries_group_by.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesGroupBy < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :group_by, :string
Index: db/migrate/20090503121501_create_member_roles.rb
===================================================================
--- db/migrate/20090503121501_create_member_roles.rb (revision 16900)
+++ db/migrate/20090503121501_create_member_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateMemberRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :member_roles do |t|
Index: db/migrate/20090503121505_populate_member_roles.rb
===================================================================
--- db/migrate/20090503121505_populate_member_roles.rb (revision 16900)
+++ db/migrate/20090503121505_populate_member_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateMemberRoles < ActiveRecord::Migration[4.2]
def self.up
MemberRole.delete_all
Index: db/migrate/20090503121510_drop_members_role_id.rb
===================================================================
--- db/migrate/20090503121510_drop_members_role_id.rb (revision 16900)
+++ db/migrate/20090503121510_drop_members_role_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class DropMembersRoleId < ActiveRecord::Migration[4.2]
def self.up
remove_column :members, :role_id
Index: db/migrate/20090614091200_fix_messages_sticky_null.rb
===================================================================
--- db/migrate/20090614091200_fix_messages_sticky_null.rb (revision 16900)
+++ db/migrate/20090614091200_fix_messages_sticky_null.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class FixMessagesStickyNull < ActiveRecord::Migration[4.2]
def self.up
Message.where('sticky IS NULL').update_all('sticky = 0')
Index: db/migrate/20090704172350_populate_users_type.rb
===================================================================
--- db/migrate/20090704172350_populate_users_type.rb (revision 16900)
+++ db/migrate/20090704172350_populate_users_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateUsersType < ActiveRecord::Migration[4.2]
def self.up
Principal.where("type IS NULL").update_all("type = 'User'")
Index: db/migrate/20090704172355_create_groups_users.rb
===================================================================
--- db/migrate/20090704172355_create_groups_users.rb (revision 16900)
+++ db/migrate/20090704172355_create_groups_users.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateGroupsUsers < ActiveRecord::Migration[4.2]
def self.up
create_table :groups_users, :id => false do |t|
Index: db/migrate/20090704172358_add_member_roles_inherited_from.rb
===================================================================
--- db/migrate/20090704172358_add_member_roles_inherited_from.rb (revision 16900)
+++ db/migrate/20090704172358_add_member_roles_inherited_from.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMemberRolesInheritedFrom < ActiveRecord::Migration[4.2]
def self.up
add_column :member_roles, :inherited_from, :integer
Index: db/migrate/20091010093521_fix_users_custom_values.rb
===================================================================
--- db/migrate/20091010093521_fix_users_custom_values.rb (revision 16900)
+++ db/migrate/20091010093521_fix_users_custom_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class FixUsersCustomValues < ActiveRecord::Migration[4.2]
def self.up
CustomValue.where("customized_type = 'User'").
Index: db/migrate/20091017212227_add_missing_indexes_to_workflows.rb
===================================================================
--- db/migrate/20091017212227_add_missing_indexes_to_workflows.rb (revision 16900)
+++ db/migrate/20091017212227_add_missing_indexes_to_workflows.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, :old_status_id
Index: db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb
===================================================================
--- db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb (revision 16900)
+++ db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToCustomFieldsProjects < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields_projects, [:custom_field_id, :project_id]
Index: db/migrate/20091017212644_add_missing_indexes_to_messages.rb
===================================================================
--- db/migrate/20091017212644_add_missing_indexes_to_messages.rb (revision 16900)
+++ db/migrate/20091017212644_add_missing_indexes_to_messages.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToMessages < ActiveRecord::Migration[4.2]
def self.up
add_index :messages, :last_reply_id
Index: db/migrate/20091017212938_add_missing_indexes_to_repositories.rb
===================================================================
--- db/migrate/20091017212938_add_missing_indexes_to_repositories.rb (revision 16900)
+++ db/migrate/20091017212938_add_missing_indexes_to_repositories.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToRepositories < ActiveRecord::Migration[4.2]
def self.up
add_index :repositories, :project_id
Index: db/migrate/20091017213027_add_missing_indexes_to_comments.rb
===================================================================
--- db/migrate/20091017213027_add_missing_indexes_to_comments.rb (revision 16900)
+++ db/migrate/20091017213027_add_missing_indexes_to_comments.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToComments < ActiveRecord::Migration[4.2]
def self.up
add_index :comments, [:commented_id, :commented_type]
Index: db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb
===================================================================
--- db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb (revision 16900)
+++ db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_index :enumerations, [:id, :type]
Index: db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb
===================================================================
--- db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb (revision 16900)
+++ db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToWikiPages < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_pages, :wiki_id
Index: db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
===================================================================
--- db/migrate/20091017213228_add_missing_indexes_to_watchers.rb (revision 16900)
+++ db/migrate/20091017213228_add_missing_indexes_to_watchers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToWatchers < ActiveRecord::Migration[4.2]
def self.up
add_index :watchers, :user_id
Index: db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb
===================================================================
--- db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb (revision 16900)
+++ db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToAuthSources < ActiveRecord::Migration[4.2]
def self.up
add_index :auth_sources, [:id, :type]
Index: db/migrate/20091017213332_add_missing_indexes_to_documents.rb
===================================================================
--- db/migrate/20091017213332_add_missing_indexes_to_documents.rb (revision 16900)
+++ db/migrate/20091017213332_add_missing_indexes_to_documents.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToDocuments < ActiveRecord::Migration[4.2]
def self.up
add_index :documents, :category_id
Index: db/migrate/20091017213444_add_missing_indexes_to_tokens.rb
===================================================================
--- db/migrate/20091017213444_add_missing_indexes_to_tokens.rb (revision 16900)
+++ db/migrate/20091017213444_add_missing_indexes_to_tokens.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToTokens < ActiveRecord::Migration[4.2]
def self.up
add_index :tokens, :user_id
Index: db/migrate/20091017213536_add_missing_indexes_to_changesets.rb
===================================================================
--- db/migrate/20091017213536_add_missing_indexes_to_changesets.rb (revision 16900)
+++ db/migrate/20091017213536_add_missing_indexes_to_changesets.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToChangesets < ActiveRecord::Migration[4.2]
def self.up
add_index :changesets, :user_id
Index: db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb
===================================================================
--- db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb (revision 16900)
+++ db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToIssueCategories < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_categories, :assigned_to_id
Index: db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb
===================================================================
--- db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb (revision 16900)
+++ db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToMemberRoles < ActiveRecord::Migration[4.2]
def self.up
add_index :member_roles, :member_id
Index: db/migrate/20091017213757_add_missing_indexes_to_boards.rb
===================================================================
--- db/migrate/20091017213757_add_missing_indexes_to_boards.rb (revision 16900)
+++ db/migrate/20091017213757_add_missing_indexes_to_boards.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToBoards < ActiveRecord::Migration[4.2]
def self.up
add_index :boards, :last_message_id
Index: db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb
===================================================================
--- db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb (revision 16900)
+++ db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToUserPreferences < ActiveRecord::Migration[4.2]
def self.up
add_index :user_preferences, :user_id
Index: db/migrate/20091017213910_add_missing_indexes_to_issues.rb
===================================================================
--- db/migrate/20091017213910_add_missing_indexes_to_issues.rb (revision 16900)
+++ db/migrate/20091017213910_add_missing_indexes_to_issues.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToIssues < ActiveRecord::Migration[4.2]
def self.up
add_index :issues, :status_id
Index: db/migrate/20091017214015_add_missing_indexes_to_members.rb
===================================================================
--- db/migrate/20091017214015_add_missing_indexes_to_members.rb (revision 16900)
+++ db/migrate/20091017214015_add_missing_indexes_to_members.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToMembers < ActiveRecord::Migration[4.2]
def self.up
add_index :members, :user_id
Index: db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb
===================================================================
--- db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb (revision 16900)
+++ db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToCustomFields < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields, [:id, :type]
Index: db/migrate/20091017214136_add_missing_indexes_to_queries.rb
===================================================================
--- db/migrate/20091017214136_add_missing_indexes_to_queries.rb (revision 16900)
+++ db/migrate/20091017214136_add_missing_indexes_to_queries.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToQueries < ActiveRecord::Migration[4.2]
def self.up
add_index :queries, :project_id
Index: db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb
===================================================================
--- db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb (revision 16900)
+++ db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToTimeEntries < ActiveRecord::Migration[4.2]
def self.up
add_index :time_entries, :activity_id
Index: db/migrate/20091017214308_add_missing_indexes_to_news.rb
===================================================================
--- db/migrate/20091017214308_add_missing_indexes_to_news.rb (revision 16900)
+++ db/migrate/20091017214308_add_missing_indexes_to_news.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToNews < ActiveRecord::Migration[4.2]
def self.up
add_index :news, :author_id
Index: db/migrate/20091017214336_add_missing_indexes_to_users.rb
===================================================================
--- db/migrate/20091017214336_add_missing_indexes_to_users.rb (revision 16900)
+++ db/migrate/20091017214336_add_missing_indexes_to_users.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToUsers < ActiveRecord::Migration[4.2]
def self.up
add_index :users, [:id, :type]
Index: db/migrate/20091017214406_add_missing_indexes_to_attachments.rb
===================================================================
--- db/migrate/20091017214406_add_missing_indexes_to_attachments.rb (revision 16900)
+++ db/migrate/20091017214406_add_missing_indexes_to_attachments.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToAttachments < ActiveRecord::Migration[4.2]
def self.up
add_index :attachments, [:container_id, :container_type]
Index: db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb
===================================================================
--- db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb (revision 16900)
+++ db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToWikiContents < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_contents, :author_id
Index: db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb
===================================================================
--- db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb (revision 16900)
+++ db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToCustomValues < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_values, :custom_field_id
Index: db/migrate/20091017214611_add_missing_indexes_to_journals.rb
===================================================================
--- db/migrate/20091017214611_add_missing_indexes_to_journals.rb (revision 16900)
+++ db/migrate/20091017214611_add_missing_indexes_to_journals.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToJournals < ActiveRecord::Migration[4.2]
def self.up
add_index :journals, :user_id
Index: db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb
===================================================================
--- db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb (revision 16900)
+++ db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToIssueRelations < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_relations, :issue_from_id
Index: db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb
===================================================================
--- db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb (revision 16900)
+++ db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToWikiRedirects < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_redirects, :wiki_id
Index: db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb
===================================================================
--- db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb (revision 16900)
+++ db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddMissingIndexesToCustomFieldsTrackers < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields_trackers, [:custom_field_id, :tracker_id]
Index: db/migrate/20091025163651_add_activity_indexes.rb
===================================================================
--- db/migrate/20091025163651_add_activity_indexes.rb (revision 16900)
+++ db/migrate/20091025163651_add_activity_indexes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddActivityIndexes < ActiveRecord::Migration[4.2]
def self.up
add_index :journals, :created_on
Index: db/migrate/20091108092559_add_versions_status.rb
===================================================================
--- db/migrate/20091108092559_add_versions_status.rb (revision 16900)
+++ db/migrate/20091108092559_add_versions_status.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddVersionsStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :status, :string, :default => 'open'
Index: db/migrate/20091114105931_add_view_issues_permission.rb
===================================================================
--- db/migrate/20091114105931_add_view_issues_permission.rb (revision 16900)
+++ db/migrate/20091114105931_add_view_issues_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddViewIssuesPermission < ActiveRecord::Migration[4.2]
def self.up
Role.reset_column_information
Index: db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb
===================================================================
--- db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb (revision 16900)
+++ db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddDefaultDoneRatioToIssueStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_statuses, :default_done_ratio, :integer
Index: db/migrate/20091205124427_add_versions_sharing.rb
===================================================================
--- db/migrate/20091205124427_add_versions_sharing.rb (revision 16900)
+++ db/migrate/20091205124427_add_versions_sharing.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddVersionsSharing < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :sharing, :string, :default => 'none', :null => false
Index: db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb
===================================================================
--- db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb (revision 16900)
+++ db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddLftAndRgtIndexesToProjects < ActiveRecord::Migration[4.2]
def self.up
add_index :projects, :lft
Index: db/migrate/20091220183727_add_index_to_settings_name.rb
===================================================================
--- db/migrate/20091220183727_add_index_to_settings_name.rb (revision 16900)
+++ db/migrate/20091220183727_add_index_to_settings_name.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexToSettingsName < ActiveRecord::Migration[4.2]
def self.up
add_index :settings, :name
Index: db/migrate/20091220184736_add_indexes_to_issue_status.rb
===================================================================
--- db/migrate/20091220184736_add_indexes_to_issue_status.rb (revision 16900)
+++ db/migrate/20091220184736_add_indexes_to_issue_status.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexesToIssueStatus < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_statuses, :position
Index: db/migrate/20091225164732_remove_enumerations_opt.rb
===================================================================
--- db/migrate/20091225164732_remove_enumerations_opt.rb (revision 16900)
+++ db/migrate/20091225164732_remove_enumerations_opt.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveEnumerationsOpt < ActiveRecord::Migration[4.2]
def self.up
remove_column :enumerations, :opt
Index: db/migrate/20091227112908_change_wiki_contents_text_limit.rb
===================================================================
--- db/migrate/20091227112908_change_wiki_contents_text_limit.rb (revision 16900)
+++ db/migrate/20091227112908_change_wiki_contents_text_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeWikiContentsTextLimit < ActiveRecord::Migration[4.2]
def self.up
# Migrates MySQL databases only
Index: db/migrate/20100129193402_change_users_mail_notification_to_string.rb
===================================================================
--- db/migrate/20100129193402_change_users_mail_notification_to_string.rb (revision 16900)
+++ db/migrate/20100129193402_change_users_mail_notification_to_string.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeUsersMailNotificationToString < ActiveRecord::Migration[4.2]
def self.up
rename_column :users, :mail_notification, :mail_notification_bool
Index: db/migrate/20100129193813_update_mail_notification_values.rb
===================================================================
--- db/migrate/20100129193813_update_mail_notification_values.rb (revision 16900)
+++ db/migrate/20100129193813_update_mail_notification_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Patch the data from a boolean change.
class UpdateMailNotificationValues < ActiveRecord::Migration[4.2]
def self.up
Index: db/migrate/20100221100219_add_index_on_changesets_scmid.rb
===================================================================
--- db/migrate/20100221100219_add_index_on_changesets_scmid.rb (revision 16900)
+++ db/migrate/20100221100219_add_index_on_changesets_scmid.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnChangesetsScmid < ActiveRecord::Migration[4.2]
def self.up
add_index :changesets, [:repository_id, :scmid], :name => :changesets_repos_scmid
Index: db/migrate/20100313132032_add_issues_nested_sets_columns.rb
===================================================================
--- db/migrate/20100313132032_add_issues_nested_sets_columns.rb (revision 16900)
+++ db/migrate/20100313132032_add_issues_nested_sets_columns.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssuesNestedSetsColumns < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :parent_id, :integer, :default => nil
Index: db/migrate/20100313171051_add_index_on_issues_nested_set.rb
===================================================================
--- db/migrate/20100313171051_add_index_on_issues_nested_set.rb (revision 16900)
+++ db/migrate/20100313171051_add_index_on_issues_nested_set.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnIssuesNestedSet < ActiveRecord::Migration[4.2]
def self.up
add_index :issues, [:root_id, :lft, :rgt]
Index: db/migrate/20100705164950_change_changes_path_length_limit.rb
===================================================================
--- db/migrate/20100705164950_change_changes_path_length_limit.rb (revision 16900)
+++ db/migrate/20100705164950_change_changes_path_length_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeChangesPathLengthLimit < ActiveRecord::Migration[4.2]
def self.up
# these are two steps to please MySQL 5 on Win32
Index: db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
===================================================================
--- db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb (revision 16900)
+++ db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration[4.2]
def self.up
EnabledModule.where(:name => 'issue_tracking').each do |e|
Index: db/migrate/20101104182107_add_unique_index_on_members.rb
===================================================================
--- db/migrate/20101104182107_add_unique_index_on_members.rb (revision 16900)
+++ db/migrate/20101104182107_add_unique_index_on_members.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexOnMembers < ActiveRecord::Migration[4.2]
def self.up
# Clean and reassign MemberRole rows if needed
Index: db/migrate/20101107130441_add_custom_fields_visible.rb
===================================================================
--- db/migrate/20101107130441_add_custom_fields_visible.rb (revision 16900)
+++ db/migrate/20101107130441_add_custom_fields_visible.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsVisible < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :visible, :boolean, :null => false, :default => true
Index: db/migrate/20101114115114_change_projects_name_limit.rb
===================================================================
--- db/migrate/20101114115114_change_projects_name_limit.rb (revision 16900)
+++ db/migrate/20101114115114_change_projects_name_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeProjectsNameLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :name, :string, :limit => nil, :default => '', :null => false
Index: db/migrate/20101114115359_change_projects_identifier_limit.rb
===================================================================
--- db/migrate/20101114115359_change_projects_identifier_limit.rb (revision 16900)
+++ db/migrate/20101114115359_change_projects_identifier_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeProjectsIdentifierLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :identifier, :string, :limit => nil
Index: db/migrate/20110220160626_add_workflows_assignee_and_author.rb
===================================================================
--- db/migrate/20110220160626_add_workflows_assignee_and_author.rb (revision 16900)
+++ db/migrate/20110220160626_add_workflows_assignee_and_author.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWorkflowsAssigneeAndAuthor < ActiveRecord::Migration[4.2]
def self.up
add_column :workflows, :assignee, :boolean, :null => false, :default => false
Index: db/migrate/20110223180944_add_users_salt.rb
===================================================================
--- db/migrate/20110223180944_add_users_salt.rb (revision 16900)
+++ db/migrate/20110223180944_add_users_salt.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUsersSalt < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :salt, :string, :limit => 64
Index: db/migrate/20110223180953_salt_user_passwords.rb
===================================================================
--- db/migrate/20110223180953_salt_user_passwords.rb (revision 16900)
+++ db/migrate/20110223180953_salt_user_passwords.rb (working copy)
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
class SaltUserPasswords < ActiveRecord::Migration[4.2]
-
+
def self.up
say_with_time "Salting user passwords, this may take some time..." do
User.salt_unsalted_passwords!
Index: db/migrate/20110224000000_add_repositories_path_encoding.rb
===================================================================
--- db/migrate/20110224000000_add_repositories_path_encoding.rb (revision 16900)
+++ db/migrate/20110224000000_add_repositories_path_encoding.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesPathEncoding < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :path_encoding, :string, :limit => 64, :default => nil
Index: db/migrate/20110226120112_change_repositories_password_limit.rb
===================================================================
--- db/migrate/20110226120112_change_repositories_password_limit.rb (revision 16900)
+++ db/migrate/20110226120112_change_repositories_password_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeRepositoriesPasswordLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :repositories, :password, :string, :limit => nil, :default => ''
Index: db/migrate/20110226120132_change_auth_sources_account_password_limit.rb
===================================================================
--- db/migrate/20110226120132_change_auth_sources_account_password_limit.rb (revision 16900)
+++ db/migrate/20110226120132_change_auth_sources_account_password_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeAuthSourcesAccountPasswordLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :auth_sources, :account_password, :string, :limit => nil, :default => ''
Index: db/migrate/20110227125750_change_journal_details_values_to_text.rb
===================================================================
--- db/migrate/20110227125750_change_journal_details_values_to_text.rb (revision 16900)
+++ db/migrate/20110227125750_change_journal_details_values_to_text.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeJournalDetailsValuesToText < ActiveRecord::Migration[4.2]
def self.up
change_column :journal_details, :old_value, :text
Index: db/migrate/20110228000000_add_repositories_log_encoding.rb
===================================================================
--- db/migrate/20110228000000_add_repositories_log_encoding.rb (revision 16900)
+++ db/migrate/20110228000000_add_repositories_log_encoding.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesLogEncoding < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :log_encoding, :string, :limit => 64, :default => nil
Index: db/migrate/20110228000100_copy_repositories_log_encoding.rb
===================================================================
--- db/migrate/20110228000100_copy_repositories_log_encoding.rb (revision 16900)
+++ db/migrate/20110228000100_copy_repositories_log_encoding.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CopyRepositoriesLogEncoding < ActiveRecord::Migration[4.2]
def self.up
encoding = Setting.commit_logs_encoding.to_s.strip
Index: db/migrate/20110401192910_add_index_to_users_type.rb
===================================================================
--- db/migrate/20110401192910_add_index_to_users_type.rb (revision 16900)
+++ db/migrate/20110401192910_add_index_to_users_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexToUsersType < ActiveRecord::Migration[4.2]
def self.up
add_index :users, :type
Index: db/migrate/20110408103312_add_roles_issues_visibility.rb
===================================================================
--- db/migrate/20110408103312_add_roles_issues_visibility.rb (revision 16900)
+++ db/migrate/20110408103312_add_roles_issues_visibility.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesIssuesVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :issues_visibility, :string, :limit => 30, :default => 'default', :null => false
Index: db/migrate/20110412065600_add_issues_is_private.rb
===================================================================
--- db/migrate/20110412065600_add_issues_is_private.rb (revision 16900)
+++ db/migrate/20110412065600_add_issues_is_private.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssuesIsPrivate < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :is_private, :boolean, :default => false, :null => false
Index: db/migrate/20110511000000_add_repositories_extra_info.rb
===================================================================
--- db/migrate/20110511000000_add_repositories_extra_info.rb (revision 16900)
+++ db/migrate/20110511000000_add_repositories_extra_info.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesExtraInfo < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :extra_info, :text
Index: db/migrate/20110902000000_create_changeset_parents.rb
===================================================================
--- db/migrate/20110902000000_create_changeset_parents.rb (revision 16900)
+++ db/migrate/20110902000000_create_changeset_parents.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateChangesetParents < ActiveRecord::Migration[4.2]
def self.up
create_table :changeset_parents, :id => false do |t|
Index: db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
===================================================================
--- db/migrate/20111201201315_add_unique_index_to_issue_relations.rb (revision 16900)
+++ db/migrate/20111201201315_add_unique_index_to_issue_relations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexToIssueRelations < ActiveRecord::Migration[4.2]
def self.up
Index: db/migrate/20120115143024_add_repositories_identifier.rb
===================================================================
--- db/migrate/20120115143024_add_repositories_identifier.rb (revision 16900)
+++ db/migrate/20120115143024_add_repositories_identifier.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesIdentifier < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :identifier, :string
Index: db/migrate/20120115143100_add_repositories_is_default.rb
===================================================================
--- db/migrate/20120115143100_add_repositories_is_default.rb (revision 16900)
+++ db/migrate/20120115143100_add_repositories_is_default.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesIsDefault < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :is_default, :boolean, :default => false
Index: db/migrate/20120115143126_set_default_repositories.rb
===================================================================
--- db/migrate/20120115143126_set_default_repositories.rb (revision 16900)
+++ db/migrate/20120115143126_set_default_repositories.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SetDefaultRepositories < ActiveRecord::Migration[4.2]
def self.up
Repository.update_all(["is_default = ?", false])
Index: db/migrate/20120127174243_add_custom_fields_multiple.rb
===================================================================
--- db/migrate/20120127174243_add_custom_fields_multiple.rb (revision 16900)
+++ db/migrate/20120127174243_add_custom_fields_multiple.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsMultiple < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :multiple, :boolean, :default => false
Index: db/migrate/20120205111326_change_users_login_limit.rb
===================================================================
--- db/migrate/20120205111326_change_users_login_limit.rb (revision 16900)
+++ db/migrate/20120205111326_change_users_login_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeUsersLoginLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :login, :string, :limit => nil, :default => '', :null => false
Index: db/migrate/20120223110929_change_attachments_container_defaults.rb
===================================================================
--- db/migrate/20120223110929_change_attachments_container_defaults.rb (revision 16900)
+++ db/migrate/20120223110929_change_attachments_container_defaults.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeAttachmentsContainerDefaults < ActiveRecord::Migration[4.2]
def self.up
# Need to drop the index otherwise the following error occurs in Rails 3.1.3:
Index: db/migrate/20120301153455_add_auth_sources_filter.rb
===================================================================
--- db/migrate/20120301153455_add_auth_sources_filter.rb (revision 16900)
+++ db/migrate/20120301153455_add_auth_sources_filter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddAuthSourcesFilter < ActiveRecord::Migration[4.2]
def self.up
add_column :auth_sources, :filter, :string
Index: db/migrate/20120422150750_change_repositories_to_full_sti.rb
===================================================================
--- db/migrate/20120422150750_change_repositories_to_full_sti.rb (revision 16900)
+++ db/migrate/20120422150750_change_repositories_to_full_sti.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeRepositoriesToFullSti < ActiveRecord::Migration[4.2]
def up
Repository.connection.
Index: db/migrate/20120705074331_add_trackers_fields_bits.rb
===================================================================
--- db/migrate/20120705074331_add_trackers_fields_bits.rb (revision 16900)
+++ db/migrate/20120705074331_add_trackers_fields_bits.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTrackersFieldsBits < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :fields_bits, :integer, :default => 0
Index: db/migrate/20120707064544_add_auth_sources_timeout.rb
===================================================================
--- db/migrate/20120707064544_add_auth_sources_timeout.rb (revision 16900)
+++ db/migrate/20120707064544_add_auth_sources_timeout.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddAuthSourcesTimeout < ActiveRecord::Migration[4.2]
def up
add_column :auth_sources, :timeout, :integer
Index: db/migrate/20120714122000_add_workflows_type.rb
===================================================================
--- db/migrate/20120714122000_add_workflows_type.rb (revision 16900)
+++ db/migrate/20120714122000_add_workflows_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWorkflowsType < ActiveRecord::Migration[4.2]
def up
add_column :workflows, :type, :string, :limit => 30
Index: db/migrate/20120714122100_update_workflows_to_sti.rb
===================================================================
--- db/migrate/20120714122100_update_workflows_to_sti.rb (revision 16900)
+++ db/migrate/20120714122100_update_workflows_to_sti.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class UpdateWorkflowsToSti < ActiveRecord::Migration[4.2]
def up
WorkflowRule.update_all "type = 'WorkflowTransition'"
Index: db/migrate/20120714122200_add_workflows_rule_fields.rb
===================================================================
--- db/migrate/20120714122200_add_workflows_rule_fields.rb (revision 16900)
+++ db/migrate/20120714122200_add_workflows_rule_fields.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWorkflowsRuleFields < ActiveRecord::Migration[4.2]
def up
add_column :workflows, :field_name, :string, :limit => 30
Index: db/migrate/20120731164049_add_boards_parent_id.rb
===================================================================
--- db/migrate/20120731164049_add_boards_parent_id.rb (revision 16900)
+++ db/migrate/20120731164049_add_boards_parent_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddBoardsParentId < ActiveRecord::Migration[4.2]
def up
add_column :boards, :parent_id, :integer
Index: db/migrate/20120930112914_add_journals_private_notes.rb
===================================================================
--- db/migrate/20120930112914_add_journals_private_notes.rb (revision 16900)
+++ db/migrate/20120930112914_add_journals_private_notes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddJournalsPrivateNotes < ActiveRecord::Migration[4.2]
def up
add_column :journals, :private_notes, :boolean, :default => false, :null => false
Index: db/migrate/20121026002032_add_enumerations_position_name.rb
===================================================================
--- db/migrate/20121026002032_add_enumerations_position_name.rb (revision 16900)
+++ db/migrate/20121026002032_add_enumerations_position_name.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddEnumerationsPositionName < ActiveRecord::Migration[4.2]
def up
add_column :enumerations, :position_name, :string, :limit => 30
Index: db/migrate/20121026003537_populate_enumerations_position_name.rb
===================================================================
--- db/migrate/20121026003537_populate_enumerations_position_name.rb (revision 16900)
+++ db/migrate/20121026003537_populate_enumerations_position_name.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateEnumerationsPositionName < ActiveRecord::Migration[4.2]
def up
IssuePriority.compute_position_names
Index: db/migrate/20121209123234_add_queries_type.rb
===================================================================
--- db/migrate/20121209123234_add_queries_type.rb (revision 16900)
+++ db/migrate/20121209123234_add_queries_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesType < ActiveRecord::Migration[4.2]
def up
add_column :queries, :type, :string
Index: db/migrate/20121209123358_update_queries_to_sti.rb
===================================================================
--- db/migrate/20121209123358_update_queries_to_sti.rb (revision 16900)
+++ db/migrate/20121209123358_update_queries_to_sti.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class UpdateQueriesToSti < ActiveRecord::Migration[4.2]
def up
::Query.update_all :type => 'IssueQuery'
Index: db/migrate/20121213084931_add_attachments_disk_directory.rb
===================================================================
--- db/migrate/20121213084931_add_attachments_disk_directory.rb (revision 16900)
+++ db/migrate/20121213084931_add_attachments_disk_directory.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddAttachmentsDiskDirectory < ActiveRecord::Migration[4.2]
def up
add_column :attachments, :disk_directory, :string
Index: db/migrate/20130110122628_split_documents_permissions.rb
===================================================================
--- db/migrate/20130110122628_split_documents_permissions.rb (revision 16900)
+++ db/migrate/20130110122628_split_documents_permissions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SplitDocumentsPermissions < ActiveRecord::Migration[4.2]
def up
# :manage_documents permission split into 3 permissions:
Index: db/migrate/20130201184705_add_unique_index_on_tokens_value.rb
===================================================================
--- db/migrate/20130201184705_add_unique_index_on_tokens_value.rb (revision 16900)
+++ db/migrate/20130201184705_add_unique_index_on_tokens_value.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexOnTokensValue < ActiveRecord::Migration[4.2]
def up
say_with_time "Adding unique index on tokens, this may take some time..." do
@@ -4,7 +5,7 @@
# Just in case
duplicates = Token.connection.select_values("SELECT value FROM #{Token.table_name} GROUP BY value HAVING COUNT(id) > 1")
Token.where(:value => duplicates).delete_all
-
+
add_index :tokens, :value, :unique => true, :name => 'tokens_value'
end
end
Index: db/migrate/20130202090625_add_projects_inherit_members.rb
===================================================================
--- db/migrate/20130202090625_add_projects_inherit_members.rb (revision 16900)
+++ db/migrate/20130202090625_add_projects_inherit_members.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectsInheritMembers < ActiveRecord::Migration[4.2]
def up
add_column :projects, :inherit_members, :boolean, :default => false, :null => false
Index: db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb
===================================================================
--- db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb (revision 16900)
+++ db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexOnCustomFieldsTrackers < ActiveRecord::Migration[4.2]
def up
table_name = "#{CustomField.table_name_prefix}custom_fields_trackers#{CustomField.table_name_suffix}"
Index: db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb
===================================================================
--- db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb (revision 16900)
+++ db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexOnCustomFieldsProjects < ActiveRecord::Migration[4.2]
def up
table_name = "#{CustomField.table_name_prefix}custom_fields_projects#{CustomField.table_name_suffix}"
Index: db/migrate/20130215073721_change_users_lastname_length_to_255.rb
===================================================================
--- db/migrate/20130215073721_change_users_lastname_length_to_255.rb (revision 16900)
+++ db/migrate/20130215073721_change_users_lastname_length_to_255.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeUsersLastnameLengthTo255 < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :lastname, :string, :limit => 255, :default => '', :null => false
Index: db/migrate/20130215111127_add_issues_closed_on.rb
===================================================================
--- db/migrate/20130215111127_add_issues_closed_on.rb (revision 16900)
+++ db/migrate/20130215111127_add_issues_closed_on.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIssuesClosedOn < ActiveRecord::Migration[4.2]
def up
add_column :issues, :closed_on, :datetime, :default => nil
Index: db/migrate/20130215111141_populate_issues_closed_on.rb
===================================================================
--- db/migrate/20130215111141_populate_issues_closed_on.rb (revision 16900)
+++ db/migrate/20130215111141_populate_issues_closed_on.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateIssuesClosedOn < ActiveRecord::Migration[4.2]
def up
closed_status_ids = IssueStatus.where(:is_closed => true).pluck(:id)
Index: db/migrate/20130217094251_remove_issues_default_fk_values.rb
===================================================================
--- db/migrate/20130217094251_remove_issues_default_fk_values.rb (revision 16900)
+++ db/migrate/20130217094251_remove_issues_default_fk_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveIssuesDefaultFkValues < ActiveRecord::Migration[4.2]
def up
change_column_default :issues, :tracker_id, nil
Index: db/migrate/20130602092539_create_queries_roles.rb
===================================================================
--- db/migrate/20130602092539_create_queries_roles.rb (revision 16900)
+++ db/migrate/20130602092539_create_queries_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateQueriesRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :queries_roles, :id => false do |t|
Index: db/migrate/20130710182539_add_queries_visibility.rb
===================================================================
--- db/migrate/20130710182539_add_queries_visibility.rb (revision 16900)
+++ db/migrate/20130710182539_add_queries_visibility.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesVisibility < ActiveRecord::Migration[4.2]
def up
add_column :queries, :visibility, :integer, :default => 0
Index: db/migrate/20130713104233_create_custom_fields_roles.rb
===================================================================
--- db/migrate/20130713104233_create_custom_fields_roles.rb (revision 16900)
+++ db/migrate/20130713104233_create_custom_fields_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateCustomFieldsRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :custom_fields_roles, :id => false do |t|
Index: db/migrate/20130713111657_add_queries_options.rb
===================================================================
--- db/migrate/20130713111657_add_queries_options.rb (revision 16900)
+++ db/migrate/20130713111657_add_queries_options.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddQueriesOptions < ActiveRecord::Migration[4.2]
def up
add_column :queries, :options, :text
Index: db/migrate/20130729070143_add_users_must_change_passwd.rb
===================================================================
--- db/migrate/20130729070143_add_users_must_change_passwd.rb (revision 16900)
+++ db/migrate/20130729070143_add_users_must_change_passwd.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUsersMustChangePasswd < ActiveRecord::Migration[4.2]
def up
add_column :users, :must_change_passwd, :boolean, :default => false, :null => false
Index: db/migrate/20130911193200_remove_eols_from_attachments_filename.rb
===================================================================
--- db/migrate/20130911193200_remove_eols_from_attachments_filename.rb (revision 16900)
+++ db/migrate/20130911193200_remove_eols_from_attachments_filename.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveEolsFromAttachmentsFilename < ActiveRecord::Migration[4.2]
def up
Attachment.where("filename like ? or filename like ?", "%\r%", "%\n%").each do |attachment|
Index: db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
===================================================================
--- db/migrate/20131004113137_support_for_multiple_commit_keywords.rb (revision 16900)
+++ db/migrate/20131004113137_support_for_multiple_commit_keywords.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class SupportForMultipleCommitKeywords < ActiveRecord::Migration[4.2]
def up
# Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings
Index: db/migrate/20131005100610_add_repositories_created_on.rb
===================================================================
--- db/migrate/20131005100610_add_repositories_created_on.rb (revision 16900)
+++ db/migrate/20131005100610_add_repositories_created_on.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRepositoriesCreatedOn < ActiveRecord::Migration[4.2]
def up
add_column :repositories, :created_on, :timestamp
Index: db/migrate/20131124175346_add_custom_fields_format_store.rb
===================================================================
--- db/migrate/20131124175346_add_custom_fields_format_store.rb (revision 16900)
+++ db/migrate/20131124175346_add_custom_fields_format_store.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsFormatStore < ActiveRecord::Migration[4.2]
def up
add_column :custom_fields, :format_store, :text
Index: db/migrate/20131210180802_add_custom_fields_description.rb
===================================================================
--- db/migrate/20131210180802_add_custom_fields_description.rb (revision 16900)
+++ db/migrate/20131210180802_add_custom_fields_description.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddCustomFieldsDescription < ActiveRecord::Migration[4.2]
def up
add_column :custom_fields, :description, :text
Index: db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb
===================================================================
--- db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb (revision 16900)
+++ db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveCustomFieldsMinMaxLengthDefaultValues < ActiveRecord::Migration[4.2]
def up
change_column :custom_fields, :min_length, :int, :default => nil, :null => true
Index: db/migrate/20131215104612_store_relation_type_in_journal_details.rb
===================================================================
--- db/migrate/20131215104612_store_relation_type_in_journal_details.rb (revision 16900)
+++ db/migrate/20131215104612_store_relation_type_in_journal_details.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class StoreRelationTypeInJournalDetails < ActiveRecord::Migration[4.2]
MAPPING = {
Index: db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb
===================================================================
--- db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb (revision 16900)
+++ db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class DeleteOrphanTimeEntriesCustomValues < ActiveRecord::Migration[4.2]
def up
CustomValue.where("customized_type = ? AND NOT EXISTS (SELECT 1 FROM #{TimeEntry.table_name} t WHERE t.id = customized_id)", "TimeEntry").delete_all
Index: db/migrate/20140228130325_change_changesets_comments_limit.rb
===================================================================
--- db/migrate/20140228130325_change_changesets_comments_limit.rb (revision 16900)
+++ db/migrate/20140228130325_change_changesets_comments_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeChangesetsCommentsLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
Index: db/migrate/20140903143914_add_password_changed_at_to_user.rb
===================================================================
--- db/migrate/20140903143914_add_password_changed_at_to_user.rb (revision 16900)
+++ db/migrate/20140903143914_add_password_changed_at_to_user.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddPasswordChangedAtToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :passwd_changed_on, :datetime
Index: db/migrate/20140920094058_insert_builtin_groups.rb
===================================================================
--- db/migrate/20140920094058_insert_builtin_groups.rb (revision 16900)
+++ db/migrate/20140920094058_insert_builtin_groups.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class InsertBuiltinGroups < ActiveRecord::Migration[4.2]
def up
Group.reset_column_information
Index: db/migrate/20141029181752_add_trackers_default_status_id.rb
===================================================================
--- db/migrate/20141029181752_add_trackers_default_status_id.rb (revision 16900)
+++ db/migrate/20141029181752_add_trackers_default_status_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTrackersDefaultStatusId < ActiveRecord::Migration[4.2]
def up
add_column :trackers, :default_status_id, :integer
Index: db/migrate/20141029181824_remove_issue_statuses_is_default.rb
===================================================================
--- db/migrate/20141029181824_remove_issue_statuses_is_default.rb (revision 16900)
+++ db/migrate/20141029181824_remove_issue_statuses_is_default.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveIssueStatusesIsDefault < ActiveRecord::Migration[4.2]
def up
remove_column :issue_statuses, :is_default
Index: db/migrate/20141109112308_add_roles_users_visibility.rb
===================================================================
--- db/migrate/20141109112308_add_roles_users_visibility.rb (revision 16900)
+++ db/migrate/20141109112308_add_roles_users_visibility.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesUsersVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :users_visibility, :string, :limit => 30, :default => 'all', :null => false
Index: db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb
===================================================================
--- db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb (revision 16900)
+++ db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddWikiRedirectsRedirectsToWikiId < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_redirects, :redirects_to_wiki_id, :integer
Index: db/migrate/20150113194759_create_email_addresses.rb
===================================================================
--- db/migrate/20150113194759_create_email_addresses.rb (revision 16900)
+++ db/migrate/20150113194759_create_email_addresses.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateEmailAddresses < ActiveRecord::Migration[4.2]
def change
create_table :email_addresses do |t|
Index: db/migrate/20150113211532_populate_email_addresses.rb
===================================================================
--- db/migrate/20150113211532_populate_email_addresses.rb (revision 16900)
+++ db/migrate/20150113211532_populate_email_addresses.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class PopulateEmailAddresses < ActiveRecord::Migration[4.2]
def self.up
t = EmailAddress.connection.quoted_true
Index: db/migrate/20150113213922_remove_users_mail.rb
===================================================================
--- db/migrate/20150113213922_remove_users_mail.rb (revision 16900)
+++ db/migrate/20150113213922_remove_users_mail.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemoveUsersMail < ActiveRecord::Migration[4.2]
def self.up
remove_column :users, :mail
Index: db/migrate/20150113213955_add_email_addresses_user_id_index.rb
===================================================================
--- db/migrate/20150113213955_add_email_addresses_user_id_index.rb (revision 16900)
+++ db/migrate/20150113213955_add_email_addresses_user_id_index.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddEmailAddressesUserIdIndex < ActiveRecord::Migration[4.2]
def up
add_index :email_addresses, :user_id
Index: db/migrate/20150208105930_replace_move_issues_permission.rb
===================================================================
--- db/migrate/20150208105930_replace_move_issues_permission.rb (revision 16900)
+++ db/migrate/20150208105930_replace_move_issues_permission.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ReplaceMoveIssuesPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |role|
Index: db/migrate/20150510083747_change_documents_title_limit.rb
===================================================================
--- db/migrate/20150510083747_change_documents_title_limit.rb (revision 16900)
+++ db/migrate/20150510083747_change_documents_title_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeDocumentsTitleLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :documents, :title, :string, :limit => nil, :default => '', :null => false
Index: db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb
===================================================================
--- db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb (revision 16900)
+++ db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ClearEstimatedHoursOnParentIssues < ActiveRecord::Migration[4.2]
def self.up
# Clears estimated hours on parent issues
Index: db/migrate/20150526183158_add_roles_time_entries_visibility.rb
===================================================================
--- db/migrate/20150526183158_add_roles_time_entries_visibility.rb (revision 16900)
+++ db/migrate/20150526183158_add_roles_time_entries_visibility.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesTimeEntriesVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :time_entries_visibility, :string, :limit => 30, :default => 'all', :null => false
Index: db/migrate/20150528084820_add_roles_all_roles_managed.rb
===================================================================
--- db/migrate/20150528084820_add_roles_all_roles_managed.rb (revision 16900)
+++ db/migrate/20150528084820_add_roles_all_roles_managed.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesAllRolesManaged < ActiveRecord::Migration[4.2]
def change
add_column :roles, :all_roles_managed, :boolean, :default => true, :null => false
Index: db/migrate/20150528092912_create_roles_managed_roles.rb
===================================================================
--- db/migrate/20150528092912_create_roles_managed_roles.rb (revision 16900)
+++ db/migrate/20150528092912_create_roles_managed_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateRolesManagedRoles < ActiveRecord::Migration[4.2]
def change
create_table :roles_managed_roles, :id => false do |t|
Index: db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb
===================================================================
--- db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb (revision 16900)
+++ db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddUniqueIndexOnRolesManagedRoles < ActiveRecord::Migration[4.2]
def change
add_index :roles_managed_roles, [:role_id, :managed_role_id], :unique => true
Index: db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb
===================================================================
--- db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb (revision 16900)
+++ db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class InsertAllowedStatusesForNewIssues < ActiveRecord::Migration[4.2]
def self.up
# Adds the default status for all trackers and roles
Index: db/migrate/20150730122707_create_imports.rb
===================================================================
--- db/migrate/20150730122707_create_imports.rb (revision 16900)
+++ db/migrate/20150730122707_create_imports.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateImports < ActiveRecord::Migration[4.2]
def change
create_table :imports do |t|
Index: db/migrate/20150730122735_create_import_items.rb
===================================================================
--- db/migrate/20150730122735_create_import_items.rb (revision 16900)
+++ db/migrate/20150730122735_create_import_items.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateImportItems < ActiveRecord::Migration[4.2]
def change
create_table :import_items do |t|
Index: db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb
===================================================================
--- db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb (revision 16900)
+++ db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeTimeEntriesCommentsLimitTo1024 < ActiveRecord::Migration[4.2]
def self.up
change_column :time_entries, :comments, :string, :limit => 1024
Index: db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb
===================================================================
--- db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb (revision 16900)
+++ db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeWikiContentsCommentsLimitTo1024 < ActiveRecord::Migration[4.2]
def self.up
change_column :wiki_content_versions, :comments, :string, :limit => 1024, :default => ''
Index: db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb
===================================================================
--- db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb (revision 16900)
+++ db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb (working copy)
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
class ChangeAttachmentsFilesizeLimitTo8 < ActiveRecord::Migration[4.2]
- def self.up
+ def self.up
change_column :attachments, :filesize, :integer, :limit => 8, :default => 0, :null => false
end
Index: db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb
===================================================================
--- db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb (revision 16900)
+++ db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb (working copy)
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
class FixCommaInUserFormatSettingValue < ActiveRecord::Migration[4.2]
- def self.up
+ def self.up
Setting.
where(:name => 'user_format', :value => 'lastname_coma_firstname').
update_all(:value => 'lastname_comma_firstname')
Index: db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb
===================================================================
--- db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb (revision 16900)
+++ db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb (working copy)
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration[4.2]
- def self.up
+ def self.up
change_column :issue_categories, :name, :string, :limit => 60, :default => "", :null => false
end
Index: db/migrate/20151021185456_change_auth_sources_filter_to_text.rb
===================================================================
--- db/migrate/20151021185456_change_auth_sources_filter_to_text.rb (revision 16900)
+++ db/migrate/20151021185456_change_auth_sources_filter_to_text.rb (working copy)
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
class ChangeAuthSourcesFilterToText < ActiveRecord::Migration[4.2]
- def self.up
+ def self.up
change_column :auth_sources, :filter, :text
end
Index: db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb
===================================================================
--- db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb (revision 16900)
+++ db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeUserPreferencesHideMailDefaultToTrue < ActiveRecord::Migration[4.2]
def self.up
change_column :user_preferences, :hide_mail, :boolean, :default => true
Index: db/migrate/20151024082034_add_tokens_updated_on.rb
===================================================================
--- db/migrate/20151024082034_add_tokens_updated_on.rb (revision 16900)
+++ db/migrate/20151024082034_add_tokens_updated_on.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTokensUpdatedOn < ActiveRecord::Migration[4.2]
def self.up
add_column :tokens, :updated_on, :timestamp
Index: db/migrate/20151025072118_create_custom_field_enumerations.rb
===================================================================
--- db/migrate/20151025072118_create_custom_field_enumerations.rb (revision 16900)
+++ db/migrate/20151025072118_create_custom_field_enumerations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class CreateCustomFieldEnumerations < ActiveRecord::Migration[4.2]
def change
create_table :custom_field_enumerations do |t|
Index: db/migrate/20151031095005_add_projects_default_version_id.rb
===================================================================
--- db/migrate/20151031095005_add_projects_default_version_id.rb (revision 16900)
+++ db/migrate/20151031095005_add_projects_default_version_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectsDefaultVersionId < ActiveRecord::Migration[4.2]
def self.up
# Don't try to add the column if redmine_default_version plugin was used
Index: db/migrate/20160404080304_force_password_reset_during_setup.rb
===================================================================
--- db/migrate/20160404080304_force_password_reset_during_setup.rb (revision 16900)
+++ db/migrate/20160404080304_force_password_reset_during_setup.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ForcePasswordResetDuringSetup < ActiveRecord::Migration[4.2]
def up
User.where(login: "admin", last_login_on: nil).update_all(must_change_passwd: true)
Index: db/migrate/20160416072926_remove_position_defaults.rb
===================================================================
--- db/migrate/20160416072926_remove_position_defaults.rb (revision 16900)
+++ db/migrate/20160416072926_remove_position_defaults.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RemovePositionDefaults < ActiveRecord::Migration[4.2]
def up
[Board, CustomField, Enumeration, IssueStatus, Role, Tracker].each do |klass|
Index: db/migrate/20160529063352_add_roles_settings.rb
===================================================================
--- db/migrate/20160529063352_add_roles_settings.rb (revision 16900)
+++ db/migrate/20160529063352_add_roles_settings.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddRolesSettings < ActiveRecord::Migration[4.2]
def change
add_column :roles, :settings, :text
Index: db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb
===================================================================
--- db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb (revision 16900)
+++ db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddTrackerIdIndexToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, :tracker_id
Index: db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb
===================================================================
--- db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb (revision 16900)
+++ db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnMemberRolesInheritedFrom < ActiveRecord::Migration[4.2]
def change
add_index :member_roles, :inherited_from
Index: db/migrate/20161010081301_change_issues_description_limit.rb
===================================================================
--- db/migrate/20161010081301_change_issues_description_limit.rb (revision 16900)
+++ db/migrate/20161010081301_change_issues_description_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeIssuesDescriptionLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
Index: db/migrate/20161010081528_change_journal_details_value_limit.rb
===================================================================
--- db/migrate/20161010081528_change_journal_details_value_limit.rb (revision 16900)
+++ db/migrate/20161010081528_change_journal_details_value_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeJournalDetailsValueLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
Index: db/migrate/20161010081600_change_journals_notes_limit.rb
===================================================================
--- db/migrate/20161010081600_change_journals_notes_limit.rb (revision 16900)
+++ db/migrate/20161010081600_change_journals_notes_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeJournalsNotesLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
Index: db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb
===================================================================
--- db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb (revision 16900)
+++ db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnChangesetsIssuesIssueId < ActiveRecord::Migration[4.2]
def change
add_index :changesets_issues, :issue_id
Index: db/migrate/20161220091118_add_index_on_issues_parent_id.rb
===================================================================
--- db/migrate/20161220091118_add_index_on_issues_parent_id.rb (revision 16900)
+++ db/migrate/20161220091118_add_index_on_issues_parent_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnIssuesParentId < ActiveRecord::Migration[4.2]
def change
add_index :issues, :parent_id
Index: db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb
===================================================================
--- db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb (revision 16900)
+++ db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddIndexOnDiskFilenameToAttachments < ActiveRecord::Migration[4.2]
def change
add_index :attachments, :disk_filename
Index: db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb
===================================================================
--- db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb (revision 16900)
+++ db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeAttachmentsDigestLimitTo64 < ActiveRecord::Migration[4.2]
def up
change_column :attachments, :digest, :string, limit: 64
Index: db/migrate/20170309214320_add_project_default_assigned_to_id.rb
===================================================================
--- db/migrate/20170309214320_add_project_default_assigned_to_id.rb (revision 16900)
+++ db/migrate/20170309214320_add_project_default_assigned_to_id.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddProjectDefaultAssignedToId < ActiveRecord::Migration[4.2]
def up
add_column :projects, :default_assigned_to_id, :integer, :default => nil
Index: db/migrate/20170320051650_change_repositories_extra_info_limit.rb
===================================================================
--- db/migrate/20170320051650_change_repositories_extra_info_limit.rb (revision 16900)
+++ db/migrate/20170320051650_change_repositories_extra_info_limit.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class ChangeRepositoriesExtraInfoLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
Index: db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
===================================================================
--- db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb (revision 16900)
+++ db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddViewNewsToAllExistingRoles < ActiveRecord::Migration[4.2]
def up
Role.all.each { |role| role.add_permission! :view_news }
Index: db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
===================================================================
--- db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb (revision 16900)
+++ db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class AddViewMessagesToAllExistingRoles < ActiveRecord::Migration[4.2]
def up
Role.all.each { |role| role.add_permission! :view_messages }
Index: db/migrate/20170723112801_rename_comments_to_content.rb
===================================================================
--- db/migrate/20170723112801_rename_comments_to_content.rb (revision 16900)
+++ db/migrate/20170723112801_rename_comments_to_content.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
class RenameCommentsToContent < ActiveRecord::Migration[5.1]
def change
rename_column :comments, :comments, :content
Index: lib/diff.rb
===================================================================
--- lib/diff.rb (revision 16900)
+++ lib/diff.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module RedmineDiff
class Diff
Index: lib/plugins/acts_as_activity_provider/init.rb
===================================================================
--- lib/plugins/acts_as_activity_provider/init.rb (revision 16900)
+++ lib/plugins/acts_as_activity_provider/init.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/lib/acts_as_activity_provider'
ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
Index: lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
===================================================================
--- lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb (revision 16900)
+++ lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/plugins/acts_as_attachable/init.rb
===================================================================
--- lib/plugins/acts_as_attachable/init.rb (revision 16900)
+++ lib/plugins/acts_as_attachable/init.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/lib/acts_as_attachable'
ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
Index: lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
===================================================================
--- lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb (revision 16900)
+++ lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/plugins/acts_as_customizable/init.rb
===================================================================
--- lib/plugins/acts_as_customizable/init.rb (revision 16900)
+++ lib/plugins/acts_as_customizable/init.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/lib/acts_as_customizable'
ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
Index: lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
===================================================================
--- lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb (revision 16900)
+++ lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/plugins/acts_as_event/init.rb
===================================================================
--- lib/plugins/acts_as_event/init.rb (revision 16900)
+++ lib/plugins/acts_as_event/init.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/lib/acts_as_event'
ActiveRecord::Base.send(:include, Redmine::Acts::Event)
Index: lib/plugins/acts_as_event/lib/acts_as_event.rb
===================================================================
--- lib/plugins/acts_as_event/lib/acts_as_event.rb (revision 16900)
+++ lib/plugins/acts_as_event/lib/acts_as_event.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/plugins/acts_as_searchable/init.rb
===================================================================
--- lib/plugins/acts_as_searchable/init.rb (revision 16900)
+++ lib/plugins/acts_as_searchable/init.rb (working copy)
@@ -1,2 +1,3 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/lib/acts_as_searchable'
ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
Index: lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
===================================================================
--- lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb (revision 16900)
+++ lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/plugins/acts_as_tree/init.rb
===================================================================
--- lib/plugins/acts_as_tree/init.rb (revision 16900)
+++ lib/plugins/acts_as_tree/init.rb (working copy)
@@ -1 +1,2 @@
+# frozen_string_literal: true
ActiveRecord::Base.send :include, ActiveRecord::Acts::Tree
Index: lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb
===================================================================
--- lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb (revision 16900)
+++ lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module ActiveRecord
module Acts
module Tree
Index: lib/plugins/acts_as_tree/test/acts_as_tree_test.rb
===================================================================
--- lib/plugins/acts_as_tree/test/acts_as_tree_test.rb (revision 16900)
+++ lib/plugins/acts_as_tree/test/acts_as_tree_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require 'test/unit'
require 'rubygems'
@@ -170,7 +171,7 @@
def teardown
teardown_db
end
-
+
def test_eager_association_loading
roots = TreeMixin.find(:all, :include => :children, :conditions => "mixins.parent_id IS NULL", :order => "mixins.id")
assert_equal [@root1, @root2, @root3], roots
Index: lib/plugins/acts_as_watchable/init.rb
===================================================================
--- lib/plugins/acts_as_watchable/init.rb (revision 16900)
+++ lib/plugins/acts_as_watchable/init.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Include hook code here
require File.dirname(__FILE__) + '/lib/acts_as_watchable'
ActiveRecord::Base.send(:include, Redmine::Acts::Watchable)
Index: lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
===================================================================
--- lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb (revision 16900)
+++ lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# ActsAsWatchable
module Redmine
module Acts
Index: lib/plugins/gravatar/init.rb
===================================================================
--- lib/plugins/gravatar/init.rb (revision 16900)
+++ lib/plugins/gravatar/init.rb (working copy)
@@ -1,2 +1,3 @@
-require 'gravatar'
-ActionView::Base.send :include, GravatarHelper::PublicMethods
+# frozen_string_literal: true
+require 'gravatar'
+ActionView::Base.send :include, GravatarHelper::PublicMethods
Index: lib/plugins/gravatar/lib/gravatar.rb
===================================================================
--- lib/plugins/gravatar/lib/gravatar.rb (revision 16900)
+++ lib/plugins/gravatar/lib/gravatar.rb (working copy)
@@ -1,86 +1,87 @@
-require 'digest/md5'
-require 'cgi'
-
-module GravatarHelper
-
- # These are the options that control the default behavior of the public
- # methods. They can be overridden during the actual call to the helper,
- # or you can set them in your environment.rb as such:
- #
- # # Allow racier gravatars
- # GravatarHelper::DEFAULT_OPTIONS[:rating] = 'R'
- #
- DEFAULT_OPTIONS = {
- # The URL of a default image to display if the given email address does
- # not have a gravatar.
- :default => nil,
-
- # The default size in pixels for the gravatar image (they're square).
- :size => 50,
-
- # The maximum allowed MPAA rating for gravatars. This allows you to
- # exclude gravatars that may be out of character for your site.
- :rating => 'PG',
-
- # The alt text to use in the img tag for the gravatar. Since it's a
- # decorational picture, the alt text should be empty according to the
- # XHTML specs.
- :alt => '',
-
- # The title text to use for the img tag for the gravatar.
- :title => '',
-
- # The class to assign to the img tag for the gravatar.
- :class => 'gravatar',
-
- # Whether or not to display the gravatars using HTTPS instead of HTTP
- :ssl => false,
- }
-
- # The methods that will be made available to your views.
- module PublicMethods
-
- # Return the HTML img tag for the given user's gravatar. Presumes that
- # the given user object will respond_to "email", and return the user's
- # email address.
- def gravatar_for(user, options={})
- gravatar(user.email, options)
- end
-
- # Return the HTML img tag for the given email address's gravatar.
- def gravatar(email, options={})
- src = h(gravatar_url(email, options))
- options = DEFAULT_OPTIONS.merge(options)
- [:class, :alt, :title].each { |opt| options[opt] = h(options[opt]) }
-
- # double the size for hires displays
- options[:srcset] = "#{gravatar_url(email, options.merge(size: options[:size].to_i * 2))} 2x"
-
- image_tag src, options.except(:rating, :size, :default, :ssl)
- end
-
- # Returns the base Gravatar URL for the given email hash
- def gravatar_api_url(hash)
- "//www.gravatar.com/avatar/#{hash}"
- end
-
- # Return the gravatar URL for the given email address.
- def gravatar_url(email, options={})
- email_hash = Digest::MD5.hexdigest(email)
- options = DEFAULT_OPTIONS.merge(options)
- options[:default] = CGI::escape(options[:default]) unless options[:default].nil?
- gravatar_api_url(email_hash).tap do |url|
- opts = []
- [:rating, :size, :default].each do |opt|
- unless options[opt].nil?
- value = h(options[opt])
- opts << [opt, value].join('=')
- end
- end
- url << "?#{opts.join('&')}" unless opts.empty?
- end
- end
-
- end
-
-end
+# frozen_string_literal: true
+require 'digest/md5'
+require 'cgi'
+
+module GravatarHelper
+
+ # These are the options that control the default behavior of the public
+ # methods. They can be overridden during the actual call to the helper,
+ # or you can set them in your environment.rb as such:
+ #
+ # # Allow racier gravatars
+ # GravatarHelper::DEFAULT_OPTIONS[:rating] = 'R'
+ #
+ DEFAULT_OPTIONS = {
+ # The URL of a default image to display if the given email address does
+ # not have a gravatar.
+ :default => nil,
+
+ # The default size in pixels for the gravatar image (they're square).
+ :size => 50,
+
+ # The maximum allowed MPAA rating for gravatars. This allows you to
+ # exclude gravatars that may be out of character for your site.
+ :rating => 'PG',
+
+ # The alt text to use in the img tag for the gravatar. Since it's a
+ # decorational picture, the alt text should be empty according to the
+ # XHTML specs.
+ :alt => '',
+
+ # The title text to use for the img tag for the gravatar.
+ :title => '',
+
+ # The class to assign to the img tag for the gravatar.
+ :class => 'gravatar',
+
+ # Whether or not to display the gravatars using HTTPS instead of HTTP
+ :ssl => false,
+ }
+
+ # The methods that will be made available to your views.
+ module PublicMethods
+
+ # Return the HTML img tag for the given user's gravatar. Presumes that
+ # the given user object will respond_to "email", and return the user's
+ # email address.
+ def gravatar_for(user, options={})
+ gravatar(user.email, options)
+ end
+
+ # Return the HTML img tag for the given email address's gravatar.
+ def gravatar(email, options={})
+ src = h(gravatar_url(email, options))
+ options = DEFAULT_OPTIONS.merge(options)
+ [:class, :alt, :title].each { |opt| options[opt] = h(options[opt]) }
+
+ # double the size for hires displays
+ options[:srcset] = "#{gravatar_url(email, options.merge(size: options[:size].to_i * 2))} 2x"
+
+ image_tag src, options.except(:rating, :size, :default, :ssl)
+ end
+
+ # Returns the base Gravatar URL for the given email hash
+ def gravatar_api_url(hash)
+ "//www.gravatar.com/avatar/#{hash}"
+ end
+
+ # Return the gravatar URL for the given email address.
+ def gravatar_url(email, options={})
+ email_hash = Digest::MD5.hexdigest(email)
+ options = DEFAULT_OPTIONS.merge(options)
+ options[:default] = CGI::escape(options[:default]) unless options[:default].nil?
+ gravatar_api_url(email_hash).dup.tap do |url|
+ opts = []
+ [:rating, :size, :default].each do |opt|
+ unless options[opt].nil?
+ value = h(options[opt])
+ opts << [opt, value].join('=')
+ end
+ end
+ url << "?#{opts.join('&')}" unless opts.empty?
+ end
+ end
+
+ end
+
+end
Index: lib/plugins/gravatar/spec/gravatar_spec.rb
===================================================================
--- lib/plugins/gravatar/spec/gravatar_spec.rb (revision 16900)
+++ lib/plugins/gravatar/spec/gravatar_spec.rb (working copy)
@@ -1,43 +1,44 @@
-require 'rubygems'
-require 'erb' # to get "h"
-require 'active_support' # to get "returning"
-require File.dirname(__FILE__) + '/../lib/gravatar'
-include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util
-
-describe "gravatar_url with a custom default URL" do
- before(:each) do
- @original_options = DEFAULT_OPTIONS.dup
- DEFAULT_OPTIONS[:default] = "no_avatar.png"
- @url = gravatar_url("somewhere")
- end
-
- it "should include the \"default\" argument in the result" do
- @url.should match(/&default=no_avatar.png/)
- end
-
- after(:each) do
- DEFAULT_OPTIONS.merge!(@original_options)
- end
-
-end
-
-describe "gravatar_url with default settings" do
- before(:each) do
- @url = gravatar_url("somewhere")
- end
-
- it "should have a nil default URL" do
- DEFAULT_OPTIONS[:default].should be_nil
- end
-
- it "should not include the \"default\" argument in the result" do
- @url.should_not match(/&default=/)
- end
-
-end
-
-describe "gravatar with a custom title option" do
- it "should include the title in the result" do
- gravatar('example@example.com', :title => "This is a title attribute").should match(/This is a title attribute/)
- end
-end
+# frozen_string_literal: true
+require 'rubygems'
+require 'erb' # to get "h"
+require 'active_support' # to get "returning"
+require File.dirname(__FILE__) + '/../lib/gravatar'
+include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util
+
+describe "gravatar_url with a custom default URL" do
+ before(:each) do
+ @original_options = DEFAULT_OPTIONS.dup
+ DEFAULT_OPTIONS[:default] = "no_avatar.png"
+ @url = gravatar_url("somewhere")
+ end
+
+ it "should include the \"default\" argument in the result" do
+ @url.should match(/&default=no_avatar.png/)
+ end
+
+ after(:each) do
+ DEFAULT_OPTIONS.merge!(@original_options)
+ end
+
+end
+
+describe "gravatar_url with default settings" do
+ before(:each) do
+ @url = gravatar_url("somewhere")
+ end
+
+ it "should have a nil default URL" do
+ DEFAULT_OPTIONS[:default].should be_nil
+ end
+
+ it "should not include the \"default\" argument in the result" do
+ @url.should_not match(/&default=/)
+ end
+
+end
+
+describe "gravatar with a custom title option" do
+ it "should include the title in the result" do
+ gravatar('example@example.com', :title => "This is a title attribute").should match(/This is a title attribute/)
+ end
+end
Index: lib/plugins/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb
===================================================================
--- lib/plugins/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb (revision 16900)
+++ lib/plugins/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb (working copy)
@@ -1,11 +1,11 @@
-class OpenIdAuthenticationTablesGenerator < Rails::Generator::NamedBase
- def initialize(runtime_args, runtime_options = {})
- super
- end
-
- def manifest
- record do |m|
- m.migration_template 'migration.rb', 'db/migrate'
- end
- end
-end
+class OpenIdAuthenticationTablesGenerator < Rails::Generator::NamedBase
+ def initialize(runtime_args, runtime_options = {})
+ super
+ end
+
+ def manifest
+ record do |m|
+ m.migration_template 'migration.rb', 'db/migrate'
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb
===================================================================
--- lib/plugins/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb (revision 16900)
+++ lib/plugins/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb (working copy)
@@ -1,20 +1,20 @@
-class <%= class_name %> < ActiveRecord::Migration
- def self.up
- create_table :open_id_authentication_associations, :force => true do |t|
- t.integer :issued, :lifetime
- t.string :handle, :assoc_type
- t.binary :server_url, :secret
- end
-
- create_table :open_id_authentication_nonces, :force => true do |t|
- t.integer :timestamp, :null => false
- t.string :server_url, :null => true
- t.string :salt, :null => false
- end
- end
-
- def self.down
- drop_table :open_id_authentication_associations
- drop_table :open_id_authentication_nonces
- end
-end
+class <%= class_name %> < ActiveRecord::Migration
+ def self.up
+ create_table :open_id_authentication_associations, :force => true do |t|
+ t.integer :issued, :lifetime
+ t.string :handle, :assoc_type
+ t.binary :server_url, :secret
+ end
+
+ create_table :open_id_authentication_nonces, :force => true do |t|
+ t.integer :timestamp, :null => false
+ t.string :server_url, :null => true
+ t.string :salt, :null => false
+ end
+ end
+
+ def self.down
+ drop_table :open_id_authentication_associations
+ drop_table :open_id_authentication_nonces
+ end
+end
Index: lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb
===================================================================
--- lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb (revision 16900)
+++ lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb (working copy)
@@ -1,26 +1,26 @@
-class <%= class_name %> < ActiveRecord::Migration
- def self.up
- drop_table :open_id_authentication_settings
- drop_table :open_id_authentication_nonces
-
- create_table :open_id_authentication_nonces, :force => true do |t|
- t.integer :timestamp, :null => false
- t.string :server_url, :null => true
- t.string :salt, :null => false
- end
- end
-
- def self.down
- drop_table :open_id_authentication_nonces
-
- create_table :open_id_authentication_nonces, :force => true do |t|
- t.integer :created
- t.string :nonce
- end
-
- create_table :open_id_authentication_settings, :force => true do |t|
- t.string :setting
- t.binary :value
- end
- end
-end
+class <%= class_name %> < ActiveRecord::Migration
+ def self.up
+ drop_table :open_id_authentication_settings
+ drop_table :open_id_authentication_nonces
+
+ create_table :open_id_authentication_nonces, :force => true do |t|
+ t.integer :timestamp, :null => false
+ t.string :server_url, :null => true
+ t.string :salt, :null => false
+ end
+ end
+
+ def self.down
+ drop_table :open_id_authentication_nonces
+
+ create_table :open_id_authentication_nonces, :force => true do |t|
+ t.integer :created
+ t.string :nonce
+ end
+
+ create_table :open_id_authentication_settings, :force => true do |t|
+ t.string :setting
+ t.binary :value
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb
===================================================================
--- lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb (revision 16900)
+++ lib/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb (working copy)
@@ -1,11 +1,11 @@
-class UpgradeOpenIdAuthenticationTablesGenerator < Rails::Generator::NamedBase
- def initialize(runtime_args, runtime_options = {})
- super
- end
-
- def manifest
- record do |m|
- m.migration_template 'migration.rb', 'db/migrate'
- end
- end
-end
+class UpgradeOpenIdAuthenticationTablesGenerator < Rails::Generator::NamedBase
+ def initialize(runtime_args, runtime_options = {})
+ super
+ end
+
+ def manifest
+ record do |m|
+ m.migration_template 'migration.rb', 'db/migrate'
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/init.rb
===================================================================
--- lib/plugins/open_id_authentication/init.rb (revision 16900)
+++ lib/plugins/open_id_authentication/init.rb (working copy)
@@ -1,12 +1,13 @@
-if Rails.version < '3'
- config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1'
-end
-
-require 'open_id_authentication'
-
-config.middleware.use OpenIdAuthentication
-
-config.after_initialize do
- OpenID::Util.logger = Rails.logger
- ActionController::Base.send :include, OpenIdAuthentication
-end
+# frozen_string_literal: true
+if Rails.version < '3'
+ config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1'
+end
+
+require 'open_id_authentication'
+
+config.middleware.use OpenIdAuthentication
+
+config.after_initialize do
+ OpenID::Util.logger = Rails.logger
+ ActionController::Base.send :include, OpenIdAuthentication
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication.rb (working copy)
@@ -1,159 +1,160 @@
-require 'uri'
-require 'openid'
-require 'rack/openid'
-
-module OpenIdAuthentication
- def self.new(app)
- store = OpenIdAuthentication.store
- if store.nil?
- Rails.logger.warn "OpenIdAuthentication.store is nil. Using in-memory store."
- end
-
- ::Rack::OpenID.new(app, OpenIdAuthentication.store)
- end
-
- def self.store
- @@store
- end
-
- def self.store=(*store_option)
- store, *parameters = *([ store_option ].flatten)
-
- @@store = case store
- when :memory
- require 'openid/store/memory'
- OpenID::Store::Memory.new
- when :file
- require 'openid/store/filesystem'
- OpenID::Store::Filesystem.new(Rails.root.join('tmp/openids'))
- when :memcache
- require 'memcache'
- require 'openid/store/memcache'
- OpenID::Store::Memcache.new(MemCache.new(parameters))
- else
- store
- end
- end
-
- self.store = nil
-
- class InvalidOpenId < StandardError
- end
-
- class Result
- ERROR_MESSAGES = {
- :missing => "Sorry, the OpenID server couldn't be found",
- :invalid => "Sorry, but this does not appear to be a valid OpenID",
- :canceled => "OpenID verification was canceled",
- :failed => "OpenID verification failed",
- :setup_needed => "OpenID verification needs setup"
- }
-
- def self.[](code)
- new(code)
- end
-
- def initialize(code)
- @code = code
- end
-
- def status
- @code
- end
-
- ERROR_MESSAGES.keys.each { |state| define_method("#{state}?") { @code == state } }
-
- def successful?
- @code == :successful
- end
-
- def unsuccessful?
- ERROR_MESSAGES.keys.include?(@code)
- end
-
- def message
- ERROR_MESSAGES[@code]
- end
- end
-
- # normalizes an OpenID according to http://openid.net/specs/openid-authentication-2_0.html#normalization
- def self.normalize_identifier(identifier)
- # clean up whitespace
- identifier = identifier.to_s.strip
-
- # if an XRI has a prefix, strip it.
- identifier.gsub!(/xri:\/\//i, '')
-
- # 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
-
- # strip any fragments
- identifier.gsub!(/\#(.*)$/, '')
-
- begin
- uri = URI.parse(identifier)
- uri.scheme = uri.scheme.downcase if uri.scheme # URI should do this
- identifier = uri.normalize.to_s
- rescue URI::InvalidURIError
- raise InvalidOpenId.new("#{identifier} is not an OpenID identifier")
- end
- end
-
- return identifier
- end
-
- protected
- # The parameter name of "openid_identifier" is used rather than
- # the Rails convention "open_id_identifier" because that's what
- # the specification dictates in order to get browser auto-complete
- # working across sites
- def using_open_id?(identifier = nil) #:doc:
- identifier ||= open_id_identifier
- !identifier.blank? || request.env[Rack::OpenID::RESPONSE]
- end
-
- def authenticate_with_open_id(identifier = nil, options = {}, &block) #:doc:
- identifier ||= open_id_identifier
-
- if request.env[Rack::OpenID::RESPONSE]
- complete_open_id_authentication(&block)
- else
- begin_open_id_authentication(identifier, options, &block)
- end
- end
-
- private
- def open_id_identifier
- params[:openid_identifier] || params[:openid_url]
- end
-
- def begin_open_id_authentication(identifier, options = {})
- options[:identifier] = identifier
- value = Rack::OpenID.build_header(options)
- response.headers[Rack::OpenID::AUTHENTICATE_HEADER] = value
- head :unauthorized
- end
-
- def complete_open_id_authentication
- response = request.env[Rack::OpenID::RESPONSE]
- identifier = response.display_identifier
-
- case response.status
- when OpenID::Consumer::SUCCESS
- yield Result[:successful], identifier,
- OpenID::SReg::Response.from_success_response(response)
- when :missing
- yield Result[:missing], identifier, nil
- when :invalid
- yield Result[:invalid], identifier, nil
- when OpenID::Consumer::CANCEL
- yield Result[:canceled], identifier, nil
- when OpenID::Consumer::FAILURE
- yield Result[:failed], identifier, nil
- when OpenID::Consumer::SETUP_NEEDED
- yield Result[:setup_needed], response.setup_url, nil
- end
- end
-end
+# frozen_string_literal: true
+require 'uri'
+require 'openid'
+require 'rack/openid'
+
+module OpenIdAuthentication
+ def self.new(app)
+ store = OpenIdAuthentication.store
+ if store.nil?
+ Rails.logger.warn "OpenIdAuthentication.store is nil. Using in-memory store."
+ end
+
+ ::Rack::OpenID.new(app, OpenIdAuthentication.store)
+ end
+
+ def self.store
+ @@store
+ end
+
+ def self.store=(*store_option)
+ store, *parameters = *([ store_option ].flatten)
+
+ @@store = case store
+ when :memory
+ require 'openid/store/memory'
+ OpenID::Store::Memory.new
+ when :file
+ require 'openid/store/filesystem'
+ OpenID::Store::Filesystem.new(Rails.root.join('tmp/openids'))
+ when :memcache
+ require 'memcache'
+ require 'openid/store/memcache'
+ OpenID::Store::Memcache.new(MemCache.new(parameters))
+ else
+ store
+ end
+ end
+
+ self.store = nil
+
+ class InvalidOpenId < StandardError
+ end
+
+ class Result
+ ERROR_MESSAGES = {
+ :missing => "Sorry, the OpenID server couldn't be found",
+ :invalid => "Sorry, but this does not appear to be a valid OpenID",
+ :canceled => "OpenID verification was canceled",
+ :failed => "OpenID verification failed",
+ :setup_needed => "OpenID verification needs setup"
+ }
+
+ def self.[](code)
+ new(code)
+ end
+
+ def initialize(code)
+ @code = code
+ end
+
+ def status
+ @code
+ end
+
+ ERROR_MESSAGES.keys.each { |state| define_method("#{state}?") { @code == state } }
+
+ def successful?
+ @code == :successful
+ end
+
+ def unsuccessful?
+ ERROR_MESSAGES.keys.include?(@code)
+ end
+
+ def message
+ ERROR_MESSAGES[@code]
+ end
+ end
+
+ # normalizes an OpenID according to http://openid.net/specs/openid-authentication-2_0.html#normalization
+ def self.normalize_identifier(identifier)
+ # clean up whitespace
+ identifier = identifier.to_s.strip
+
+ # if an XRI has a prefix, strip it.
+ identifier.gsub!(/xri:\/\//i, '')
+
+ # 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}".dup unless identifier =~ /^http/i
+
+ # strip any fragments
+ identifier.gsub!(/\#(.*)$/, '')
+
+ begin
+ uri = URI.parse(identifier)
+ uri.scheme = uri.scheme.downcase if uri.scheme # URI should do this
+ identifier = uri.normalize.to_s
+ rescue URI::InvalidURIError
+ raise InvalidOpenId.new("#{identifier} is not an OpenID identifier")
+ end
+ end
+
+ return identifier
+ end
+
+ protected
+ # The parameter name of "openid_identifier" is used rather than
+ # the Rails convention "open_id_identifier" because that's what
+ # the specification dictates in order to get browser auto-complete
+ # working across sites
+ def using_open_id?(identifier = nil) #:doc:
+ identifier ||= open_id_identifier
+ !identifier.blank? || request.env[Rack::OpenID::RESPONSE]
+ end
+
+ def authenticate_with_open_id(identifier = nil, options = {}, &block) #:doc:
+ identifier ||= open_id_identifier
+
+ if request.env[Rack::OpenID::RESPONSE]
+ complete_open_id_authentication(&block)
+ else
+ begin_open_id_authentication(identifier, options, &block)
+ end
+ end
+
+ private
+ def open_id_identifier
+ params[:openid_identifier] || params[:openid_url]
+ end
+
+ def begin_open_id_authentication(identifier, options = {})
+ options[:identifier] = identifier
+ value = Rack::OpenID.build_header(options)
+ response.headers[Rack::OpenID::AUTHENTICATE_HEADER] = value
+ head :unauthorized
+ end
+
+ def complete_open_id_authentication
+ response = request.env[Rack::OpenID::RESPONSE]
+ identifier = response.display_identifier
+
+ case response.status
+ when OpenID::Consumer::SUCCESS
+ yield Result[:successful], identifier,
+ OpenID::SReg::Response.from_success_response(response)
+ when :missing
+ yield Result[:missing], identifier, nil
+ when :invalid
+ yield Result[:invalid], identifier, nil
+ when OpenID::Consumer::CANCEL
+ yield Result[:canceled], identifier, nil
+ when OpenID::Consumer::FAILURE
+ yield Result[:failed], identifier, nil
+ when OpenID::Consumer::SETUP_NEEDED
+ yield Result[:setup_needed], response.setup_url, nil
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/association.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/association.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/association.rb (working copy)
@@ -1,9 +1,10 @@
-module OpenIdAuthentication
- class Association < ActiveRecord::Base
- self.table_name = :open_id_authentication_associations
-
- def from_record
- OpenID::Association.new(handle, secret, issued, lifetime, assoc_type)
- end
- end
-end
+# frozen_string_literal: true
+module OpenIdAuthentication
+ class Association < ActiveRecord::Base
+ self.table_name = :open_id_authentication_associations
+
+ def from_record
+ OpenID::Association.new(handle, secret, issued, lifetime, assoc_type)
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/db_store.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/db_store.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/db_store.rb (working copy)
@@ -1,55 +1,56 @@
-require 'openid/store/interface'
-
-module OpenIdAuthentication
- class DbStore < OpenID::Store::Interface
- def self.cleanup_nonces
- now = Time.now.to_i
- Nonce.delete_all(["timestamp > ? OR timestamp < ?", now + OpenID::Nonce.skew, now - OpenID::Nonce.skew])
- end
-
- def self.cleanup_associations
- now = Time.now.to_i
- Association.delete_all(['issued + lifetime > ?',now])
- end
-
- def store_association(server_url, assoc)
- remove_association(server_url, assoc.handle)
- Association.create(:server_url => server_url,
- :handle => assoc.handle,
- :secret => assoc.secret,
- :issued => assoc.issued,
- :lifetime => assoc.lifetime,
- :assoc_type => assoc.assoc_type)
- end
-
- def get_association(server_url, handle = nil)
- assocs = if handle.blank?
- Association.find_all_by_server_url(server_url)
- else
- Association.find_all_by_server_url_and_handle(server_url, handle)
- end
-
- assocs.reverse.each do |assoc|
- a = assoc.from_record
- if a.expires_in == 0
- assoc.destroy
- else
- return a
- end
- end if assocs.any?
-
- return nil
- end
-
- def remove_association(server_url, handle)
- Association.delete_all(['server_url = ? AND handle = ?', server_url, handle]) > 0
- end
-
- def use_nonce(server_url, timestamp, salt)
- return false if Nonce.find_by_server_url_and_timestamp_and_salt(server_url, timestamp, salt)
- return false if (timestamp - Time.now.to_i).abs > OpenID::Nonce.skew
- Nonce.create(:server_url => server_url, :timestamp => timestamp, :salt => salt)
- return true
- end
- end
-end
+# frozen_string_literal: true
+require 'openid/store/interface'
+
+module OpenIdAuthentication
+ class DbStore < OpenID::Store::Interface
+ def self.cleanup_nonces
+ now = Time.now.to_i
+ Nonce.delete_all(["timestamp > ? OR timestamp < ?", now + OpenID::Nonce.skew, now - OpenID::Nonce.skew])
+ end
+
+ def self.cleanup_associations
+ now = Time.now.to_i
+ Association.delete_all(['issued + lifetime > ?',now])
+ end
+
+ def store_association(server_url, assoc)
+ remove_association(server_url, assoc.handle)
+ Association.create(:server_url => server_url,
+ :handle => assoc.handle,
+ :secret => assoc.secret,
+ :issued => assoc.issued,
+ :lifetime => assoc.lifetime,
+ :assoc_type => assoc.assoc_type)
+ end
+
+ def get_association(server_url, handle = nil)
+ assocs = if handle.blank?
+ Association.find_all_by_server_url(server_url)
+ else
+ Association.find_all_by_server_url_and_handle(server_url, handle)
+ end
+
+ assocs.reverse.each do |assoc|
+ a = assoc.from_record
+ if a.expires_in == 0
+ assoc.destroy
+ else
+ return a
+ end
+ end if assocs.any?
+
+ return nil
+ end
+
+ def remove_association(server_url, handle)
+ Association.delete_all(['server_url = ? AND handle = ?', server_url, handle]) > 0
+ end
+
+ def use_nonce(server_url, timestamp, salt)
+ return false if Nonce.find_by_server_url_and_timestamp_and_salt(server_url, timestamp, salt)
+ return false if (timestamp - Time.now.to_i).abs > OpenID::Nonce.skew
+ Nonce.create(:server_url => server_url, :timestamp => timestamp, :salt => salt)
+ return true
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb (working copy)
@@ -1,73 +1,74 @@
-require 'digest/sha1'
-require 'openid/store/interface'
-
-module OpenIdAuthentication
- class MemCacheStore < OpenID::Store::Interface
- def initialize(*addresses)
- @connection = ActiveSupport::Cache::MemCacheStore.new(addresses)
- end
-
- def store_association(server_url, assoc)
- server_key = association_server_key(server_url)
- assoc_key = association_key(server_url, assoc.handle)
-
- assocs = @connection.read(server_key) || {}
- assocs[assoc.issued] = assoc_key
-
- @connection.write(server_key, assocs)
- @connection.write(assoc_key, assoc, :expires_in => assoc.lifetime)
- end
-
- def get_association(server_url, handle = nil)
- if handle
- @connection.read(association_key(server_url, handle))
- else
- server_key = association_server_key(server_url)
- assocs = @connection.read(server_key)
- return if assocs.nil?
-
- last_key = assocs[assocs.keys.sort.last]
- @connection.read(last_key)
- end
- end
-
- def remove_association(server_url, handle)
- server_key = association_server_key(server_url)
- assoc_key = association_key(server_url, handle)
- assocs = @connection.read(server_key)
-
- return false unless assocs && assocs.has_value?(assoc_key)
-
- assocs = assocs.delete_if { |key, value| value == assoc_key }
-
- @connection.write(server_key, assocs)
- @connection.delete(assoc_key)
-
- return true
- end
-
- def use_nonce(server_url, timestamp, salt)
- return false if @connection.read(nonce_key(server_url, salt))
- return false if (timestamp - Time.now.to_i).abs > OpenID::Nonce.skew
- @connection.write(nonce_key(server_url, salt), timestamp, :expires_in => OpenID::Nonce.skew)
- return true
- end
-
- private
- def association_key(server_url, handle = nil)
- "openid_association_#{digest(server_url)}_#{digest(handle)}"
- end
-
- def association_server_key(server_url)
- "openid_association_server_#{digest(server_url)}"
- end
-
- def nonce_key(server_url, salt)
- "openid_nonce_#{digest(server_url)}_#{digest(salt)}"
- end
-
- def digest(text)
- Digest::SHA1.hexdigest(text)
- end
- end
-end
+# frozen_string_literal: true
+require 'digest/sha1'
+require 'openid/store/interface'
+
+module OpenIdAuthentication
+ class MemCacheStore < OpenID::Store::Interface
+ def initialize(*addresses)
+ @connection = ActiveSupport::Cache::MemCacheStore.new(addresses)
+ end
+
+ def store_association(server_url, assoc)
+ server_key = association_server_key(server_url)
+ assoc_key = association_key(server_url, assoc.handle)
+
+ assocs = @connection.read(server_key) || {}
+ assocs[assoc.issued] = assoc_key
+
+ @connection.write(server_key, assocs)
+ @connection.write(assoc_key, assoc, :expires_in => assoc.lifetime)
+ end
+
+ def get_association(server_url, handle = nil)
+ if handle
+ @connection.read(association_key(server_url, handle))
+ else
+ server_key = association_server_key(server_url)
+ assocs = @connection.read(server_key)
+ return if assocs.nil?
+
+ last_key = assocs[assocs.keys.sort.last]
+ @connection.read(last_key)
+ end
+ end
+
+ def remove_association(server_url, handle)
+ server_key = association_server_key(server_url)
+ assoc_key = association_key(server_url, handle)
+ assocs = @connection.read(server_key)
+
+ return false unless assocs && assocs.has_value?(assoc_key)
+
+ assocs = assocs.delete_if { |key, value| value == assoc_key }
+
+ @connection.write(server_key, assocs)
+ @connection.delete(assoc_key)
+
+ return true
+ end
+
+ def use_nonce(server_url, timestamp, salt)
+ return false if @connection.read(nonce_key(server_url, salt))
+ return false if (timestamp - Time.now.to_i).abs > OpenID::Nonce.skew
+ @connection.write(nonce_key(server_url, salt), timestamp, :expires_in => OpenID::Nonce.skew)
+ return true
+ end
+
+ private
+ def association_key(server_url, handle = nil)
+ "openid_association_#{digest(server_url)}_#{digest(handle)}"
+ end
+
+ def association_server_key(server_url)
+ "openid_association_server_#{digest(server_url)}"
+ end
+
+ def nonce_key(server_url, salt)
+ "openid_nonce_#{digest(server_url)}_#{digest(salt)}"
+ end
+
+ def digest(text)
+ Digest::SHA1.hexdigest(text)
+ end
+ end
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb (working copy)
@@ -1,5 +1,6 @@
-module OpenIdAuthentication
- class Nonce < ActiveRecord::Base
- self.table_name = :open_id_authentication_nonces
- end
-end
+# frozen_string_literal: true
+module OpenIdAuthentication
+ class Nonce < ActiveRecord::Base
+ self.table_name = :open_id_authentication_nonces
+ end
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/request.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/request.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/request.rb (working copy)
@@ -1,23 +1,24 @@
-module OpenIdAuthentication
- module Request
- def self.included(base)
- base.alias_method_chain :request_method, :openid
- end
-
- def request_method_with_openid
- if !parameters[:_method].blank? && parameters[:open_id_complete] == '1'
- parameters[:_method].to_sym
- else
- request_method_without_openid
- end
- end
- end
-end
-
-# In Rails 2.3, the request object has been renamed
-# from AbstractRequest to Request
-if defined? ActionController::Request
- ActionController::Request.send :include, OpenIdAuthentication::Request
-else
- ActionController::AbstractRequest.send :include, OpenIdAuthentication::Request
-end
+# frozen_string_literal: true
+module OpenIdAuthentication
+ module Request
+ def self.included(base)
+ base.alias_method_chain :request_method, :openid
+ end
+
+ def request_method_with_openid
+ if !parameters[:_method].blank? && parameters[:open_id_complete] == '1'
+ parameters[:_method].to_sym
+ else
+ request_method_without_openid
+ end
+ end
+ end
+end
+
+# In Rails 2.3, the request object has been renamed
+# from AbstractRequest to Request
+if defined? ActionController::Request
+ ActionController::Request.send :include, OpenIdAuthentication::Request
+else
+ ActionController::AbstractRequest.send :include, OpenIdAuthentication::Request
+end
Index: lib/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
===================================================================
--- lib/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb (revision 16900)
+++ lib/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb (working copy)
@@ -1,20 +1,21 @@
-# http://trac.openidenabled.com/trac/ticket/156
-module OpenID
- @@timeout_threshold = 20
-
- def self.timeout_threshold
- @@timeout_threshold
- end
-
- def self.timeout_threshold=(value)
- @@timeout_threshold = value
- end
-
- class StandardFetcher
- def make_http(uri)
- http = @proxy.new(uri.host, uri.port)
- http.read_timeout = http.open_timeout = OpenID.timeout_threshold
- http
- end
- end
+# frozen_string_literal: true
+# http://trac.openidenabled.com/trac/ticket/156
+module OpenID
+ @@timeout_threshold = 20
+
+ def self.timeout_threshold
+ @@timeout_threshold
+ end
+
+ def self.timeout_threshold=(value)
+ @@timeout_threshold = value
+ end
+
+ class StandardFetcher
+ def make_http(uri)
+ http = @proxy.new(uri.host, uri.port)
+ http.read_timeout = http.open_timeout = OpenID.timeout_threshold
+ http
+ end
+ end
end
\ No newline at end of file
Index: lib/plugins/open_id_authentication/test/mem_cache_store_test.rb
===================================================================
--- lib/plugins/open_id_authentication/test/mem_cache_store_test.rb (revision 16900)
+++ lib/plugins/open_id_authentication/test/mem_cache_store_test.rb (working copy)
@@ -1,151 +1,152 @@
-require File.dirname(__FILE__) + '/test_helper'
-require File.dirname(__FILE__) + '/../lib/open_id_authentication/mem_cache_store'
-
-# Mock MemCacheStore with MemoryStore for testing
-class OpenIdAuthentication::MemCacheStore < OpenID::Store::Interface
- def initialize(*addresses)
- @connection = ActiveSupport::Cache::MemoryStore.new
- end
-end
-
-class MemCacheStoreTest < Test::Unit::TestCase
- ALLOWED_HANDLE = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
-
- def setup
- @store = OpenIdAuthentication::MemCacheStore.new
- end
-
- def test_store
- server_url = "http://www.myopenid.com/openid"
- assoc = gen_assoc(0)
-
- # Make sure that a missing association returns no result
- assert_retrieve(server_url)
-
- # Check that after storage, getting returns the same result
- @store.store_association(server_url, assoc)
- assert_retrieve(server_url, nil, assoc)
-
- # more than once
- assert_retrieve(server_url, nil, assoc)
-
- # Storing more than once has no ill effect
- @store.store_association(server_url, assoc)
- assert_retrieve(server_url, nil, assoc)
-
- # Removing an association that does not exist returns not present
- assert_remove(server_url, assoc.handle + 'x', false)
-
- # Removing an association that does not exist returns not present
- assert_remove(server_url + 'x', assoc.handle, false)
-
- # Removing an association that is present returns present
- assert_remove(server_url, assoc.handle, true)
-
- # but not present on subsequent calls
- assert_remove(server_url, assoc.handle, false)
-
- # Put assoc back in the store
- @store.store_association(server_url, assoc)
-
- # More recent and expires after assoc
- assoc2 = gen_assoc(1)
- @store.store_association(server_url, assoc2)
-
- # After storing an association with a different handle, but the
- # same server_url, the handle with the later expiration is returned.
- assert_retrieve(server_url, nil, assoc2)
-
- # We can still retrieve the older association
- assert_retrieve(server_url, assoc.handle, assoc)
-
- # Plus we can retrieve the association with the later expiration
- # explicitly
- assert_retrieve(server_url, assoc2.handle, assoc2)
-
- # More recent, and expires earlier than assoc2 or assoc. Make sure
- # that we're picking the one with the latest issued date and not
- # taking into account the expiration.
- assoc3 = gen_assoc(2, 100)
- @store.store_association(server_url, assoc3)
-
- assert_retrieve(server_url, nil, assoc3)
- assert_retrieve(server_url, assoc.handle, assoc)
- assert_retrieve(server_url, assoc2.handle, assoc2)
- assert_retrieve(server_url, assoc3.handle, assoc3)
-
- assert_remove(server_url, assoc2.handle, true)
-
- assert_retrieve(server_url, nil, assoc3)
- assert_retrieve(server_url, assoc.handle, assoc)
- assert_retrieve(server_url, assoc2.handle, nil)
- assert_retrieve(server_url, assoc3.handle, assoc3)
-
- assert_remove(server_url, assoc2.handle, false)
- assert_remove(server_url, assoc3.handle, true)
-
- assert_retrieve(server_url, nil, assoc)
- assert_retrieve(server_url, assoc.handle, assoc)
- assert_retrieve(server_url, assoc2.handle, nil)
- assert_retrieve(server_url, assoc3.handle, nil)
-
- assert_remove(server_url, assoc2.handle, false)
- assert_remove(server_url, assoc.handle, true)
- assert_remove(server_url, assoc3.handle, false)
-
- assert_retrieve(server_url, nil, nil)
- assert_retrieve(server_url, assoc.handle, nil)
- assert_retrieve(server_url, assoc2.handle, nil)
- assert_retrieve(server_url, assoc3.handle, nil)
-
- assert_remove(server_url, assoc2.handle, false)
- assert_remove(server_url, assoc.handle, false)
- assert_remove(server_url, assoc3.handle, false)
- end
-
- def test_nonce
- server_url = "http://www.myopenid.com/openid"
-
- [server_url, ''].each do |url|
- nonce1 = OpenID::Nonce::mk_nonce
-
- assert_nonce(nonce1, true, url, "#{url}: nonce allowed by default")
- assert_nonce(nonce1, false, url, "#{url}: nonce not allowed twice")
- assert_nonce(nonce1, false, url, "#{url}: nonce not allowed third time")
-
- # old nonces shouldn't pass
- old_nonce = OpenID::Nonce::mk_nonce(3600)
- assert_nonce(old_nonce, false, url, "Old nonce #{old_nonce.inspect} passed")
- end
- end
-
- private
- def gen_assoc(issued, lifetime = 600)
- secret = OpenID::CryptUtil.random_string(20, nil)
- handle = OpenID::CryptUtil.random_string(128, ALLOWED_HANDLE)
- OpenID::Association.new(handle, secret, Time.now + issued, lifetime, 'HMAC-SHA1')
- end
-
- def assert_retrieve(url, handle = nil, expected = nil)
- assoc = @store.get_association(url, handle)
-
- if expected.nil?
- assert_nil(assoc)
- else
- assert_equal(expected, assoc)
- assert_equal(expected.handle, assoc.handle)
- assert_equal(expected.secret, assoc.secret)
- end
- end
-
- def assert_remove(url, handle, expected)
- present = @store.remove_association(url, handle)
- assert_equal(expected, present)
- end
-
- def assert_nonce(nonce, expected, server_url, msg = "")
- stamp, salt = OpenID::Nonce::split_nonce(nonce)
- actual = @store.use_nonce(server_url, stamp, salt)
- assert_equal(expected, actual, msg)
- end
-end
+# frozen_string_literal: true
+require File.dirname(__FILE__) + '/test_helper'
+require File.dirname(__FILE__) + '/../lib/open_id_authentication/mem_cache_store'
+
+# Mock MemCacheStore with MemoryStore for testing
+class OpenIdAuthentication::MemCacheStore < OpenID::Store::Interface
+ def initialize(*addresses)
+ @connection = ActiveSupport::Cache::MemoryStore.new
+ end
+end
+
+class MemCacheStoreTest < Test::Unit::TestCase
+ ALLOWED_HANDLE = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
+
+ def setup
+ @store = OpenIdAuthentication::MemCacheStore.new
+ end
+
+ def test_store
+ server_url = "http://www.myopenid.com/openid"
+ assoc = gen_assoc(0)
+
+ # Make sure that a missing association returns no result
+ assert_retrieve(server_url)
+
+ # Check that after storage, getting returns the same result
+ @store.store_association(server_url, assoc)
+ assert_retrieve(server_url, nil, assoc)
+
+ # more than once
+ assert_retrieve(server_url, nil, assoc)
+
+ # Storing more than once has no ill effect
+ @store.store_association(server_url, assoc)
+ assert_retrieve(server_url, nil, assoc)
+
+ # Removing an association that does not exist returns not present
+ assert_remove(server_url, assoc.handle + 'x', false)
+
+ # Removing an association that does not exist returns not present
+ assert_remove(server_url + 'x', assoc.handle, false)
+
+ # Removing an association that is present returns present
+ assert_remove(server_url, assoc.handle, true)
+
+ # but not present on subsequent calls
+ assert_remove(server_url, assoc.handle, false)
+
+ # Put assoc back in the store
+ @store.store_association(server_url, assoc)
+
+ # More recent and expires after assoc
+ assoc2 = gen_assoc(1)
+ @store.store_association(server_url, assoc2)
+
+ # After storing an association with a different handle, but the
+ # same server_url, the handle with the later expiration is returned.
+ assert_retrieve(server_url, nil, assoc2)
+
+ # We can still retrieve the older association
+ assert_retrieve(server_url, assoc.handle, assoc)
+
+ # Plus we can retrieve the association with the later expiration
+ # explicitly
+ assert_retrieve(server_url, assoc2.handle, assoc2)
+
+ # More recent, and expires earlier than assoc2 or assoc. Make sure
+ # that we're picking the one with the latest issued date and not
+ # taking into account the expiration.
+ assoc3 = gen_assoc(2, 100)
+ @store.store_association(server_url, assoc3)
+
+ assert_retrieve(server_url, nil, assoc3)
+ assert_retrieve(server_url, assoc.handle, assoc)
+ assert_retrieve(server_url, assoc2.handle, assoc2)
+ assert_retrieve(server_url, assoc3.handle, assoc3)
+
+ assert_remove(server_url, assoc2.handle, true)
+
+ assert_retrieve(server_url, nil, assoc3)
+ assert_retrieve(server_url, assoc.handle, assoc)
+ assert_retrieve(server_url, assoc2.handle, nil)
+ assert_retrieve(server_url, assoc3.handle, assoc3)
+
+ assert_remove(server_url, assoc2.handle, false)
+ assert_remove(server_url, assoc3.handle, true)
+
+ assert_retrieve(server_url, nil, assoc)
+ assert_retrieve(server_url, assoc.handle, assoc)
+ assert_retrieve(server_url, assoc2.handle, nil)
+ assert_retrieve(server_url, assoc3.handle, nil)
+
+ assert_remove(server_url, assoc2.handle, false)
+ assert_remove(server_url, assoc.handle, true)
+ assert_remove(server_url, assoc3.handle, false)
+
+ assert_retrieve(server_url, nil, nil)
+ assert_retrieve(server_url, assoc.handle, nil)
+ assert_retrieve(server_url, assoc2.handle, nil)
+ assert_retrieve(server_url, assoc3.handle, nil)
+
+ assert_remove(server_url, assoc2.handle, false)
+ assert_remove(server_url, assoc.handle, false)
+ assert_remove(server_url, assoc3.handle, false)
+ end
+
+ def test_nonce
+ server_url = "http://www.myopenid.com/openid"
+
+ [server_url, ''].each do |url|
+ nonce1 = OpenID::Nonce::mk_nonce
+
+ assert_nonce(nonce1, true, url, "#{url}: nonce allowed by default")
+ assert_nonce(nonce1, false, url, "#{url}: nonce not allowed twice")
+ assert_nonce(nonce1, false, url, "#{url}: nonce not allowed third time")
+
+ # old nonces shouldn't pass
+ old_nonce = OpenID::Nonce::mk_nonce(3600)
+ assert_nonce(old_nonce, false, url, "Old nonce #{old_nonce.inspect} passed")
+ end
+ end
+
+ private
+ def gen_assoc(issued, lifetime = 600)
+ secret = OpenID::CryptUtil.random_string(20, nil)
+ handle = OpenID::CryptUtil.random_string(128, ALLOWED_HANDLE)
+ OpenID::Association.new(handle, secret, Time.now + issued, lifetime, 'HMAC-SHA1')
+ end
+
+ def assert_retrieve(url, handle = nil, expected = nil)
+ assoc = @store.get_association(url, handle)
+
+ if expected.nil?
+ assert_nil(assoc)
+ else
+ assert_equal(expected, assoc)
+ assert_equal(expected.handle, assoc.handle)
+ assert_equal(expected.secret, assoc.secret)
+ end
+ end
+
+ def assert_remove(url, handle, expected)
+ present = @store.remove_association(url, handle)
+ assert_equal(expected, present)
+ end
+
+ def assert_nonce(nonce, expected, server_url, msg = "")
+ stamp, salt = OpenID::Nonce::split_nonce(nonce)
+ actual = @store.use_nonce(server_url, stamp, salt)
+ assert_equal(expected, actual, msg)
+ end
+end
Index: lib/plugins/open_id_authentication/test/normalize_test.rb
===================================================================
--- lib/plugins/open_id_authentication/test/normalize_test.rb (revision 16900)
+++ lib/plugins/open_id_authentication/test/normalize_test.rb (working copy)
@@ -1,32 +1,33 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class NormalizeTest < Test::Unit::TestCase
- include OpenIdAuthentication
-
- NORMALIZATIONS = {
- "openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
- "http://openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
- "https://openid.aol.com/nextangler" => "https://openid.aol.com/nextangler",
- "HTTP://OPENID.AOL.COM/NEXTANGLER" => "http://openid.aol.com/NEXTANGLER",
- "HTTPS://OPENID.AOL.COM/NEXTANGLER" => "https://openid.aol.com/NEXTANGLER",
- "loudthinking.com" => "http://loudthinking.com/",
- "http://loudthinking.com" => "http://loudthinking.com/",
- "http://loudthinking.com:80" => "http://loudthinking.com/",
- "https://loudthinking.com:443" => "https://loudthinking.com/",
- "http://loudthinking.com:8080" => "http://loudthinking.com:8080/",
- "techno-weenie.net" => "http://techno-weenie.net/",
- "http://techno-weenie.net" => "http://techno-weenie.net/",
- "http://techno-weenie.net " => "http://techno-weenie.net/",
- "=name" => "=name"
- }
-
- def test_normalizations
- NORMALIZATIONS.each do |from, to|
- assert_equal to, normalize_identifier(from)
- end
- end
-
- def test_broken_open_id
- assert_raises(InvalidOpenId) { normalize_identifier(nil) }
- end
-end
+# frozen_string_literal: true
+require File.dirname(__FILE__) + '/test_helper'
+
+class NormalizeTest < Test::Unit::TestCase
+ include OpenIdAuthentication
+
+ NORMALIZATIONS = {
+ "openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
+ "http://openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
+ "https://openid.aol.com/nextangler" => "https://openid.aol.com/nextangler",
+ "HTTP://OPENID.AOL.COM/NEXTANGLER" => "http://openid.aol.com/NEXTANGLER",
+ "HTTPS://OPENID.AOL.COM/NEXTANGLER" => "https://openid.aol.com/NEXTANGLER",
+ "loudthinking.com" => "http://loudthinking.com/",
+ "http://loudthinking.com" => "http://loudthinking.com/",
+ "http://loudthinking.com:80" => "http://loudthinking.com/",
+ "https://loudthinking.com:443" => "https://loudthinking.com/",
+ "http://loudthinking.com:8080" => "http://loudthinking.com:8080/",
+ "techno-weenie.net" => "http://techno-weenie.net/",
+ "http://techno-weenie.net" => "http://techno-weenie.net/",
+ "http://techno-weenie.net " => "http://techno-weenie.net/",
+ "=name" => "=name"
+ }
+
+ def test_normalizations
+ NORMALIZATIONS.each do |from, to|
+ assert_equal to, normalize_identifier(from)
+ end
+ end
+
+ def test_broken_open_id
+ assert_raises(InvalidOpenId) { normalize_identifier(nil) }
+ end
+end
Index: lib/plugins/open_id_authentication/test/open_id_authentication_test.rb
===================================================================
--- lib/plugins/open_id_authentication/test/open_id_authentication_test.rb (revision 16900)
+++ lib/plugins/open_id_authentication/test/open_id_authentication_test.rb (working copy)
@@ -1,46 +1,47 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class OpenIdAuthenticationTest < Test::Unit::TestCase
- def setup
- @controller = Class.new do
- include OpenIdAuthentication
- def params() {} end
- end.new
- end
-
- def test_authentication_should_fail_when_the_identity_server_is_missing
- open_id_consumer = mock()
- open_id_consumer.expects(:begin).raises(OpenID::OpenIDError)
- @controller.expects(:open_id_consumer).returns(open_id_consumer)
- @controller.expects(:logger).returns(mock(:error => true))
-
- @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
- assert result.missing?
- assert_equal "Sorry, the OpenID server couldn't be found", result.message
- end
- end
-
- def test_authentication_should_be_invalid_when_the_identity_url_is_invalid
- @controller.send(:authenticate_with_open_id, "!") do |result, identity_url|
- assert result.invalid?, "Result expected to be invalid but was not"
- assert_equal "Sorry, but this does not appear to be a valid OpenID", result.message
- end
- end
-
- def test_authentication_should_fail_when_the_identity_server_times_out
- open_id_consumer = mock()
- open_id_consumer.expects(:begin).raises(Timeout::Error, "Identity Server took too long.")
- @controller.expects(:open_id_consumer).returns(open_id_consumer)
- @controller.expects(:logger).returns(mock(:error => true))
-
- @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
- assert result.missing?
- assert_equal "Sorry, the OpenID server couldn't be found", result.message
- end
- end
-
- def test_authentication_should_begin_when_the_identity_server_is_present
- @controller.expects(:begin_open_id_authentication)
- @controller.send(:authenticate_with_open_id, "http://someone.example.com")
- end
-end
+# frozen_string_literal: true
+require File.dirname(__FILE__) + '/test_helper'
+
+class OpenIdAuthenticationTest < Test::Unit::TestCase
+ def setup
+ @controller = Class.new do
+ include OpenIdAuthentication
+ def params() {} end
+ end.new
+ end
+
+ def test_authentication_should_fail_when_the_identity_server_is_missing
+ open_id_consumer = mock()
+ open_id_consumer.expects(:begin).raises(OpenID::OpenIDError)
+ @controller.expects(:open_id_consumer).returns(open_id_consumer)
+ @controller.expects(:logger).returns(mock(:error => true))
+
+ @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
+ assert result.missing?
+ assert_equal "Sorry, the OpenID server couldn't be found", result.message
+ end
+ end
+
+ def test_authentication_should_be_invalid_when_the_identity_url_is_invalid
+ @controller.send(:authenticate_with_open_id, "!") do |result, identity_url|
+ assert result.invalid?, "Result expected to be invalid but was not"
+ assert_equal "Sorry, but this does not appear to be a valid OpenID", result.message
+ end
+ end
+
+ def test_authentication_should_fail_when_the_identity_server_times_out
+ open_id_consumer = mock()
+ open_id_consumer.expects(:begin).raises(Timeout::Error, "Identity Server took too long.")
+ @controller.expects(:open_id_consumer).returns(open_id_consumer)
+ @controller.expects(:logger).returns(mock(:error => true))
+
+ @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
+ assert result.missing?
+ assert_equal "Sorry, the OpenID server couldn't be found", result.message
+ end
+ end
+
+ def test_authentication_should_begin_when_the_identity_server_is_present
+ @controller.expects(:begin_open_id_authentication)
+ @controller.send(:authenticate_with_open_id, "http://someone.example.com")
+ end
+end
Index: lib/plugins/open_id_authentication/test/status_test.rb
===================================================================
--- lib/plugins/open_id_authentication/test/status_test.rb (revision 16900)
+++ lib/plugins/open_id_authentication/test/status_test.rb (working copy)
@@ -1,14 +1,15 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class StatusTest < Test::Unit::TestCase
- include OpenIdAuthentication
-
- def test_state_conditional
- assert Result[:missing].missing?
- assert Result[:missing].unsuccessful?
- assert !Result[:missing].successful?
-
- assert Result[:successful].successful?
- assert !Result[:successful].unsuccessful?
- end
+# frozen_string_literal: true
+require File.dirname(__FILE__) + '/test_helper'
+
+class StatusTest < Test::Unit::TestCase
+ include OpenIdAuthentication
+
+ def test_state_conditional
+ assert Result[:missing].missing?
+ assert Result[:missing].unsuccessful?
+ assert !Result[:missing].successful?
+
+ assert Result[:successful].successful?
+ assert !Result[:successful].unsuccessful?
+ end
end
\ No newline at end of file
Index: lib/plugins/open_id_authentication/test/test_helper.rb
===================================================================
--- lib/plugins/open_id_authentication/test/test_helper.rb (revision 16900)
+++ lib/plugins/open_id_authentication/test/test_helper.rb (working copy)
@@ -1,17 +1,18 @@
-require 'test/unit'
-require 'rubygems'
-
-gem 'activesupport'
-require 'active_support'
-
-gem 'actionpack'
-require 'action_controller'
-
-gem 'mocha'
-require 'mocha/setup'
-
-gem 'ruby-openid'
-require 'openid'
-
-RAILS_ROOT = File.dirname(__FILE__) unless defined? RAILS_ROOT
-require File.dirname(__FILE__) + "/../lib/open_id_authentication"
+# frozen_string_literal: true
+require 'test/unit'
+require 'rubygems'
+
+gem 'activesupport'
+require 'active_support'
+
+gem 'actionpack'
+require 'action_controller'
+
+gem 'mocha'
+require 'mocha/setup'
+
+gem 'ruby-openid'
+require 'openid'
+
+RAILS_ROOT = File.dirname(__FILE__) unless defined? RAILS_ROOT
+require File.dirname(__FILE__) + "/../lib/open_id_authentication"
Index: lib/redmine.rb
===================================================================
--- lib/redmine.rb (revision 16900)
+++ lib/redmine.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/access_control.rb
===================================================================
--- lib/redmine/access_control.rb (revision 16900)
+++ lib/redmine/access_control.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/access_keys.rb
===================================================================
--- lib/redmine/access_keys.rb (revision 16900)
+++ lib/redmine/access_keys.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/activity.rb
===================================================================
--- lib/redmine/activity.rb (revision 16900)
+++ lib/redmine/activity.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/activity/fetcher.rb
===================================================================
--- lib/redmine/activity/fetcher.rb (revision 16900)
+++ lib/redmine/activity/fetcher.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/acts/positioned.rb
===================================================================
--- lib/redmine/acts/positioned.rb (revision 16900)
+++ lib/redmine/acts/positioned.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/ciphering.rb
===================================================================
--- lib/redmine/ciphering.rb (revision 16900)
+++ lib/redmine/ciphering.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/codeset_util.rb
===================================================================
--- lib/redmine/codeset_util.rb (revision 16900)
+++ lib/redmine/codeset_util.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Redmine
module CodesetUtil
@@ -4,6 +5,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 +16,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 +40,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 +60,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/configuration.rb
===================================================================
--- lib/redmine/configuration.rb (revision 16900)
+++ lib/redmine/configuration.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/core_ext.rb
===================================================================
--- lib/redmine/core_ext.rb (revision 16900)
+++ lib/redmine/core_ext.rb (working copy)
@@ -1 +1,2 @@
+# frozen_string_literal: true
Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file| require(file) }
Index: lib/redmine/core_ext/active_record.rb
===================================================================
--- lib/redmine/core_ext/active_record.rb (revision 16900)
+++ lib/redmine/core_ext/active_record.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/core_ext/date.rb
===================================================================
--- lib/redmine/core_ext/date.rb (revision 16900)
+++ lib/redmine/core_ext/date.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/date/calculations'
class Date #:nodoc:
Index: lib/redmine/core_ext/date/calculations.rb
===================================================================
--- lib/redmine/core_ext/date/calculations.rb (revision 16900)
+++ lib/redmine/core_ext/date/calculations.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/core_ext/string.rb
===================================================================
--- lib/redmine/core_ext/string.rb (revision 16900)
+++ lib/redmine/core_ext/string.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require File.dirname(__FILE__) + '/string/conversions'
require File.dirname(__FILE__) + '/string/inflections'
Index: lib/redmine/core_ext/string/conversions.rb
===================================================================
--- lib/redmine/core_ext/string/conversions.rb (revision 16900)
+++ lib/redmine/core_ext/string/conversions.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/core_ext/string/inflections.rb
===================================================================
--- lib/redmine/core_ext/string/inflections.rb (revision 16900)
+++ lib/redmine/core_ext/string/inflections.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/database.rb
===================================================================
--- lib/redmine/database.rb (revision 16900)
+++ lib/redmine/database.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/default_data/loader.rb
===================================================================
--- lib/redmine/default_data/loader.rb (revision 16900)
+++ lib/redmine/default_data/loader.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/export/csv.rb
===================================================================
--- lib/redmine/export/csv.rb (revision 16900)
+++ lib/redmine/export/csv.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -35,10 +36,10 @@
col_sep = l(:general_csv_separator)
encoding = l(:general_csv_encoding)
- str = ''.force_encoding(encoding)
+ str = ''.dup.force_encoding(encoding)
if encoding == 'UTF-8'
# BOM
- str = "\xEF\xBB\xBF".force_encoding(encoding)
+ str = "\xEF\xBB\xBF".dup.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 16900)
+++ lib/redmine/export/pdf.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -91,6 +92,7 @@
'
# Strip {{toc}} tags
+ txt = txt.dup if txt.frozen?
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 16900)
+++ lib/redmine/export/pdf/issues_pdf_helper.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# encoding: utf-8
#
# Redmine - project management software
@@ -45,7 +46,7 @@
pdf.SetFontStyle('',8)
pdf.RDMMultiCell(190, 5, "#{format_time(issue.created_on)} - #{issue.author}")
pdf.ln
-
+
left = []
left << [l(:field_status), issue.status]
left << [l(:field_priority), issue.priority]
@@ -52,7 +53,7 @@
left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?('assigned_to_id')
left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?('category_id')
left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id')
-
+
right = []
right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date')
right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?('due_date')
@@ -59,7 +60,7 @@
right << [l(:field_done_ratio), "#{issue.done_ratio}%"] unless issue.disabled_core_fields.include?('done_ratio')
right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?('estimated_hours')
right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)
-
+
rows = left.size > right.size ? left.size : right.size
while left.size < rows
left << nil
@@ -73,7 +74,7 @@
custom_field_values.each_with_index do |custom_value, i|
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]
end
-
+
if pdf.get_rtl
border_first_top = 'RT'
border_last_top = 'LT'
@@ -85,7 +86,7 @@
border_first = 'L'
border_last = 'R'
end
-
+
rows = left.size > right.size ? left.size : right.size
rows.times do |i|
heights = []
@@ -100,26 +101,26 @@
item = right[i]
heights << pdf.get_string_height(60, item ? item.last.to_s : "")
height = heights.max
-
+
item = left[i]
pdf.SetFontStyle('B',9)
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
pdf.SetFontStyle('',9)
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 0)
-
+
item = right[i]
pdf.SetFontStyle('B',9)
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
pdf.SetFontStyle('',9)
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 2)
-
+
pdf.set_x(base_x)
end
-
+
pdf.SetFontStyle('B',9)
pdf.RDMCell(35+155, 5, l(:field_description), "LRT", 1)
pdf.SetFontStyle('',9)
-
+
# Set resize image scale
pdf.set_image_scale(1.6)
text = textilizable(issue, :description,
@@ -157,7 +158,7 @@
pdf.ln
end
end
-
+
relations = issue.relations.select { |r| r.other_issue(issue).visible? }
unless relations.empty?
truncate_length = (!is_cjk? ? 80 : 60)
@@ -185,7 +186,7 @@
end
pdf.RDMCell(190,5, "", "T")
pdf.ln
-
+
if issue.changesets.any? &&
User.current.allowed_to?(:view_changesets, issue.project)
pdf.SetFontStyle('B',9)
@@ -205,7 +206,7 @@
pdf.ln
end
end
-
+
if assoc[:journals].present?
pdf.SetFontStyle('B',9)
pdf.RDMCell(190,5, l(:label_history), "B")
@@ -212,7 +213,8 @@
pdf.ln
assoc[:journals].each do |journal|
pdf.SetFontStyle('B',8)
- title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
+ title = ''.dup
+ title << "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
title << " (#{l(:field_private_notes)})" if journal.private_notes?
pdf.RDMCell(190,5, title)
pdf.ln
@@ -234,7 +236,7 @@
pdf.ln
end
end
-
+
if issue.attachments.any?
pdf.SetFontStyle('B',9)
pdf.RDMCell(190,5, l(:label_attachment_plural), "B")
@@ -261,7 +263,7 @@
pdf.footer_date = format_date(User.current.today)
pdf.set_auto_page_break(false)
pdf.add_page("L")
-
+
# Landscape A4 = 210 x 297 mm
page_height = pdf.get_page_height # 210
page_width = pdf.get_page_width # 297
@@ -269,7 +271,7 @@
right_margin = pdf.get_original_margins['right'] # 10
bottom_margin = pdf.get_footer_margin
row_height = 4
-
+
# column widths
table_width = page_width - right_margin - left_margin
col_width = []
@@ -277,13 +279,13 @@
col_width = calc_col_width(issues, query, table_width, pdf)
table_width = col_width.inject(0, :+)
end
-
+
# use full width if the description or last_notes are displayed
if table_width > 0 && (query.has_column?(:description) || query.has_column?(:last_notes))
col_width = col_width.map {|w| w * (page_width - right_margin - left_margin) / table_width}
table_width = col_width.inject(0, :+)
end
-
+
# title
pdf.SetFontStyle('B',11)
pdf.RDMCell(190, 8, title)
@@ -305,7 +307,7 @@
if query.grouped? &&
(group = query.group_by_column.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')
@@ -317,10 +319,10 @@
end
previous_group = group
end
-
+
# fetch row values
col_values = fetch_row_values(issue, query, level)
-
+
# make new page if it doesn't fit on the current one
base_y = pdf.get_y
max_height = get_issues_to_pdf_write_cells(pdf, col_values, col_width)
@@ -330,11 +332,11 @@
render_table_header(pdf, query, col_width, row_height, table_width)
base_y = pdf.get_y
end
-
+
# write the cells on page
issues_to_pdf_write_cells(pdf, col_values, col_width, max_height)
pdf.set_y(base_y + max_height)
-
+
if query.has_column?(:description) && issue.description?
pdf.set_x(10)
pdf.set_auto_page_break(true, bottom_margin)
@@ -349,7 +351,7 @@
pdf.set_auto_page_break(false)
end
end
-
+
if issues.size == Setting.issues_export_limit.to_i
pdf.SetFontStyle('B',10)
pdf.RDMCell(0, row_height, '...')
Index: lib/redmine/export/pdf/wiki_pdf_helper.rb
===================================================================
--- lib/redmine/export/pdf/wiki_pdf_helper.rb (revision 16900)
+++ lib/redmine/export/pdf/wiki_pdf_helper.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# encoding: utf-8
#
# Redmine - project management software
Index: lib/redmine/field_format.rb
===================================================================
--- lib/redmine/field_format.rb (revision 16900)
+++ lib/redmine/field_format.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -183,7 +184,7 @@
def parse_keyword(custom_field, keyword, &block)
separator = Regexp.escape ","
- keyword = keyword.to_s
+ keyword = keyword.to_s.dup
if custom_field.multiple?
values = []
Index: lib/redmine/helpers/calendar.rb
===================================================================
--- lib/redmine/helpers/calendar.rb (revision 16900)
+++ lib/redmine/helpers/calendar.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/helpers/diff.rb
===================================================================
--- lib/redmine/helpers/diff.rb (revision 16900)
+++ lib/redmine/helpers/diff.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -44,7 +45,7 @@
add_at = nil
add_to = nil
del_at = nil
- deleted = ""
+ deleted = ''.dup
diff.each do |change|
pos = change[1]
if change[0] == "+"
Index: lib/redmine/helpers/gantt.rb
===================================================================
--- lib/redmine/helpers/gantt.rb (revision 16900)
+++ lib/redmine/helpers/gantt.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -74,8 +75,8 @@
end
@date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 1
- @subjects = ''
- @lines = ''
+ @subjects = ''.dup
+ @lines = ''.dup
@number_of_rows = nil
@truncated = false
if options.has_key?(:max_rows)
@@ -196,8 +197,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 = ''.dup unless options[:only] == :lines
+ @lines = ''.dup unless options[:only] == :subjects
@number_of_rows = 0
begin
Project.project_tree(projects) do |project, level|
@@ -650,7 +651,7 @@
case object
when Issue
issue = object
- css_classes = ''
+ css_classes = ''.dup
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 +662,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 = ''.dup.html_safe
if issue.assigned_to.present?
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
s << view.avatar(issue.assigned_to,
@@ -673,7 +674,7 @@
view.content_tag(:span, s, :class => css_classes).html_safe
when Version
version = object
- html_class = ""
+ html_class = ''.dup
html_class << 'icon icon-package '
html_class << (version.behind_schedule? ? 'version-behind-schedule' : '') << " "
html_class << (version.overdue? ? 'version-overdue' : '')
@@ -688,7 +689,7 @@
view.content_tag(:span, s, :class => html_class).html_safe
when Project
project = object
- html_class = ""
+ html_class = ''.dup
html_class << 'icon icon-projects '
html_class << (project.overdue? ? 'project-overdue' : '')
s = view.link_to_project(project).html_safe
@@ -697,7 +698,8 @@
end
def html_subject(params, subject, object)
- style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
+ style = ''.dup
+ style << "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
content = html_subject_content(object) || subject
tag_options = {:style => style}
@@ -749,7 +751,7 @@
end
def html_task(params, coords, markers, label, object)
- output = ''
+ output = ''.dup
css = "task " + case object
when Project
@@ -765,7 +767,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 = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -783,7 +785,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 = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -793,7 +795,7 @@
end
if coords[:bar_progress_end]
width = coords[:bar_progress_end] - coords[:bar_start] - 2
- style = ""
+ style = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
style << "width:#{width}px;"
@@ -808,7 +810,7 @@
# Renders the markers
if markers
if coords[:start]
- style = ""
+ style = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{coords[:start]}px;"
style << "width:15px;"
@@ -817,7 +819,7 @@
:class => "#{css} marker starting")
end
if coords[:end]
- style = ""
+ style = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{coords[:end] + params[:zoom]}px;"
style << "width:15px;"
@@ -828,7 +830,7 @@
end
# Renders the label on the right
if label
- style = ""
+ style = ''.dup
style << "top:#{params[:top]}px;"
style << "left:#{(coords[:bar_end] || 0) + 8}px;"
style << "width:15px;"
@@ -841,7 +843,7 @@
s = view.content_tag(:span,
view.render_issue_tooltip(object).html_safe,
:class => "tip")
- style = ""
+ style = ''.dup
style << "position: absolute;"
style << "top:#{params[:top]}px;"
style << "left:#{coords[:bar_start]}px;"
Index: lib/redmine/helpers/time_report.rb
===================================================================
--- lib/redmine/helpers/time_report.rb (revision 16900)
+++ lib/redmine/helpers/time_report.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -56,7 +57,7 @@
end
@hours << h
end
-
+
@hours.each do |row|
case @columns
when 'year'
@@ -69,13 +70,13 @@
row['day'] = "#{row['spent_on']}"
end
end
-
+
min = @hours.collect {|row| row['spent_on']}.min
@from = min ? min.to_date : User.current.today
max = @hours.collect {|row| row['spent_on']}.max
@to = max ? max.to_date : User.current.today
-
+
@total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
@periods = []
Index: lib/redmine/helpers/url.rb
===================================================================
--- lib/redmine/helpers/url.rb (revision 16900)
+++ lib/redmine/helpers/url.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -24,7 +25,7 @@
# URLs relative to the current document or document root (without a protocol
# separator, should be harmless
return true unless uri.to_s.include? ":"
-
+
# Other URLs need to be parsed
schemes.include? URI.parse(uri).scheme
rescue URI::InvalidURIError
Index: lib/redmine/hook.rb
===================================================================
--- lib/redmine/hook.rb (revision 16900)
+++ lib/redmine/hook.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/hook/listener.rb
===================================================================
--- lib/redmine/hook/listener.rb (revision 16900)
+++ lib/redmine/hook/listener.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/hook/view_listener.rb
===================================================================
--- lib/redmine/hook/view_listener.rb (revision 16900)
+++ lib/redmine/hook/view_listener.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -65,11 +66,11 @@
end
end
end
-
+
def controller
nil
end
-
+
def config
ActionController::Base.config
end
Index: lib/redmine/i18n.rb
===================================================================
--- lib/redmine/i18n.rb (revision 16900)
+++ lib/redmine/i18n.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -61,7 +62,7 @@
# Localizes the given args with user's language
def lu(user, *args)
lang = user.try(:language).presence || Setting.default_language
- ll(lang, *args)
+ ll(lang, *args)
end
def format_date(date)
Index: lib/redmine/imap.rb
===================================================================
--- lib/redmine/imap.rb (revision 16900)
+++ lib/redmine/imap.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/info.rb
===================================================================
--- lib/redmine/info.rb (revision 16900)
+++ lib/redmine/info.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Redmine
module Info
class << self
@@ -7,7 +8,7 @@
def versioned_name; "#{app_name} #{Redmine::VERSION}" end
def environment
- s = "Environment:\n"
+ s = "Environment:\n".dup
s << [
["Redmine version", Redmine::VERSION],
["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
Index: lib/redmine/menu_manager.rb
===================================================================
--- lib/redmine/menu_manager.rb (revision 16900)
+++ lib/redmine/menu_manager.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/mime_type.rb
===================================================================
--- lib/redmine/mime_type.rb (revision 16900)
+++ lib/redmine/mime_type.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/my_page.rb
===================================================================
--- lib/redmine/my_page.rb (revision 16900)
+++ lib/redmine/my_page.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/nested_set/issue_nested_set.rb
===================================================================
--- lib/redmine/nested_set/issue_nested_set.rb (revision 16900)
+++ lib/redmine/nested_set/issue_nested_set.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -84,7 +85,7 @@
if parent
previous_root_id = root_id
self.root_id = parent.root_id
-
+
lft_after_move = target_lft
self.class.where(:root_id => parent.root_id).update_all([
"lft = CASE WHEN lft >= :lft THEN lft + :shift ELSE lft END, " +
@@ -91,12 +92,12 @@
"rgt = CASE WHEN rgt >= :lft THEN rgt + :shift ELSE rgt END",
{:lft => lft_after_move, :shift => (rgt - lft + 1)}
])
-
+
self.class.where(:root_id => previous_root_id).update_all([
"root_id = :root_id, lft = lft + :shift, rgt = rgt + :shift",
{:root_id => parent.root_id, :shift => lft_after_move - lft}
])
-
+
self.lft, self.rgt = lft_after_move, (rgt - lft + lft_after_move)
parent.send :reload_nested_set_values
end
@@ -105,7 +106,7 @@
def remove_from_nested_set
self.class.where(:root_id => root_id).where("lft >= ? AND rgt <= ?", lft, rgt).
update_all(["root_id = :id, lft = lft - :shift, rgt = rgt - :shift", {:id => id, :shift => lft - 1}])
-
+
self.class.where(:root_id => root_id).update_all([
"lft = CASE WHEN lft >= :lft THEN lft - :shift ELSE lft END, " +
"rgt = CASE WHEN rgt >= :lft THEN rgt - :shift ELSE rgt END",
Index: lib/redmine/nested_set/project_nested_set.rb
===================================================================
--- lib/redmine/nested_set/project_nested_set.rb (revision 16900)
+++ lib/redmine/nested_set/project_nested_set.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/nested_set/traversing.rb
===================================================================
--- lib/redmine/nested_set/traversing.rb (revision 16900)
+++ lib/redmine/nested_set/traversing.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/notifiable.rb
===================================================================
--- lib/redmine/notifiable.rb (revision 16900)
+++ lib/redmine/notifiable.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Redmine
class Notifiable < Struct.new(:name, :parent)
Index: lib/redmine/pagination.rb
===================================================================
--- lib/redmine/pagination.rb (revision 16900)
+++ lib/redmine/pagination.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# encoding: utf-8
#
# Redmine - project management software
@@ -159,7 +160,7 @@
per_page_links = false if count.nil?
page_param = paginator.page_param
- html = '
'
+ html = ''.dup
if paginator.multiple_pages?
# \xc2\xab(utf-8) = «
Index: lib/redmine/platform.rb
===================================================================
--- lib/redmine/platform.rb (revision 16900)
+++ lib/redmine/platform.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/plugin.rb
===================================================================
--- lib/redmine/plugin.rb (revision 16900)
+++ lib/redmine/plugin.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -367,7 +368,7 @@
# * :label - label for the formatter displayed in application settings
#
# Examples:
- # wiki_format_provider(:custom_formatter, CustomFormatter, :label => "My custom formatter")
+ # wiki_format_provider(:custom_formatter, CustomFormatter, :label => "My custom formatter")
#
def wiki_format_provider(name, *args)
Redmine::WikiFormatting.register(name, *args)
Index: lib/redmine/pop3.rb
===================================================================
--- lib/redmine/pop3.rb (revision 16900)
+++ lib/redmine/pop3.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/safe_attributes.rb
===================================================================
--- lib/redmine/safe_attributes.rb (revision 16900)
+++ lib/redmine/safe_attributes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -32,7 +33,7 @@
@safe_attributes ||= []
if args.empty?
if superclass.include?(Redmine::SafeAttributes)
- @safe_attributes + superclass.safe_attributes
+ @safe_attributes + superclass.safe_attributes
else
@safe_attributes
end
Index: lib/redmine/scm/adapters.rb
===================================================================
--- lib/redmine/scm/adapters.rb (revision 16900)
+++ lib/redmine/scm/adapters.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/abstract_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/abstract_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/abstract_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -211,7 +212,7 @@
path = Redmine::Configuration['scm_stderr_log_file'].presence
path ||= Rails.root.join("log/#{Rails.env}.scm.stderr.log").to_s
if File.exists?(path)
- if File.file?(path) && File.writable?(path)
+ if File.file?(path) && File.writable?(path)
writable = true
else
logger.warn("SCM log file (#{path}) is not writable")
Index: lib/redmine/scm/adapters/bazaar_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/bazaar_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/bazaar_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -301,7 +302,7 @@
full_args_locale << scm_iconv(@path_encoding, 'UTF-8', e)
end
ret = shellout(
- self.class.sq_bin + ' ' +
+ self.class.sq_bin + ' ' +
full_args_locale.map { |e| shell_quote e.to_s }.join(' '),
&block
)
@@ -320,7 +321,7 @@
full_args_locale << scm_iconv(@path_encoding, 'UTF-8', e)
end
ret = shellout(
- self.class.sq_bin + ' ' +
+ self.class.sq_bin + ' ' +
full_args_locale.map { |e| shell_quote e.to_s }.join(' '),
&block
)
Index: lib/redmine/scm/adapters/command_failed.rb
===================================================================
--- lib/redmine/scm/adapters/command_failed.rb (revision 16900)
+++ lib/redmine/scm/adapters/command_failed.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/cvs_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/cvs_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/cvs_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/filesystem_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/filesystem_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/filesystem_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/git_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/git_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/git_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/mercurial_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/mercurial_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/mercurial_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/adapters/subversion_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/subversion_adapter.rb (revision 16900)
+++ lib/redmine/scm/adapters/subversion_adapter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: trues
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/scm/base.rb
===================================================================
--- lib/redmine/scm/base.rb (revision 16900)
+++ lib/redmine/scm/base.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Redmine
module Scm
class Base
Index: lib/redmine/search.rb
===================================================================
--- lib/redmine/search.rb (revision 16900)
+++ lib/redmine/search.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -82,13 +83,13 @@
# Returns the results for the given offset and limit
def results(offset, limit)
result_ids_to_load = result_ids[offset, limit] || []
-
+
results_by_scope = Hash.new {|h,k| h[k] = []}
result_ids_to_load.group_by(&:first).each do |scope, scope_and_ids|
klass = scope.singularize.camelcase.constantize
results_by_scope[scope] += klass.search_results_from_ids(scope_and_ids.map(&:last))
end
-
+
result_ids_to_load.map do |scope, id|
results_by_scope[scope].detect {|record| record.id == id}
end.compact
@@ -110,7 +111,7 @@
cache_key = ActiveSupport::Cache.expand_cache_key(
[@question, @user.id, @scope.sort, @options, project_ids.sort]
)
-
+
Redmine::Search.cache_store.fetch(cache_key, :force => !@cache) do
load_result_ids
end
Index: lib/redmine/sort_criteria.rb
===================================================================
--- lib/redmine/sort_criteria.rb (revision 16900)
+++ lib/redmine/sort_criteria.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/subclass_factory.rb
===================================================================
--- lib/redmine/subclass_factory.rb (revision 16900)
+++ lib/redmine/subclass_factory.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/sudo_mode.rb
===================================================================
--- lib/redmine/sudo_mode.rb (revision 16900)
+++ lib/redmine/sudo_mode.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require 'active_support/core_ext/object/to_query'
require 'rack/utils'
Index: lib/redmine/syntax_highlighting.rb
===================================================================
--- lib/redmine/syntax_highlighting.rb (revision 16900)
+++ lib/redmine/syntax_highlighting.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/themes.rb
===================================================================
--- lib/redmine/themes.rb (revision 16900)
+++ lib/redmine/themes.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -121,7 +122,7 @@
end
@current_theme
end
-
+
# Returns the header tags for the current theme
def heads_for_theme
if current_theme && current_theme.javascripts.include?('theme')
Index: lib/redmine/thumbnail.rb
===================================================================
--- lib/redmine/thumbnail.rb (revision 16900)
+++ lib/redmine/thumbnail.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/unified_diff.rb
===================================================================
--- lib/redmine/unified_diff.rb (revision 16900)
+++ lib/redmine/unified_diff.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -267,7 +268,7 @@
def line_to_html_raw(line, offsets)
if offsets
- s = ''
+ s = ''.dup
unless offsets.first == 0
s << CGI.escapeHTML(line[0..offsets.first-1])
end
Index: lib/redmine/utils.rb
===================================================================
--- lib/redmine/utils.rb (revision 16900)
+++ lib/redmine/utils.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/version.rb
===================================================================
--- lib/redmine/version.rb (revision 16900)
+++ lib/redmine/version.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require 'rexml/document'
module Redmine
Index: lib/redmine/views/api_template_handler.rb
===================================================================
--- lib/redmine/views/api_template_handler.rb (revision 16900)
+++ lib/redmine/views/api_template_handler.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/builders.rb
===================================================================
--- lib/redmine/views/builders.rb (revision 16900)
+++ lib/redmine/views/builders.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/builders/json.rb
===================================================================
--- lib/redmine/views/builders/json.rb (revision 16900)
+++ lib/redmine/views/builders/json.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/builders/structure.rb
===================================================================
--- lib/redmine/views/builders/structure.rb (revision 16900)
+++ lib/redmine/views/builders/structure.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/builders/xml.rb
===================================================================
--- lib/redmine/views/builders/xml.rb (revision 16900)
+++ lib/redmine/views/builders/xml.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/labelled_form_builder.rb
===================================================================
--- lib/redmine/views/labelled_form_builder.rb (revision 16900)
+++ lib/redmine/views/labelled_form_builder.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/views/other_formats_builder.rb
===================================================================
--- lib/redmine/views/other_formats_builder.rb (revision 16900)
+++ lib/redmine/views/other_formats_builder.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting.rb
===================================================================
--- lib/redmine/wiki_formatting.rb (revision 16900)
+++ lib/redmine/wiki_formatting.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/html_parser.rb
===================================================================
--- lib/redmine/wiki_formatting/html_parser.rb (revision 16900)
+++ lib/redmine/wiki_formatting/html_parser.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/macros.rb
===================================================================
--- lib/redmine/wiki_formatting/macros.rb (revision 16900)
+++ lib/redmine/wiki_formatting/macros.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -67,7 +68,7 @@
# macro :my_macro do |obj, args|
# "My macro output"
# end
- #
+ #
# desc "This is my macro that accepts a block of text"
# macro :my_macro do |obj, args, text|
# "My macro output"
@@ -81,7 +82,7 @@
#
# Options:
# * :desc - A description of the macro
- # * :parse_args => false - Disables arguments parsing (the whole arguments
+ # * :parse_args => false - Disables arguments parsing (the whole arguments
# string is passed to the macro)
#
# Macro blocks accept 2 or 3 arguments:
@@ -89,7 +90,7 @@
# * args: macro arguments
# * text: the block of text given to the macro (should be present only if the
# macro accepts a block of text). text is a String or nil if the macro is
- # invoked without a block of text.
+ # invoked without a block of text.
#
# Examples:
# By default, when the macro is invoked, the comma separated list of arguments
@@ -162,7 +163,7 @@
# Builtin macros
desc "Sample macro."
macro :hello_world do |obj, args, text|
- h("Hello world! Object: #{obj.class.name}, " +
+ h("Hello world! Object: #{obj.class.name}, " +
(args.empty? ? "Called with no argument" : "Arguments: #{args.join(', ')}") +
" and " + (text.present? ? "a #{text.size} bytes long block of text." : "no block of text.")
)
Index: lib/redmine/wiki_formatting/markdown/formatter.rb
===================================================================
--- lib/redmine/wiki_formatting/markdown/formatter.rb (revision 16900)
+++ lib/redmine/wiki_formatting/markdown/formatter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/markdown/helper.rb
===================================================================
--- lib/redmine/wiki_formatting/markdown/helper.rb (revision 16900)
+++ lib/redmine/wiki_formatting/markdown/helper.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/markdown/html_parser.rb
===================================================================
--- lib/redmine/wiki_formatting/markdown/html_parser.rb (revision 16900)
+++ lib/redmine/wiki_formatting/markdown/html_parser.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/textile/formatter.rb
===================================================================
--- lib/redmine/wiki_formatting/textile/formatter.rb (revision 16900)
+++ lib/redmine/wiki_formatting/textile/formatter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -62,9 +63,9 @@
@pre_list = []
text = self.dup
rip_offtags text, false, false
- before = ''
- s = ''
- after = ''
+ before = ''.dup
+ s = ''.dup
+ after = ''.dup
i = 0
l = 1
started = false
Index: lib/redmine/wiki_formatting/textile/helper.rb
===================================================================
--- lib/redmine/wiki_formatting/textile/helper.rb (revision 16900)
+++ lib/redmine/wiki_formatting/textile/helper.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: lib/redmine/wiki_formatting/textile/html_parser.rb
===================================================================
--- lib/redmine/wiki_formatting/textile/html_parser.rb (revision 16900)
+++ lib/redmine/wiki_formatting/textile/html_parser.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/application_system_test_case.rb
===================================================================
--- test/application_system_test_case.rb (revision 16900)
+++ test/application_system_test_case.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/coverage/html_formatter.rb
===================================================================
--- test/coverage/html_formatter.rb (revision 16900)
+++ test/coverage/html_formatter.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/extra/redmine_pm/repository_git_test_pm.rb
===================================================================
--- test/extra/redmine_pm/repository_git_test_pm.rb (revision 16900)
+++ test/extra/redmine_pm/repository_git_test_pm.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/extra/redmine_pm/repository_subversion_test_pm.rb
===================================================================
--- test/extra/redmine_pm/repository_subversion_test_pm.rb (revision 16900)
+++ test/extra/redmine_pm/repository_subversion_test_pm.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -254,13 +255,13 @@
ldap_user = User.new(:mail => 'example1@redmine.org', :firstname => 'LDAP', :lastname => 'user', :auth_source_id => 1)
ldap_user.login = 'example1'
ldap_user.save!
-
+
with_settings :login_required => '1' do
with_credentials "example1", "123456" do
assert_success "ls", svn_url
end
end
-
+
with_settings :login_required => '1' do
with_credentials "example1", "wrong" do
assert_failure "ls", svn_url
Index: test/extra/redmine_pm/test_case.rb
===================================================================
--- test/extra/redmine_pm/test_case.rb (revision 16900)
+++ test/extra/redmine_pm/test_case.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/account_controller_openid_test.rb
===================================================================
--- test/functional/account_controller_openid_test.rb (revision 16900)
+++ test/functional/account_controller_openid_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -168,7 +169,7 @@
:lastname => 'User',
:mail => 'user@somedomain.com',
:identity_url => 'http://openid.example.com/good_blank_user'
-
+
}
}
assert_response 302
Index: test/functional/account_controller_test.rb
===================================================================
--- test/functional/account_controller_test.rb (revision 16900)
+++ test/functional/account_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -301,7 +302,7 @@
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
-
+
}
}
assert_redirected_to '/my/account'
@@ -315,7 +316,7 @@
assert user.active?
end
end
-
+
def test_post_register_with_registration_off_should_redirect
with_settings :self_registration => '0' do
assert_no_difference 'User.count' do
@@ -327,7 +328,7 @@
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
-
+
}
}
assert_redirected_to '/'
@@ -346,11 +347,11 @@
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
-
- },
+
+ },
:pref => {
:hide_mail => '1'
-
+
}
}
end
Index: test/functional/activities_controller_test.rb
===================================================================
--- test/functional/activities_controller_test.rb (revision 16900)
+++ test/functional/activities_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -141,7 +142,7 @@
:show_issues => '1'
}
assert_response :success
-
+
assert_select 'title', :text => /Issues/
end
end
Index: test/functional/admin_controller_test.rb
===================================================================
--- test/functional/admin_controller_test.rb (revision 16900)
+++ test/functional/admin_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/attachments_controller_test.rb
===================================================================
--- test/functional/attachments_controller_test.rb (revision 16900)
+++ test/functional/attachments_controller_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -143,7 +144,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".dup.force_encoding('UTF-8')
get :show, :params => {
:id => a.id
Index: test/functional/auth_sources_controller_test.rb
===================================================================
--- test/functional/auth_sources_controller_test.rb (revision 16900)
+++ test/functional/auth_sources_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/auto_completes_controller_test.rb
===================================================================
--- test/functional/auto_completes_controller_test.rb (revision 16900)
+++ test/functional/auto_completes_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/boards_controller_test.rb
===================================================================
--- test/functional/boards_controller_test.rb (revision 16900)
+++ test/functional/boards_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/calendars_controller_test.rb
===================================================================
--- test/functional/calendars_controller_test.rb (revision 16900)
+++ test/functional/calendars_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/comments_controller_test.rb
===================================================================
--- test/functional/comments_controller_test.rb (revision 16900)
+++ test/functional/comments_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -29,7 +30,7 @@
post :create, :params => {
:id => 1,
:comment => {
- :comments => 'This is a test comment'
+ :comments => 'This is a test comment'
}
}
assert_redirected_to '/news/1'
@@ -46,7 +47,7 @@
post :create, :params => {
:id => 1,
:comment => {
- :comments => ''
+ :comments => ''
}
}
assert_response :redirect
@@ -61,7 +62,7 @@
post :create, :params => {
:id => 1,
:comment => {
- :comments => 'This is a test comment'
+ :comments => 'This is a test comment'
}
}
assert_response 403
Index: test/functional/context_menus_controller_test.rb
===================================================================
--- test/functional/context_menus_controller_test.rb (revision 16900)
+++ test/functional/context_menus_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -316,7 +317,7 @@
def test_time_entries_context_menu_without_edit_permission
@request.session[:user_id] = 2
Role.find_by_name('Manager').remove_permission! :edit_time_entries
-
+
get :time_entries, :params => {
:ids => [1, 2]
}
Index: test/functional/custom_field_enumerations_controller_test.rb
===================================================================
--- test/functional/custom_field_enumerations_controller_test.rb (revision 16900)
+++ test/functional/custom_field_enumerations_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -45,7 +46,7 @@
post :create, :params => {
:custom_field_id => @field.id,
:custom_field_enumeration => {
- :name => 'Baz'
+ :name => 'Baz'
}
}
assert_redirected_to "/custom_fields/#{@field.id}/enumerations"
@@ -63,7 +64,7 @@
post :create, :params => {
:custom_field_id => @field.id,
:custom_field_enumeration => {
- :name => 'Baz'
+ :name => 'Baz'
}
},
:xhr => true
@@ -79,13 +80,13 @@
:position => "1",
:name => "Baz",
:active => "1"
- },
+ },
@foo.id.to_s => {
:position => "2",
:name => "Foo",
:active => "0"
- }
-
+ }
+
}
}
assert_response 302
Index: test/functional/custom_fields_controller_test.rb
===================================================================
--- test/functional/custom_fields_controller_test.rb (revision 16900)
+++ test/functional/custom_fields_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -191,7 +192,7 @@
:type => 'IssueCustomField',
:custom_field => {
:field_format => 'list'
- },
+ },
:format => 'js'
},
:xhr => true
@@ -245,7 +246,7 @@
:field_format => "string",
:is_for_all => "0",
:project_ids => ["1", "3", ""]
-
+
}
}
assert_response 302
Index: test/functional/documents_controller_test.rb
===================================================================
--- test/functional/documents_controller_test.rb (revision 16900)
+++ test/functional/documents_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -118,10 +119,10 @@
:title => 'DocumentsControllerTest#test_post_new',
:description => 'This is a new document',
:category_id => 2
- },
+ },
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
@@ -159,7 +160,7 @@
:document => {
:title => 'no default',
:description => 'This is a new document',
- :category_id => category1.id
+ :category_id => category1.id
}
}
assert_redirected_to '/projects/ecookbook/documents'
@@ -220,7 +221,7 @@
:id => 1,
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
Index: test/functional/email_addresses_controller_test.rb
===================================================================
--- test/functional/email_addresses_controller_test.rb (revision 16900)
+++ test/functional/email_addresses_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/enumerations_controller_test.rb
===================================================================
--- test/functional/enumerations_controller_test.rb (revision 16900)
+++ test/functional/enumerations_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/files_controller_test.rb
===================================================================
--- test/functional/files_controller_test.rb (revision 16900)
+++ test/functional/files_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -82,7 +83,7 @@
:version_id => '',
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
assert_response :redirect
@@ -109,7 +110,7 @@
:version_id => '2',
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
assert_response :redirect
Index: test/functional/gantts_controller_test.rb
===================================================================
--- test/functional/gantts_controller_test.rb (revision 16900)
+++ test/functional/gantts_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/groups_controller_test.rb
===================================================================
--- test/functional/groups_controller_test.rb (revision 16900)
+++ test/functional/groups_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -86,7 +87,7 @@
post :create, :params => {
:group => {
:name => 'New group'
- },
+ },
:continue => 'Create and continue'
}
end
Index: test/functional/imports_controller_test.rb
===================================================================
--- test/functional/imports_controller_test.rb (revision 16900)
+++ test/functional/imports_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -172,7 +173,7 @@
:mapping => {
:project_id => '1',
:tracker_id => '2',
- :subject => '0'}
+ :subject => '0'}
}
}
assert_redirected_to "/imports/#{import.to_param}/run"
@@ -183,7 +184,7 @@
assert_equal '2', mapping['tracker_id']
assert_equal '0', mapping['subject']
end
-
+
def test_get_run
import = generate_import_with_mapping
@@ -193,7 +194,7 @@
assert_response :success
assert_select '#import-progress'
end
-
+
def test_post_run_should_import_the_file
import = generate_import_with_mapping
Index: test/functional/issue_categories_controller_test.rb
===================================================================
--- test/functional/issue_categories_controller_test.rb (revision 16900)
+++ test/functional/issue_categories_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -123,7 +124,7 @@
put :update, :params => {
:id => 2,
:issue_category => {
- :name => 'Testing'
+ :name => 'Testing'
}
}
end
@@ -135,7 +136,7 @@
put :update, :params => {
:id => 2,
:issue_category => {
- :name => ''
+ :name => ''
}
}
assert_response :success
@@ -146,7 +147,7 @@
put :update, :params => {
:id => 97,
:issue_category => {
- :name => 'Testing'
+ :name => 'Testing'
}
}
assert_response 404
Index: test/functional/issue_relations_controller_test.rb
===================================================================
--- test/functional/issue_relations_controller_test.rb (revision 16900)
+++ test/functional/issue_relations_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/issue_statuses_controller_test.rb
===================================================================
--- test/functional/issue_statuses_controller_test.rb (revision 16900)
+++ test/functional/issue_statuses_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -30,13 +31,13 @@
assert_response :success
assert_select 'table.issue_statuses'
end
-
+
def test_index_by_anonymous_should_redirect_to_login_form
@request.session[:user_id] = nil
get :index
assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fissue_statuses'
end
-
+
def test_index_by_user_should_respond_with_406
@request.session[:user_id] = 2
get :index
Index: test/functional/issues_controller_test.rb
===================================================================
--- test/functional/issues_controller_test.rb (revision 16900)
+++ test/functional/issues_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -705,8 +706,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".dup.force_encoding('UTF-8')
+ str_big5 = "\xa4@\xa4\xeb".dup.force_encoding('Big5')
issue = Issue.generate!(:subject => str_utf8)
get :index, :params => {
@@ -717,7 +718,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".dup.force_encoding('Big5')
assert_include status, header
issue_line = lines.find {|l| l =~ /^#{issue.id},/}
assert_include str_big5, issue_line
@@ -726,7 +727,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".dup.force_encoding('UTF-8')
issue = Issue.generate!(:subject => str_utf8)
get :index, :params => {
@@ -740,10 +741,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".dup.force_encoding('Big5') # status
assert header.include?(s1)
s2 = issue_line.split(",")[2]
- s3 = "\xa5H?".force_encoding('Big5') # subject
+ s3 = "\xa5H?".dup.force_encoding('Big5') # subject
assert_equal s3, s2
end
end
@@ -2181,8 +2182,7 @@
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".dup.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/issues_controller_transaction_test.rb
===================================================================
--- test/functional/issues_controller_transaction_test.rb (revision 16900)
+++ test/functional/issues_controller_transaction_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -62,12 +63,12 @@
:fixed_version_id => 4,
:notes => 'My notes',
:lock_version => (issue.lock_version - 1)
-
- },
+
+ },
:time_entry => {
:hours => '2.5',
:comments => '',
- :activity_id => TimeEntryActivity.first.id
+ :activity_id => TimeEntryActivity.first.id
}
}
end
@@ -98,16 +99,16 @@
:fixed_version_id => 4,
:notes => 'My notes',
:lock_version => (issue.lock_version - 1)
-
- },
+
+ },
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
- },
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ },
:time_entry => {
:hours => '2.5',
:comments => '',
- :activity_id => TimeEntryActivity.first.id
+ :activity_id => TimeEntryActivity.first.id
}
}
end
@@ -131,7 +132,7 @@
:fixed_version_id => 4,
:notes => '',
:lock_version => (issue.lock_version - 1)
-
+
}
}
assert_response :success
@@ -151,8 +152,8 @@
:fixed_version_id => 4,
:notes => '',
:lock_version => 2
-
- },
+
+ },
:last_journal_id => 1
}
assert_response :success
@@ -170,8 +171,8 @@
:fixed_version_id => 4,
:notes => '',
:lock_version => 2
-
- },
+
+ },
:last_journal_id => ''
}
assert_response :success
@@ -190,7 +191,7 @@
:issue => {
:fixed_version_id => 4,
:lock_version => 2
- },
+ },
:last_journal_id => ''
}
assert_response :success
@@ -202,7 +203,7 @@
:issue => {
:fixed_version_id => 4,
:lock_version => 2
- },
+ },
:last_journal_id => ''
}
assert_response :success
@@ -219,8 +220,8 @@
:fixed_version_id => 4,
:notes => 'overwrite_conflict_resolution',
:lock_version => 2
-
- },
+
+ },
:conflict_resolution => 'overwrite'
}
end
@@ -243,8 +244,8 @@
:fixed_version_id => 4,
:notes => 'add_notes_conflict_resolution',
:lock_version => 2
-
- },
+
+ },
:conflict_resolution => 'add_notes'
}
end
@@ -269,8 +270,8 @@
:notes => 'add_privates_notes_conflict_resolution',
:private_notes => '1',
:lock_version => 2
-
- },
+
+ },
:conflict_resolution => 'add_notes'
}
end
@@ -291,8 +292,8 @@
:fixed_version_id => 4,
:notes => 'add_notes_conflict_resolution',
:lock_version => 2
-
- },
+
+ },
:conflict_resolution => 'cancel'
}
end
@@ -309,12 +310,12 @@
put :update, :params => {
:id => 1,
:issue => {
- :subject => ''
- },
+ :subject => ''
+ },
:time_entry => {
:hours => '2.5',
:comments => 'should not be added',
- :activity_id => TimeEntryActivity.first.id
+ :activity_id => TimeEntryActivity.first.id
}
}
assert_response :success
Index: test/functional/issues_custom_fields_visibility_test.rb
===================================================================
--- test/functional/issues_custom_fields_visibility_test.rb (revision 16900)
+++ test/functional/issues_custom_fields_visibility_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -169,8 +170,8 @@
:id => @issue.id,
:issue => {
:custom_field_values => {
- @field1.id.to_s => "User#{user.id}Value0",
- @field2.id.to_s => "User#{user.id}Value1",
+ @field1.id.to_s => "User#{user.id}Value0",
+ @field2.id.to_s => "User#{user.id}Value1",
@field3.id.to_s => "User#{user.id}Value2",
}
}
@@ -274,9 +275,9 @@
:priority_id => 5,
:custom_field_values => {
@field1.id.to_s => 'Value0', @field2.id.to_s => 'Value1', @field3.id.to_s => 'Value2'
- },
+ },
:watcher_user_ids => users_to_test.keys.map(&:id)
-
+
}
}
assert_response 302
@@ -313,8 +314,8 @@
:issue => {
:custom_field_values => {
@field1.id.to_s => 'NewValue0', @field2.id.to_s => 'NewValue1', @field3.id.to_s => 'NewValue2'
- }
-
+ }
+
}
}
assert_response 302
@@ -350,8 +351,8 @@
:issue => {
:custom_field_values => {
@field2.id.to_s => 'NewValue1', @field3.id.to_s => 'NewValue2'
- }
-
+ }
+
}
}
assert_response 302
Index: test/functional/journals_controller_test.rb
===================================================================
--- test/functional/journals_controller_test.rb (revision 16900)
+++ test/functional/journals_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/mail_handler_controller_test.rb
===================================================================
--- test/functional/mail_handler_controller_test.rb (revision 16900)
+++ test/functional/mail_handler_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/members_controller_test.rb
===================================================================
--- test/functional/members_controller_test.rb (revision 16900)
+++ test/functional/members_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/messages_controller_test.rb
===================================================================
--- test/functional/messages_controller_test.rb (revision 16900)
+++ test/functional/messages_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -33,7 +34,7 @@
assert_select 'h2', :text => 'First post'
end
-
+
def test_show_should_contain_reply_field_tags_for_quoting
@request.session[:user_id] = 2
get :show, :params => {
@@ -214,7 +215,7 @@
:id => 1,
:reply => {
:content => 'This is a test reply',
- :subject => 'Test reply'
+ :subject => 'Test reply'
}
}
reply = Message.order('id DESC').first
Index: test/functional/my_controller_test.rb
===================================================================
--- test/functional/my_controller_test.rb (revision 16900)
+++ test/functional/my_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -95,7 +96,7 @@
assert_select 'table.issues.sort-by-due-date'
end
end
-
+
def test_page_with_issuequery_block_and_no_settings
user = User.find(2)
user.pref.my_page_layout = {'top' => ['issuequery']}
@@ -246,8 +247,8 @@
:group_ids => ['10'],
:custom_field_values => {
"4" => "0100562500"
- }
-
+ }
+
}
}
@@ -266,7 +267,7 @@
post :account, :params => {
:user => {
:mail => 'foobar@example.com'
-
+
}
}
@@ -393,7 +394,7 @@
post :update_page, :params => {
:settings => {
'issuesassignedtome' => {
- 'columns' => ['subject', 'due_date']}
+ 'columns' => ['subject', 'due_date']}
}
},
:xhr => true
@@ -450,7 +451,7 @@
pref = User.find(2).pref
pref.my_page_layout = {'left' => ['news', 'calendar','documents']}
pref.save!
-
+
post :order_blocks, :params => {
:group => 'left',
:blocks => ['documents', 'calendar', 'news']
@@ -464,7 +465,7 @@
pref = User.find(2).pref
pref.my_page_layout = {'left' => ['news','documents'], 'right' => ['calendar']}
pref.save!
-
+
post :order_blocks, :params => {
:group => 'left',
:blocks => ['news', 'calendar', 'documents']
Index: test/functional/news_controller_test.rb
===================================================================
--- test/functional/news_controller_test.rb (revision 16900)
+++ test/functional/news_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -116,7 +117,7 @@
:news => {
:title => 'NewsControllerTest',
:description => 'This is the description',
- :summary => ''
+ :summary => ''
}
}
end
@@ -139,11 +140,11 @@
:project_id => 1,
:news => {
:title => 'Test',
- :description => 'This is the description'
- },
+ :description => 'This is the description'
+ },
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
@@ -160,7 +161,7 @@
:news => {
:title => '',
:description => 'This is the description',
- :summary => ''
+ :summary => ''
}
}
assert_response :success
@@ -181,7 +182,7 @@
put :update, :params => {
:id => 1,
:news => {
- :description => 'Description changed by test_post_edit'
+ :description => 'Description changed by test_post_edit'
}
}
assert_redirected_to '/news/1'
@@ -197,11 +198,11 @@
put :update, :params => {
:id => 1,
:news => {
- :description => 'This is the description'
- },
+ :description => 'This is the description'
+ },
:attachments => {
'1' => {
- 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
+ 'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
@@ -215,7 +216,7 @@
put :update, :params => {
:id => 1,
:news => {
- :description => ''
+ :description => ''
}
}
assert_response :success
Index: test/functional/previews_controller_test.rb
===================================================================
--- test/functional/previews_controller_test.rb (revision 16900)
+++ test/functional/previews_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/principal_memberships_controller_test.rb
===================================================================
--- test/functional/principal_memberships_controller_test.rb (revision 16900)
+++ test/functional/principal_memberships_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -114,7 +115,7 @@
:membership => {
:project_ids => [3],
:role_ids => [2]
- },
+ },
:format => 'js'
},
:xhr => true
@@ -134,7 +135,7 @@
:user_id => 7,
:membership => {
:project_ids => [3]
- },
+ },
:format => 'js'
},
:xhr => true
@@ -184,7 +185,7 @@
:id => 1,
:membership => {
:role_ids => [2]
- },
+ },
:format => 'js'
},
:xhr => true
Index: test/functional/project_enumerations_controller_test.rb
===================================================================
--- test/functional/project_enumerations_controller_test.rb (revision 16900)
+++ test/functional/project_enumerations_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -143,8 +144,8 @@
:enumerations => {
"9"=> {
"parent_id"=>"9", "custom_field_values"=> {
- "7" => "1"}, "active"=>"0"} # Design, De-activate
-
+ "7" => "1"}, "active"=>"0"} # Design, De-activate
+
}
}
assert_response :redirect
Index: test/functional/projects_controller_test.rb
===================================================================
--- test/functional/projects_controller_test.rb (revision 16900)
+++ test/functional/projects_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -161,8 +162,8 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:tracker_ids => ['1', '3'],
# an issue custom field that is not for all project
:issue_custom_field_ids => ['9'],
@@ -195,10 +196,10 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:parent_id => 1
-
+
}
}
assert_redirected_to '/projects/blog/settings'
@@ -217,7 +218,7 @@
:project => {
:name => "blog",
:identifier => "blog"
- },
+ },
:continue => 'Create and continue'
}
end
@@ -235,11 +236,11 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:tracker_ids => ['1', '3'],
:enabled_module_names => ['issue_tracking', 'news', 'repository']
-
+
}
}
@@ -270,10 +271,10 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:parent_id => 1
-
+
}
}
end
@@ -293,10 +294,10 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:parent_id => 1
-
+
}
}
assert_redirected_to '/projects/blog/settings'
@@ -317,9 +318,9 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- }
-
+ '3' => 'Beta'
+ }
+
}
}
end
@@ -341,10 +342,10 @@
:identifier => "blog",
:is_public => 1,
:custom_field_values => {
- '3' => 'Beta'
- },
+ '3' => 'Beta'
+ },
:parent_id => 6
-
+
}
}
end
@@ -365,7 +366,7 @@
:name => "blog1",
:identifier => "blog1",
:enabled_module_names => ["issue_tracking", "repository"]
-
+
}
}
end
@@ -378,7 +379,7 @@
:name => "blog2",
:identifier => "blog2",
:enabled_module_names => ["issue_tracking", "repository"]
-
+
}
}
end
@@ -398,7 +399,7 @@
:identifier => 'inherited',
:parent_id => parent.id,
:inherit_members => '1'
-
+
}
}
assert_response 302
@@ -420,7 +421,7 @@
:name => "blog",
:identifier => "",
:enabled_module_names => %w(issue_tracking news)
-
+
}
}
end
@@ -895,8 +896,8 @@
:identifier => 'unique-copy',
:tracker_ids => ['1', '2', '3', ''],
:enabled_module_names => %w(issue_tracking time_tracking)
-
- },
+
+ },
:only => %w(issues versions)
}
end
Index: test/functional/queries_controller_test.rb
===================================================================
--- test/functional/queries_controller_test.rb (revision 16900)
+++ test/functional/queries_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -96,10 +97,10 @@
:f => ["status_id", "assigned_to_id"],
:op => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:v => {
"assigned_to_id" => ["1"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_new_project_public_query", "visibility" => "2"
}
@@ -120,10 +121,10 @@
:fields => ["status_id", "assigned_to_id"],
:operators => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:values => {
"assigned_to_id" => ["1"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_new_project_private_query", "visibility" => "0"
}
@@ -144,10 +145,10 @@
:fields => ["status_id", "assigned_to_id"],
:operators => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:values => {
"assigned_to_id" => ["1"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_create_project_roles_query", "visibility" => "1", "role_ids" => ["1", "2", ""]
}
@@ -165,13 +166,13 @@
:fields => ["status_id", "assigned_to_id"],
:operators => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:values => {
"assigned_to_id" => ["me"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_new_global_private_query", "visibility" => "0"
- },
+ },
:c => ["", "tracker", "subject", "priority", "category"]
}
@@ -189,10 +190,10 @@
:fields => ["assigned_to_id"],
:operators => {
"assigned_to_id" => "="
- },
+ },
:values => {
"assigned_to_id" => ["me"]
- },
+ },
:query => {
"name" => "test_new_global_query"
}
@@ -212,15 +213,15 @@
:default_columns => '1',
:operators => {
"status_id" => "o"
- },
+ },
:values => {
"status_id" => ["1"]
- },
+ },
:query => {
:name => "test_new_with_sort",
:visibility => "2",
:sort_criteria => {
- "0" => ["due_date", "desc"], "1" => ["tracker", ""]}
+ "0" => ["due_date", "desc"], "1" => ["tracker", ""]}
}
}
@@ -276,10 +277,10 @@
:gantt => 1,
:operators => {
"status_id" => "o"
- },
+ },
:values => {
"status_id" => ["1"]
- },
+ },
:query => {
:name => "test_create_from_gantt",
:draw_relations => '1',
@@ -302,10 +303,10 @@
:gantt => 1,
:operators => {
"status_id" => "o"
- },
+ },
:values => {
"status_id" => ["1"]
- },
+ },
:query => {
:name => "test_create_from_gantt",
:draw_relations => '0',
@@ -409,10 +410,10 @@
:f => ["spent_on"],
:op => {
"spent_on" => "="
- },
+ },
:v => {
"spent_on" => ["2016-07-14"]
- },
+ },
:query => {
"name" => "test_new_project_public_query", "visibility" => "2"
}
@@ -498,10 +499,10 @@
:fields => ["status_id", "assigned_to_id"],
:operators => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:values => {
"assigned_to_id" => ["me"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_edit_global_private_query", "visibility" => "2"
}
@@ -522,10 +523,10 @@
:fields => ["status_id", "assigned_to_id"],
:operators => {
"assigned_to_id" => "=", "status_id" => "o"
- },
+ },
:values => {
"assigned_to_id" => ["1"], "status_id" => ["1"]
- },
+ },
:query => {
"name" => "test_edit_global_public_query", "visibility" => "2"
}
Index: test/functional/reports_controller_test.rb
===================================================================
--- test/functional/reports_controller_test.rb (revision 16900)
+++ test/functional/reports_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/repositories_bazaar_controller_test.rb
===================================================================
--- test/functional/repositories_bazaar_controller_test.rb (revision 16900)
+++ test/functional/repositories_bazaar_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/repositories_controller_test.rb
===================================================================
--- test/functional/repositories_controller_test.rb (revision 16900)
+++ test/functional/repositories_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -54,7 +55,7 @@
assert_select 'option[value=Git]:not([selected])'
end
end
-
+
def test_get_new_with_type
@request.session[:user_id] = 1
get :new, :params => {
Index: test/functional/repositories_cvs_controller_test.rb
===================================================================
--- test/functional/repositories_cvs_controller_test.rb (revision 16900)
+++ test/functional/repositories_cvs_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/repositories_filesystem_controller_test.rb
===================================================================
--- test/functional/repositories_filesystem_controller_test.rb (revision 16900)
+++ test/functional/repositories_filesystem_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -107,7 +108,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".dup.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 16900)
+++ test/functional/repositories_git_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -26,8 +27,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".dup.force_encoding('UTF-8')
+ FELIX_HEX = "Felix Sch\xC3\xA4fer".dup.force_encoding('UTF-8')
NUM_REV = 28
## Git, Mercurial and CVS path encodings are binary.
@@ -63,7 +64,7 @@
:is_default => '0',
:identifier => 'test-create',
:report_last_commit => '1',
-
+
}
}
end
@@ -77,7 +78,7 @@
:id => repository.id,
:repository => {
:report_last_commit => '0'
-
+
}
}
assert_response 302
Index: test/functional/repositories_mercurial_controller_test.rb
===================================================================
--- test/functional/repositories_mercurial_controller_test.rb (revision 16900)
+++ test/functional/repositories_mercurial_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -42,9 +43,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".dup.force_encoding('UTF-8')
+ @branch_char_0 = "branch-#{CHAR_1_HEX}-00".dup.force_encoding('UTF-8')
+ @branch_char_1 = "branch-#{CHAR_1_HEX}-01".dup.force_encoding('UTF-8')
end
if ruby19_non_utf8_pass
@@ -129,7 +130,7 @@
assert_select 'tr', 1
assert_select 'tr.file td.filename a', :text => 'delete.png'
end
-
+
assert_select 'table.changesets tbody' do
assert_select 'tr'
end
@@ -154,7 +155,7 @@
assert_select 'tr.file td.filename a', :text => 'percent%file1.txt'
assert_select 'tr.file td.filename a', :text => 'percentfile1.txt'
end
-
+
assert_select 'table.changesets tbody' do
assert_select 'tr td.id a', :text => /^13:/
assert_select 'tr td.id a', :text => /^11:/
@@ -184,7 +185,7 @@
assert_select 'tr.file td.filename a', :text => "test-#{@char_1}-2.txt"
assert_select 'tr.file td.filename a', :text => "test-#{@char_1}.txt"
end
-
+
assert_select 'table.changesets tbody' do
assert_select 'tr td.id a', :text => /^21:/
assert_select 'tr td.id a', :text => /^20:/
Index: test/functional/repositories_subversion_controller_test.rb
===================================================================
--- test/functional/repositories_subversion_controller_test.rb (revision 16900)
+++ test/functional/repositories_subversion_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/roles_controller_test.rb
===================================================================
--- test/functional/roles_controller_test.rb (revision 16900)
+++ test/functional/roles_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -202,7 +203,7 @@
def test_destroy_role_in_use
delete :destroy, :params => {:id => 1}
assert_redirected_to '/roles'
- assert_equal 'This role is in use and cannot be deleted.', flash[:error]
+ assert_equal 'This role is in use and cannot be deleted.', flash[:error]
assert_not_nil Role.find_by_id(1)
end
Index: test/functional/search_controller_test.rb
===================================================================
--- test/functional/search_controller_test.rb (revision 16900)
+++ test/functional/search_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/search_custom_fields_visibility_test.rb
===================================================================
--- test/functional/search_custom_fields_visibility_test.rb (revision 16900)
+++ test/functional/search_custom_fields_visibility_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/sessions_controller_test.rb
===================================================================
--- test/functional/sessions_controller_test.rb (revision 16900)
+++ test/functional/sessions_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/settings_controller_test.rb
===================================================================
--- test/functional/settings_controller_test.rb (revision 16900)
+++ test/functional/settings_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/sys_controller_test.rb
===================================================================
--- test/functional/sys_controller_test.rb (revision 16900)
+++ test/functional/sys_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/time_entry_reports_controller_test.rb
===================================================================
--- test/functional/time_entry_reports_controller_test.rb (revision 16900)
+++ test/functional/time_entry_reports_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# -*- coding: utf-8 -*-
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -232,8 +233,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".dup.force_encoding('UTF-8')
+ str_big5 = "\xa4@\xa4\xeb".dup.force_encoding('Big5')
user = User.find_by_id(3)
user.firstname = str_utf8
user.lastname = "test-lastname"
@@ -263,16 +264,16 @@
end
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
- lines = @response.body.chomp.split("\n")
+ 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".dup.force_encoding('Big5')
+ s2 = "\xa4u\xae\xc9\xc1`\xadp".dup.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 = "Traditional Chinese (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".force_encoding('UTF-8')
+ str_tw = "Traditional Chinese (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".dup.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)
@@ -280,7 +281,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".dup.force_encoding('UTF-8')
user = User.find_by_id(3)
user.firstname = str_utf8
user.lastname = "test-lastname"
@@ -310,12 +311,12 @@
end
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
- lines = @response.body.chomp.split("\n")
+ 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".dup.force_encoding('Big5')
assert_equal s1, lines.first
# Total row
- s2 = "\xa5H?".force_encoding('Big5')
+ s2 = "\xa5H?".dup.force_encoding('Big5')
assert_equal "#{s2} #{user.lastname},7.30,7.30", lines[1]
end
@@ -345,16 +346,16 @@
}
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
- lines = @response.body.chomp.split("\n")
+ 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".dup.force_encoding('ISO-8859-1')
+ s2 = "Temps total".dup.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)".dup.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/functional/timelog_controller_test.rb
===================================================================
--- test/functional/timelog_controller_test.rb (revision 16900)
+++ test/functional/timelog_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# -*- coding: utf-8 -*-
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/functional/timelog_custom_fields_visibility_test.rb
===================================================================
--- test/functional/timelog_custom_fields_visibility_test.rb (revision 16900)
+++ test/functional/timelog_custom_fields_visibility_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/trackers_controller_test.rb
===================================================================
--- test/functional/trackers_controller_test.rb (revision 16900)
+++ test/functional/trackers_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/users_controller_test.rb
===================================================================
--- test/functional/users_controller_test.rb (revision 16900)
+++ test/functional/users_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/versions_controller_test.rb
===================================================================
--- test/functional/versions_controller_test.rb (revision 16900)
+++ test/functional/versions_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/watchers_controller_test.rb
===================================================================
--- test/functional/watchers_controller_test.rb (revision 16900)
+++ test/functional/watchers_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/welcome_controller_test.rb
===================================================================
--- test/functional/welcome_controller_test.rb (revision 16900)
+++ test/functional/welcome_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/wiki_controller_test.rb
===================================================================
--- test/functional/wiki_controller_test.rb (revision 16900)
+++ test/functional/wiki_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/wikis_controller_test.rb
===================================================================
--- test/functional/wikis_controller_test.rb (revision 16900)
+++ test/functional/wikis_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/functional/workflows_controller_test.rb
===================================================================
--- test/functional/workflows_controller_test.rb (revision 16900)
+++ test/functional/workflows_controller_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/account_test.rb
===================================================================
--- test/integration/account_test.rb (revision 16900)
+++ test/integration/account_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -58,7 +59,7 @@
assert_equal 'autologin', token.action
assert_equal user.id, session[:user_id]
assert_equal token.value, cookies['autologin']
-
+
# Session is cleared
reset!
User.current = nil
@@ -65,7 +66,7 @@
# Clears user's last login timestamp
user.update_attribute :last_login_on, nil
assert_nil user.reload.last_login_on
-
+
# User comes back with user's autologin cookie
cookies[:autologin] = token.value
get '/my/page'
Index: test/integration/admin_test.rb
===================================================================
--- test/integration/admin_test.rb (revision 16900)
+++ test/integration/admin_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -51,7 +52,7 @@
put "/users/#{user.id}", :params => {
:id => user.id,
:user => {
- :status => User::STATUS_LOCKED
+ :status => User::STATUS_LOCKED
}
}
assert_redirected_to "/users/#{ user.id }/edit"
Index: test/integration/api_test/api_routing_test.rb
===================================================================
--- test/integration/api_test/api_routing_test.rb (revision 16900)
+++ test/integration/api_test/api_routing_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/api_test.rb
===================================================================
--- test/integration/api_test/api_test.rb (revision 16900)
+++ test/integration/api_test/api_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/attachments_test.rb
===================================================================
--- test/integration/api_test/attachments_test.rb (revision 16900)
+++ test/integration/api_test/attachments_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/authentication_test.rb
===================================================================
--- test/integration/api_test/authentication_test.rb (revision 16900)
+++ test/integration/api_test/authentication_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -106,7 +107,7 @@
end
def test_invalid_utf8_credentials_should_not_trigger_an_error
- invalid_utf8 = "\x82".force_encoding('UTF-8')
+ invalid_utf8 = "\x82".dup.force_encoding('UTF-8')
assert !invalid_utf8.valid_encoding?
assert_nothing_raised do
get '/users/current.xml', :headers => credentials(invalid_utf8, "foo")
Index: test/integration/api_test/custom_fields_attribute_test.rb
===================================================================
--- test/integration/api_test/custom_fields_attribute_test.rb (revision 16900)
+++ test/integration/api_test/custom_fields_attribute_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/custom_fields_test.rb
===================================================================
--- test/integration/api_test/custom_fields_test.rb (revision 16900)
+++ test/integration/api_test/custom_fields_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/disabled_rest_api_test.rb
===================================================================
--- test/integration/api_test/disabled_rest_api_test.rb (revision 16900)
+++ test/integration/api_test/disabled_rest_api_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/enumerations_test.rb
===================================================================
--- test/integration/api_test/enumerations_test.rb (revision 16900)
+++ test/integration/api_test/enumerations_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/files_test.rb
===================================================================
--- test/integration/api_test/files_test.rb (revision 16900)
+++ test/integration/api_test/files_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/groups_test.rb
===================================================================
--- test/integration/api_test/groups_test.rb (revision 16900)
+++ test/integration/api_test/groups_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/issue_categories_test.rb
===================================================================
--- test/integration/api_test/issue_categories_test.rb (revision 16900)
+++ test/integration/api_test/issue_categories_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -95,7 +96,7 @@
assert_equal '', @response.body
assert_nil IssueCategory.find_by_id(1)
end
-
+
test "DELETE /issue_categories/:id.xml should reassign issues with :reassign_to_id param" do
issue_count = Issue.where(:category_id => 1).count
assert issue_count > 0
Index: test/integration/api_test/issue_relations_test.rb
===================================================================
--- test/integration/api_test/issue_relations_test.rb (revision 16900)
+++ test/integration/api_test/issue_relations_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/issue_statuses_test.rb
===================================================================
--- test/integration/api_test/issue_statuses_test.rb (revision 16900)
+++ test/integration/api_test/issue_statuses_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/issues_test.rb
===================================================================
--- test/integration/api_test/issues_test.rb (revision 16900)
+++ test/integration/api_test/issues_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/jsonp_test.rb
===================================================================
--- test/integration/api_test/jsonp_test.rb (revision 16900)
+++ test/integration/api_test/jsonp_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/memberships_test.rb
===================================================================
--- test/integration/api_test/memberships_test.rb (revision 16900)
+++ test/integration/api_test/memberships_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/news_test.rb
===================================================================
--- test/integration/api_test/news_test.rb (revision 16900)
+++ test/integration/api_test/news_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/projects_test.rb
===================================================================
--- test/integration/api_test/projects_test.rb (revision 16900)
+++ test/integration/api_test/projects_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/queries_test.rb
===================================================================
--- test/integration/api_test/queries_test.rb (revision 16900)
+++ test/integration/api_test/queries_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/roles_test.rb
===================================================================
--- test/integration/api_test/roles_test.rb (revision 16900)
+++ test/integration/api_test/roles_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/search_test.rb
===================================================================
--- test/integration/api_test/search_test.rb (revision 16900)
+++ test/integration/api_test/search_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/time_entries_test.rb
===================================================================
--- test/integration/api_test/time_entries_test.rb (revision 16900)
+++ test/integration/api_test/time_entries_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/trackers_test.rb
===================================================================
--- test/integration/api_test/trackers_test.rb (revision 16900)
+++ test/integration/api_test/trackers_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/users_test.rb
===================================================================
--- test/integration/api_test/users_test.rb (revision 16900)
+++ test/integration/api_test/users_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/versions_test.rb
===================================================================
--- test/integration/api_test/versions_test.rb (revision 16900)
+++ test/integration/api_test/versions_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/api_test/wiki_pages_test.rb
===================================================================
--- test/integration/api_test/wiki_pages_test.rb (revision 16900)
+++ test/integration/api_test/wiki_pages_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/application_test.rb
===================================================================
--- test/integration/application_test.rb (revision 16900)
+++ test/integration/application_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/attachments_test.rb
===================================================================
--- test/integration/attachments_test.rb (revision 16900)
+++ test/integration/attachments_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/feeds_test.rb
===================================================================
--- test/integration/feeds_test.rb (revision 16900)
+++ test/integration/feeds_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/issues_test.rb
===================================================================
--- test/integration/issues_test.rb (revision 16900)
+++ test/integration/issues_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -128,7 +129,7 @@
get '/projects/ecookbook/issues?set_filter=1&group_by=fixed_version&sort=priority:desc,fixed_version,id'
assert_response :success
assert_select 'td.id', :text => '5'
-
+
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '5 of 6'
@@ -140,7 +141,7 @@
get '/projects/ecookbook/issues?set_filter=1&tracker_id=1'
assert_response :success
assert_select 'td.id', :text => '5'
-
+
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '3 of 5'
@@ -158,7 +159,7 @@
get "/projects/ecookbook/issues?set_filter=1&query_id=#{query.id}"
assert_response :success
assert_select 'td.id', :text => '5'
-
+
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '6 of 8'
Index: test/integration/layout_test.rb
===================================================================
--- test/integration/layout_test.rb (revision 16900)
+++ test/integration/layout_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/lib/redmine/field_format/attachment_format_test.rb
===================================================================
--- test/integration/lib/redmine/field_format/attachment_format_test.rb (revision 16900)
+++ test/integration/lib/redmine/field_format/attachment_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/lib/redmine/hook_test.rb
===================================================================
--- test/integration/lib/redmine/hook_test.rb (revision 16900)
+++ test/integration/lib/redmine/hook_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/lib/redmine/menu_manager_test.rb
===================================================================
--- test/integration/lib/redmine/menu_manager_test.rb (revision 16900)
+++ test/integration/lib/redmine/menu_manager_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/lib/redmine/themes_test.rb
===================================================================
--- test/integration/lib/redmine/themes_test.rb (revision 16900)
+++ test/integration/lib/redmine/themes_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/projects_test.rb
===================================================================
--- test/integration/projects_test.rb (revision 16900)
+++ test/integration/projects_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/repositories_git_test.rb
===================================================================
--- test/integration/repositories_git_test.rb (revision 16900)
+++ test/integration/repositories_git_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/account_test.rb
===================================================================
--- test/integration/routing/account_test.rb (revision 16900)
+++ test/integration/routing/account_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/activities_test.rb
===================================================================
--- test/integration/routing/activities_test.rb (revision 16900)
+++ test/integration/routing/activities_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/admin_test.rb
===================================================================
--- test/integration/routing/admin_test.rb (revision 16900)
+++ test/integration/routing/admin_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/attachments_test.rb
===================================================================
--- test/integration/routing/attachments_test.rb (revision 16900)
+++ test/integration/routing/attachments_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/auth_sources_test.rb
===================================================================
--- test/integration/routing/auth_sources_test.rb (revision 16900)
+++ test/integration/routing/auth_sources_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/auto_completes_test.rb
===================================================================
--- test/integration/routing/auto_completes_test.rb (revision 16900)
+++ test/integration/routing/auto_completes_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/boards_test.rb
===================================================================
--- test/integration/routing/boards_test.rb (revision 16900)
+++ test/integration/routing/boards_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/calendars_test.rb
===================================================================
--- test/integration/routing/calendars_test.rb (revision 16900)
+++ test/integration/routing/calendars_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/comments_test.rb
===================================================================
--- test/integration/routing/comments_test.rb (revision 16900)
+++ test/integration/routing/comments_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/context_menus_test.rb
===================================================================
--- test/integration/routing/context_menus_test.rb (revision 16900)
+++ test/integration/routing/context_menus_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/custom_fields_test.rb
===================================================================
--- test/integration/routing/custom_fields_test.rb (revision 16900)
+++ test/integration/routing/custom_fields_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/documents_test.rb
===================================================================
--- test/integration/routing/documents_test.rb (revision 16900)
+++ test/integration/routing/documents_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/enumerations_test.rb
===================================================================
--- test/integration/routing/enumerations_test.rb (revision 16900)
+++ test/integration/routing/enumerations_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/files_test.rb
===================================================================
--- test/integration/routing/files_test.rb (revision 16900)
+++ test/integration/routing/files_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/gantts_test.rb
===================================================================
--- test/integration/routing/gantts_test.rb (revision 16900)
+++ test/integration/routing/gantts_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/groups_test.rb
===================================================================
--- test/integration/routing/groups_test.rb (revision 16900)
+++ test/integration/routing/groups_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/imports_test.rb
===================================================================
--- test/integration/routing/imports_test.rb (revision 16900)
+++ test/integration/routing/imports_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/issue_categories_test.rb
===================================================================
--- test/integration/routing/issue_categories_test.rb (revision 16900)
+++ test/integration/routing/issue_categories_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/issue_relations_test.rb
===================================================================
--- test/integration/routing/issue_relations_test.rb (revision 16900)
+++ test/integration/routing/issue_relations_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/issue_statuses_test.rb
===================================================================
--- test/integration/routing/issue_statuses_test.rb (revision 16900)
+++ test/integration/routing/issue_statuses_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/issues_test.rb
===================================================================
--- test/integration/routing/issues_test.rb (revision 16900)
+++ test/integration/routing/issues_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/journals_test.rb
===================================================================
--- test/integration/routing/journals_test.rb (revision 16900)
+++ test/integration/routing/journals_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/mail_handler_test.rb
===================================================================
--- test/integration/routing/mail_handler_test.rb (revision 16900)
+++ test/integration/routing/mail_handler_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/members_test.rb
===================================================================
--- test/integration/routing/members_test.rb (revision 16900)
+++ test/integration/routing/members_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/messages_test.rb
===================================================================
--- test/integration/routing/messages_test.rb (revision 16900)
+++ test/integration/routing/messages_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/my_test.rb
===================================================================
--- test/integration/routing/my_test.rb (revision 16900)
+++ test/integration/routing/my_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/news_test.rb
===================================================================
--- test/integration/routing/news_test.rb (revision 16900)
+++ test/integration/routing/news_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/previews_test.rb
===================================================================
--- test/integration/routing/previews_test.rb (revision 16900)
+++ test/integration/routing/previews_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/principal_memberships_test.rb
===================================================================
--- test/integration/routing/principal_memberships_test.rb (revision 16900)
+++ test/integration/routing/principal_memberships_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/project_enumerations_test.rb
===================================================================
--- test/integration/routing/project_enumerations_test.rb (revision 16900)
+++ test/integration/routing/project_enumerations_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/projects_test.rb
===================================================================
--- test/integration/routing/projects_test.rb (revision 16900)
+++ test/integration/routing/projects_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/queries_test.rb
===================================================================
--- test/integration/routing/queries_test.rb (revision 16900)
+++ test/integration/routing/queries_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/reports_test.rb
===================================================================
--- test/integration/routing/reports_test.rb (revision 16900)
+++ test/integration/routing/reports_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/repositories_test.rb
===================================================================
--- test/integration/routing/repositories_test.rb (revision 16900)
+++ test/integration/routing/repositories_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/roles_test.rb
===================================================================
--- test/integration/routing/roles_test.rb (revision 16900)
+++ test/integration/routing/roles_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/search_test.rb
===================================================================
--- test/integration/routing/search_test.rb (revision 16900)
+++ test/integration/routing/search_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/settings_test.rb
===================================================================
--- test/integration/routing/settings_test.rb (revision 16900)
+++ test/integration/routing/settings_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/sys_test.rb
===================================================================
--- test/integration/routing/sys_test.rb (revision 16900)
+++ test/integration/routing/sys_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/timelog_test.rb
===================================================================
--- test/integration/routing/timelog_test.rb (revision 16900)
+++ test/integration/routing/timelog_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/trackers_test.rb
===================================================================
--- test/integration/routing/trackers_test.rb (revision 16900)
+++ test/integration/routing/trackers_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/users_test.rb
===================================================================
--- test/integration/routing/users_test.rb (revision 16900)
+++ test/integration/routing/users_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/versions_test.rb
===================================================================
--- test/integration/routing/versions_test.rb (revision 16900)
+++ test/integration/routing/versions_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/watchers_test.rb
===================================================================
--- test/integration/routing/watchers_test.rb (revision 16900)
+++ test/integration/routing/watchers_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/welcome_test.rb
===================================================================
--- test/integration/routing/welcome_test.rb (revision 16900)
+++ test/integration/routing/welcome_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/wiki_test.rb
===================================================================
--- test/integration/routing/wiki_test.rb (revision 16900)
+++ test/integration/routing/wiki_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/wikis_test.rb
===================================================================
--- test/integration/routing/wikis_test.rb (revision 16900)
+++ test/integration/routing/wikis_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/routing/workflows_test.rb
===================================================================
--- test/integration/routing/workflows_test.rb (revision 16900)
+++ test/integration/routing/workflows_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/sessions_test.rb
===================================================================
--- test/integration/sessions_test.rb (revision 16900)
+++ test/integration/sessions_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/sudo_mode_test.rb
===================================================================
--- test/integration/sudo_mode_test.rb (revision 16900)
+++ test/integration/sudo_mode_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require File.expand_path('../../test_helper', __FILE__)
class SudoModeTest < Redmine::IntegrationTest
@@ -184,7 +185,7 @@
}
},
:headers => credentials('admin')
-
+
assert_response :created
end
end
Index: test/integration/users_test.rb
===================================================================
--- test/integration/users_test.rb (revision 16900)
+++ test/integration/users_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/integration/welcome_test.rb
===================================================================
--- test/integration/welcome_test.rb (revision 16900)
+++ test/integration/welcome_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/mocks/open_id_authentication_mock.rb
===================================================================
--- test/mocks/open_id_authentication_mock.rb (revision 16900)
+++ test/mocks/open_id_authentication_mock.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Mocks out OpenID
#
# http://www.northpub.com/articles/2007/04/02/testing-openid-support
Index: test/object_helpers.rb
===================================================================
--- test/object_helpers.rb (revision 16900)
+++ test/object_helpers.rb (working copy)
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
module ObjectHelpers
def User.generate!(attributes={})
- @generated_user_login ||= 'user0'
+ @generated_user_login ||= 'user0'.dup
@generated_user_login.succ!
user = User.new(attributes)
user.login = @generated_user_login.dup if user.login.blank?
@@ -19,7 +20,7 @@
end
def Group.generate!(attributes={})
- @generated_group_name ||= 'Group 0'
+ @generated_group_name ||= 'Group 0'.dup
@generated_group_name.succ!
group = Group.new(attributes)
group.name = @generated_group_name.dup if group.name.blank?
@@ -29,7 +30,7 @@
end
def Project.generate!(attributes={})
- @generated_project_identifier ||= 'project-0000'
+ @generated_project_identifier ||= 'project-0000'.dup
@generated_project_identifier.succ!
project = Project.new(attributes)
project.name = @generated_project_identifier.dup if project.name.blank?
@@ -51,7 +52,7 @@
end
def IssueStatus.generate!(attributes={})
- @generated_status_name ||= 'Status 0'
+ @generated_status_name ||= 'Status 0'.dup
@generated_status_name.succ!
status = IssueStatus.new(attributes)
status.name = @generated_status_name.dup if status.name.blank?
@@ -61,7 +62,7 @@
end
def Tracker.generate(attributes={})
- @generated_tracker_name ||= 'Tracker 0'
+ @generated_tracker_name ||= 'Tracker 0'.dup
@generated_tracker_name.succ!
tracker = Tracker.new(attributes)
tracker.name = @generated_tracker_name.dup if tracker.name.blank?
@@ -77,7 +78,7 @@
end
def Role.generate!(attributes={})
- @generated_role_name ||= 'Role 0'
+ @generated_role_name ||= 'Role 0'.dup
@generated_role_name.succ!
role = Role.new(attributes)
role.name = @generated_role_name.dup if role.name.blank?
@@ -129,7 +130,7 @@
end
def Version.generate!(attributes={})
- @generated_version_name ||= 'Version 0'
+ @generated_version_name ||= 'Version 0'.dup
@generated_version_name.succ!
version = Version.new(attributes)
version.name = @generated_version_name.dup if version.name.blank?
@@ -157,7 +158,7 @@
end
def AuthSource.generate!(attributes={})
- @generated_auth_source_name ||= 'Auth 0'
+ @generated_auth_source_name ||= 'Auth 0'.dup
@generated_auth_source_name.succ!
source = AuthSource.new(attributes)
source.name = @generated_auth_source_name.dup if source.name.blank?
@@ -167,7 +168,7 @@
end
def Board.generate!(attributes={})
- @generated_board_name ||= 'Forum 0'
+ @generated_board_name ||= 'Forum 0'.dup
@generated_board_name.succ!
board = Board.new(attributes)
board.name = @generated_board_name.dup if board.name.blank?
@@ -178,7 +179,7 @@
end
def Attachment.generate!(attributes={})
- @generated_filename ||= 'testfile0'
+ @generated_filename ||= 'testfile0'.dup
@generated_filename.succ!
attributes = attributes.dup
attachment = Attachment.new(attributes)
@@ -190,7 +191,7 @@
end
def CustomField.generate!(attributes={})
- @generated_custom_field_name ||= 'Custom field 0'
+ @generated_custom_field_name ||= 'Custom field 0'.dup
@generated_custom_field_name.succ!
field = new(attributes)
field.name = @generated_custom_field_name.dup if field.name.blank?
@@ -208,7 +209,7 @@
end
def Changeset.generate!(attributes={})
- @generated_changeset_rev ||= '123456'
+ @generated_changeset_rev ||= '123456'.dup
@generated_changeset_rev.succ!
changeset = new(attributes)
changeset.repository ||= Project.find(1).repository
Index: test/system/issues_test.rb
===================================================================
--- test/system/issues_test.rb (revision 16900)
+++ test/system/issues_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -48,7 +49,7 @@
# check issue attributes
assert_equal 'jsmith', issue.author.login
assert_equal 1, issue.project.id
- assert_equal IssueStatus.find_by_name('New'), issue.status
+ assert_equal IssueStatus.find_by_name('New'), issue.status
assert_equal Tracker.find_by_name('Bug'), issue.tracker
assert_equal IssuePriority.find_by_name('Low'), issue.priority
assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field'))
@@ -251,9 +252,9 @@
# Check that the page shows the Estimated hours total
assert page.has_css?('p.query-totals')
assert page.has_css?('span.total-for-estimated-hours')
- # Open the Options of the form (necessary for having the totalable columns options clickable)
+ # Open the Options of the form (necessary for having the totalable columns options clickable)
page.all('legend')[1].click
- # Deselect the default totalable column (none should be left)
+ # Deselect the default totalable column (none should be left)
page.first('input[name="t[]"][value="estimated_hours"]').click
within('#query_form') do
click_link 'Apply'
Index: test/system/my_page_test.rb
===================================================================
--- test/system/my_page_test.rb (revision 16900)
+++ test/system/my_page_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/system/quick_jump_test.rb
===================================================================
--- test/system/quick_jump_test.rb (revision 16900)
+++ test/system/quick_jump_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/system/sudo_mode_test.rb
===================================================================
--- test/system/sudo_mode_test.rb (revision 16900)
+++ test/system/sudo_mode_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -33,7 +34,7 @@
def test_add_user
log_user('admin', 'admin')
expire_sudo_mode!
-
+
visit '/users/new'
assert_difference 'User.count' do
Index: test/system/timelog_test.rb
===================================================================
--- test/system/timelog_test.rb (revision 16900)
+++ test/system/timelog_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/test_helper.rb
===================================================================
--- test/test_helper.rb (revision 16900)
+++ test/test_helper.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -248,7 +249,7 @@
module Redmine
class MockFile
attr_reader :size, :original_filename, :content_type
-
+
def initialize(options={})
@size = options[:size] || 32
@original_filename = options[:original_filename] || options[:filename]
@@ -255,7 +256,7 @@
@content_type = options[:content_type]
@content = options[:content] || 'x'*size
end
-
+
def read(*args)
if @eof
false
@@ -302,22 +303,22 @@
ids = css_select('tr.issue td.id').map(&:text).map(&:to_i)
Issue.where(:id => ids).sort_by {|issue| ids.index(issue.id)}
end
-
+
# Return the columns that are displayed in the issue list
def columns_in_issues_list
css_select('table.issues thead th:not(.checkbox)').map(&:text)
end
-
+
# Return the columns that are displayed in the list
def columns_in_list
css_select('table.list thead th:not(.checkbox)').map(&:text).select(&:present?)
end
-
+
# Verifies that the query filters match the expected filters
def assert_query_filters(expected_filters)
response.body =~ /initFilters\(\);\s*((addFilter\(.+\);\s*)*)/
filter_init = $1.to_s
-
+
expected_filters.each do |field, operator, values|
s = "addFilter(#{field.to_json}, #{operator.to_json}, #{Array(values).to_json});"
assert_include s, filter_init
@@ -417,7 +418,7 @@
request = arg.keys.detect {|key| key.is_a?(String)}
raise ArgumentError unless request
options = arg.slice!(request)
-
+
API_FORMATS.each do |format|
format_request = request.sub /$/, ".#{format}"
super options.merge(format_request => arg[request], :format => format)
Index: test/unit/activity_test.rb
===================================================================
--- test/unit/activity_test.rb (revision 16900)
+++ test/unit/activity_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/attachment_test.rb
===================================================================
--- test/unit/attachment_test.rb (revision 16900)
+++ test/unit/attachment_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -406,7 +407,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".dup.force_encoding('UTF-8')
assert_equal false, string.valid_encoding?
Attachment.latest_attach(Attachment.limit(2).to_a, string)
Index: test/unit/attachment_transaction_test.rb
===================================================================
--- test/unit/attachment_transaction_test.rb (revision 16900)
+++ test/unit/attachment_transaction_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/auth_source_ldap_test.rb
===================================================================
--- test/unit/auth_source_ldap_test.rb (revision 16900)
+++ test/unit/auth_source_ldap_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/board_test.rb
===================================================================
--- test/unit/board_test.rb (revision 16900)
+++ test/unit/board_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/comment_test.rb
===================================================================
--- test/unit/comment_test.rb (revision 16900)
+++ test/unit/comment_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/custom_field_test.rb
===================================================================
--- test/unit/custom_field_test.rb (revision 16900)
+++ test/unit/custom_field_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -101,7 +102,7 @@
def test_possible_values_should_return_utf8_encoded_strings
field = CustomField.new
- s = "Value".force_encoding('BINARY')
+ s = "Value".dup.force_encoding('BINARY')
field.possible_values = s
assert_equal [s], field.possible_values
assert_equal 'UTF-8', field.possible_values.first.encoding.name
Index: test/unit/custom_field_user_format_test.rb
===================================================================
--- test/unit/custom_field_user_format_test.rb (revision 16900)
+++ test/unit/custom_field_user_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/custom_field_version_format_test.rb
===================================================================
--- test/unit/custom_field_version_format_test.rb (revision 16900)
+++ test/unit/custom_field_version_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/custom_value_test.rb
===================================================================
--- test/unit/custom_value_test.rb (revision 16900)
+++ test/unit/custom_value_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/default_data_test.rb
===================================================================
--- test/unit/default_data_test.rb (revision 16900)
+++ test/unit/default_data_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/document_category_test.rb
===================================================================
--- test/unit/document_category_test.rb (revision 16900)
+++ test/unit/document_category_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/document_test.rb
===================================================================
--- test/unit/document_test.rb (revision 16900)
+++ test/unit/document_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/enabled_module_test.rb
===================================================================
--- test/unit/enabled_module_test.rb (revision 16900)
+++ test/unit/enabled_module_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/enumeration_test.rb
===================================================================
--- test/unit/enumeration_test.rb (revision 16900)
+++ test/unit/enumeration_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/group_test.rb
===================================================================
--- test/unit/group_test.rb (revision 16900)
+++ test/unit/group_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -52,7 +53,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)".dup.force_encoding('UTF-8')
g = Group.new
assert !g.save
assert_include str, g.errors.full_messages
Index: test/unit/helpers/activities_helper_test.rb
===================================================================
--- test/unit/helpers/activities_helper_test.rb (revision 16900)
+++ test/unit/helpers/activities_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/application_helper_test.rb
===================================================================
--- test/unit/helpers/application_helper_test.rb (revision 16900)
+++ test/unit/helpers/application_helper_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -36,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".dup.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
@@ -1280,7 +1281,7 @@
end
def test_parse_redmine_links_should_handle_a_tag_without_attributes
- text = 'http://example.com'
+ text = 'http://example.com'.dup
expected = text.dup
parse_redmine_links(text, nil, nil, nil, true, {})
assert_equal expected, text
@@ -1549,7 +1550,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".dup.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/unit/helpers/custom_fields_helper_test.rb
===================================================================
--- test/unit/helpers/custom_fields_helper_test.rb (revision 16900)
+++ test/unit/helpers/custom_fields_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/groups_helper_test.rb
===================================================================
--- test/unit/helpers/groups_helper_test.rb (revision 16900)
+++ test/unit/helpers/groups_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/issues_helper_test.rb
===================================================================
--- test/unit/helpers/issues_helper_test.rb (revision 16900)
+++ test/unit/helpers/issues_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/journals_helper_test.rb
===================================================================
--- test/unit/helpers/journals_helper_test.rb (revision 16900)
+++ test/unit/helpers/journals_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -31,7 +32,7 @@
def test_journal_thumbnail_attachments_should_return_thumbnailable_attachments
issue = Issue.generate!
-
+
journal = new_record(Journal) do
issue.init_journal(User.find(1))
issue.attachments << Attachment.new(:file => mock_file_with_options(:original_filename => 'image.png'), :author => User.find(1))
Index: test/unit/helpers/members_helper_test.rb
===================================================================
--- test/unit/helpers/members_helper_test.rb (revision 16900)
+++ test/unit/helpers/members_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/projects_helper_test.rb
===================================================================
--- test/unit/helpers/projects_helper_test.rb (revision 16900)
+++ test/unit/helpers/projects_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/queries_helper_test.rb
===================================================================
--- test/unit/helpers/queries_helper_test.rb (revision 16900)
+++ test/unit/helpers/queries_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/routes_helper_test.rb
===================================================================
--- test/unit/helpers/routes_helper_test.rb (revision 16900)
+++ test/unit/helpers/routes_helper_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/helpers/search_helper_test.rb
===================================================================
--- test/unit/helpers/search_helper_test.rb (revision 16900)
+++ test/unit/helpers/search_helper_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/helpers/settings_helper_test.rb
===================================================================
--- test/unit/helpers/settings_helper_test.rb (revision 16900)
+++ test/unit/helpers/settings_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/sort_helper_test.rb
===================================================================
--- test/unit/helpers/sort_helper_test.rb (revision 16900)
+++ test/unit/helpers/sort_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/timelog_helper_test.rb
===================================================================
--- test/unit/helpers/timelog_helper_test.rb (revision 16900)
+++ test/unit/helpers/timelog_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/version_helper_test.rb
===================================================================
--- test/unit/helpers/version_helper_test.rb (revision 16900)
+++ test/unit/helpers/version_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/watchers_helper_test.rb
===================================================================
--- test/unit/helpers/watchers_helper_test.rb (revision 16900)
+++ test/unit/helpers/watchers_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/helpers/wiki_helper_test.rb
===================================================================
--- test/unit/helpers/wiki_helper_test.rb (revision 16900)
+++ test/unit/helpers/wiki_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/changeset_test.rb
===================================================================
--- test/unit/changeset_test.rb (revision 16900)
+++ test/unit/changeset_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -445,7 +446,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.".dup.force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -457,7 +458,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.".dup.force_encoding("UTF-8")
assert_equal str_utf8, c.comments
end
@@ -464,8 +465,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.".dup.force_encoding("UTF-8")
+ str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".dup.force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -484,7 +485,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".dup.force_encoding('ASCII-8BIT')
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
@@ -500,8 +501,8 @@
end
def test_comments_should_be_converted_all_latin1_to_utf8
- s1 = "\xC2\x80"
- s2 = "\xc3\x82\xc2\x80"
+ s1 = "\xC2\x80".dup
+ s2 = "\xc3\x82\xc2\x80".dup
s4 = s2.dup
s3 = s1.dup
s1.force_encoding('ASCII-8BIT')
@@ -526,8 +527,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".dup.force_encoding("UTF-8")
+ str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".dup.force_encoding("ASCII-8BIT")
r = Repository::Bazaar.create!(
:project => proj,
:url => '/tmp/test/bazaar',
Index: test/unit/initializers/patches_test.rb
===================================================================
--- test/unit/initializers/patches_test.rb (revision 16900)
+++ test/unit/initializers/patches_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_category_test.rb
===================================================================
--- test/unit/issue_category_test.rb (revision 16900)
+++ test/unit/issue_category_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_custom_field_test.rb
===================================================================
--- test/unit/issue_custom_field_test.rb (revision 16900)
+++ test/unit/issue_custom_field_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_import_test.rb
===================================================================
--- test/unit/issue_import_test.rb (revision 16900)
+++ test/unit/issue_import_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_nested_set_concurrency_test.rb
===================================================================
--- test/unit/issue_nested_set_concurrency_test.rb (revision 16900)
+++ test/unit/issue_nested_set_concurrency_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_nested_set_test.rb
===================================================================
--- test/unit/issue_nested_set_test.rb (revision 16900)
+++ test/unit/issue_nested_set_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_priority_test.rb
===================================================================
--- test/unit/issue_priority_test.rb (revision 16900)
+++ test/unit/issue_priority_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_relation_test.rb
===================================================================
--- test/unit/issue_relation_test.rb (revision 16900)
+++ test/unit/issue_relation_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_scopes_test.rb
===================================================================
--- test/unit/issue_scopes_test.rb (revision 16900)
+++ test/unit/issue_scopes_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_status_test.rb
===================================================================
--- test/unit/issue_status_test.rb (revision 16900)
+++ test/unit/issue_status_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_subtasking_test.rb
===================================================================
--- test/unit/issue_subtasking_test.rb (revision 16900)
+++ test/unit/issue_subtasking_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_test.rb
===================================================================
--- test/unit/issue_test.rb (revision 16900)
+++ test/unit/issue_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/issue_transaction_test.rb
===================================================================
--- test/unit/issue_transaction_test.rb (revision 16900)
+++ test/unit/issue_transaction_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/journal_observer_test.rb
===================================================================
--- test/unit/journal_observer_test.rb (revision 16900)
+++ test/unit/journal_observer_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/journal_test.rb
===================================================================
--- test/unit/journal_test.rb (revision 16900)
+++ test/unit/journal_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/access_control_test.rb
===================================================================
--- test/unit/lib/redmine/access_control_test.rb (revision 16900)
+++ test/unit/lib/redmine/access_control_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/acts/positioned_with_scope_test.rb
===================================================================
--- test/unit/lib/redmine/acts/positioned_with_scope_test.rb (revision 16900)
+++ test/unit/lib/redmine/acts/positioned_with_scope_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/acts/positioned_without_scope_test.rb
===================================================================
--- test/unit/lib/redmine/acts/positioned_without_scope_test.rb (revision 16900)
+++ test/unit/lib/redmine/acts/positioned_without_scope_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/ciphering_test.rb
===================================================================
--- test/unit/lib/redmine/ciphering_test.rb (revision 16900)
+++ test/unit/lib/redmine/ciphering_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -61,7 +62,7 @@
assert_equal 'clear', r.password
end
end
-
+
def test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
r = Repository::Subversion.create!(:password => 'clear', :url => 'file:///tmp', :identifier => 'svn')
Index: test/unit/lib/redmine/codeset_util_test.rb
===================================================================
--- test/unit/lib/redmine/codeset_util_test.rb (revision 16900)
+++ test/unit/lib/redmine/codeset_util_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -21,8 +22,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".dup.force_encoding("UTF-8")
+ s2 = "Texte encod\xe9".dup.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 +32,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".dup.force_encoding("UTF-8")
+ s2 = "\xa5\xec\xa5\xc3\xa5\xc9\xa5\xde\xa5\xa4\xa5\xf3".dup.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 +42,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".dup.force_encoding("UTF-8")
+ s2 = "\xC2\x80".dup.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 +56,7 @@
end
def test_to_utf8_by_setting_returns_ascii_as_utf8
- s1 = "ASCII".force_encoding("UTF-8")
+ s1 = "ASCII".dup.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 +69,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.".dup.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 +79,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".dup.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 +88,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".dup.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??".dup.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".dup.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?".dup.force_encoding("UTF-8"), s2
end
end
Index: test/unit/lib/redmine/configuration_test.rb
===================================================================
--- test/unit/lib/redmine/configuration_test.rb (revision 16900)
+++ test/unit/lib/redmine/configuration_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/export/csv_test.rb
===================================================================
--- test/unit/lib/redmine/export/csv_test.rb (revision 16900)
+++ test/unit/lib/redmine/export/csv_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -19,7 +20,7 @@
class CsvTest < ActiveSupport::TestCase
- BOM = "\xEF\xBB\xBF".force_encoding('UTF-8')
+ BOM = "\xEF\xBB\xBF".dup.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 16900)
+++ test/unit/lib/redmine/export/pdf_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -34,9 +35,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".dup.force_encoding("ASCII-8BIT"), txt_1
+ assert_equal "?\x91\xd4?".dup.force_encoding("ASCII-8BIT"), txt_2
+ assert_equal "??\x91\xd4?".dup.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 +45,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".dup.force_encoding("UTF-8")
+ str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".dup.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 +56,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".dup.force_encoding("UTF-8")
+ str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".dup.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 +71,7 @@
["CP932", "SJIS"].each do |encoding|
set_fixtures_attachments_directory
- str2 = "\x83e\x83X\x83g".force_encoding("ASCII-8BIT")
+ str2 = "\x83e\x83X\x83g".dup.force_encoding("ASCII-8BIT")
a1 = Attachment.find(17)
a2 = Attachment.find(19)
Index: test/unit/lib/redmine/field_format/attachment_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/attachment_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/attachment_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/bool_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/bool_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/bool_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/enumeration_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/enumeration_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/enumeration_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/field_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/field_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/field_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/link_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/link_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/link_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/list_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/list_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/list_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/numeric_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/numeric_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/numeric_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/user_field_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/user_field_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/user_field_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/field_format/version_field_format_test.rb
===================================================================
--- test/unit/lib/redmine/field_format/version_field_format_test.rb (revision 16900)
+++ test/unit/lib/redmine/field_format/version_field_format_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -56,7 +57,7 @@
assert_equal expected, field.possible_values_options(project).map(&:first)
end
-
+
def test_possible_values_options_should_return_system_shared_versions_without_project
field = IssueCustomField.new(:field_format => 'version')
version = Version.generate!(:project => Project.find(1), :status => 'open', :sharing => 'system')
Index: test/unit/lib/redmine/helpers/calendar_test.rb
===================================================================
--- test/unit/lib/redmine/helpers/calendar_test.rb (revision 16900)
+++ test/unit/lib/redmine/helpers/calendar_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/helpers/diff_test.rb
===================================================================
--- test/unit/lib/redmine/helpers/diff_test.rb (revision 16900)
+++ test/unit/lib/redmine/helpers/diff_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/helpers/gantt_test.rb
===================================================================
--- test/unit/lib/redmine/helpers/gantt_test.rb (revision 16900)
+++ test/unit/lib/redmine/helpers/gantt_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/hook_test.rb
===================================================================
--- test/unit/lib/redmine/hook_test.rb (revision 16900)
+++ test/unit/lib/redmine/hook_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/i18n_test.rb
===================================================================
--- test/unit/lib/redmine/i18n_test.rb (revision 16900)
+++ test/unit/lib/redmine/i18n_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -68,7 +69,7 @@
end
assert l('date.day_names').is_a?(Array)
assert_equal 7, l('date.day_names').size
-
+
assert l('date.month_names').is_a?(Array)
assert_equal 13, l('date.month_names').size
end
@@ -163,7 +164,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".dup.force_encoding('UTF-8')
assert_equal "-1000,20 #{euro_sign}", number_to_currency(-1000.2)
end
@@ -189,7 +190,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)".dup.force_encoding('UTF-8')
assert_include [ja, "ja"], options
end
@@ -241,7 +242,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".dup.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 +250,13 @@
def test_traditional_chinese_locale
set_language_if_valid 'zh-TW'
- str_tw = "Traditional Chinese (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".force_encoding('UTF-8')
+ str_tw = "Traditional Chinese (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".dup.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)".dup.force_encoding('UTF-8')
assert_equal str_fr, l(:general_lang_name)
end
end
Index: test/unit/lib/redmine/info_test.rb
===================================================================
--- test/unit/lib/redmine/info_test.rb (revision 16900)
+++ test/unit/lib/redmine/info_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/menu_manager/mapper_test.rb
===================================================================
--- test/unit/lib/redmine/menu_manager/mapper_test.rb (revision 16900)
+++ test/unit/lib/redmine/menu_manager/mapper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/menu_manager/menu_helper_test.rb
===================================================================
--- test/unit/lib/redmine/menu_manager/menu_helper_test.rb (revision 16900)
+++ test/unit/lib/redmine/menu_manager/menu_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -209,7 +210,7 @@
end
end
end
-
+
def test_render_empty_virtual_menu_node_with_children
# only empty item with no click target
Index: test/unit/lib/redmine/menu_manager/menu_item_test.rb
===================================================================
--- test/unit/lib/redmine/menu_manager/menu_item_test.rb (revision 16900)
+++ test/unit/lib/redmine/menu_manager/menu_item_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/menu_manager_test.rb
===================================================================
--- test/unit/lib/redmine/menu_manager_test.rb (revision 16900)
+++ test/unit/lib/redmine/menu_manager_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/mime_type_test.rb
===================================================================
--- test/unit/lib/redmine/mime_type_test.rb (revision 16900)
+++ test/unit/lib/redmine/mime_type_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/notifiable_test.rb
===================================================================
--- test/unit/lib/redmine/notifiable_test.rb (revision 16900)
+++ test/unit/lib/redmine/notifiable_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/pagination_helper_test.rb
===================================================================
--- test/unit/lib/redmine/pagination_helper_test.rb (revision 16900)
+++ test/unit/lib/redmine/pagination_helper_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/pagination_test.rb
===================================================================
--- test/unit/lib/redmine/pagination_test.rb (revision 16900)
+++ test/unit/lib/redmine/pagination_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/plugin_test.rb
===================================================================
--- test/unit/lib/redmine/plugin_test.rb (revision 16900)
+++ test/unit/lib/redmine/plugin_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/safe_attributes_test.rb
===================================================================
--- test/unit/lib/redmine/safe_attributes_test.rb (revision 16900)
+++ test/unit/lib/redmine/safe_attributes_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/scm/adapters/filesystem_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/filesystem_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/filesystem_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/git_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/git_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -78,12 +79,12 @@
end
assert_equal 6, brs.length
br_issue_8857 = brs[0]
- assert_equal 'issue-8857', br_issue_8857.to_s
+ assert_equal 'issue-8857', br_issue_8857.to_s
assert_equal '2a682156a3b6e77a8bf9cd4590e8db757f3c6c78', br_issue_8857.revision
assert_equal br_issue_8857.scmid, br_issue_8857.revision
assert_equal false, br_issue_8857.is_default
br_latin_1_path = brs[1]
- assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s
+ assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s
assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', br_latin_1_path.revision
assert_equal br_latin_1_path.scmid, br_latin_1_path.revision
assert_equal false, br_latin_1_path.is_default
Index: test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -41,9 +42,9 @@
'ISO-8859-1')
@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".dup.force_encoding('UTF-8')
+ @branch_char_0 = "branch-#{CHAR_1_HEX}-00".dup.force_encoding('UTF-8')
+ @branch_char_1 = "branch-#{CHAR_1_HEX}-01".dup.force_encoding('UTF-8')
end
def test_hgversion
Index: test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb
===================================================================
--- test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb (revision 16900)
+++ test/unit/lib/redmine/scm/adapters/subversion_adapter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/syntax_highlighting/coderay_test.rb
===================================================================
--- test/unit/lib/redmine/syntax_highlighting/coderay_test.rb (revision 16900)
+++ test/unit/lib/redmine/syntax_highlighting/coderay_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/themes_test.rb
===================================================================
--- test/unit/lib/redmine/themes_test.rb (revision 16900)
+++ test/unit/lib/redmine/themes_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/unified_diff_test.rb
===================================================================
--- test/unit/lib/redmine/unified_diff_test.rb (revision 16900)
+++ test/unit/lib/redmine/unified_diff_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -223,7 +224,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".dup.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
@@ -233,7 +234,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"".dup.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
@@ -277,8 +278,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".dup.force_encoding('UTF-8')
+ ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e".dup.force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-1.diff'), :type => 'sbs')
@@ -290,8 +291,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".dup.force_encoding('UTF-8')
+ ja2 = "\xe3\x81\xab\xe3\x81\xa3\xe3\x81\xbd\xe3\x82\x93\xe6\x97\xa5\xe6\x9c\xac".dup.force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-2.diff'), :type => 'sbs')
@@ -304,8 +305,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".dup.force_encoding('UTF-8')
+ ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe5\xa8\x98".dup.force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-3.diff'), :type => 'sbs')
@@ -318,8 +319,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".dup.force_encoding('UTF-8')
+ ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98".dup.force_encoding('UTF-8')
with_settings :repositories_encodings => '' do
diff = Redmine::UnifiedDiff.new(
read_diff_fixture('issue-13644-4.diff'), :type => 'sbs')
@@ -332,8 +333,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".dup.force_encoding('UTF-8')
+ ja2 = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x98ok".dup.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/lib/redmine/utils/date_calculation.rb
===================================================================
--- test/unit/lib/redmine/utils/date_calculation.rb (revision 16900)
+++ test/unit/lib/redmine/utils/date_calculation.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/views/builders/json_test.rb
===================================================================
--- test/unit/lib/redmine/views/builders/json_test.rb (revision 16900)
+++ test/unit/lib/redmine/views/builders/json_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/views/builders/xml_test.rb
===================================================================
--- test/unit/lib/redmine/views/builders/xml_test.rb (revision 16900)
+++ test/unit/lib/redmine/views/builders/xml_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/views/labelled_form_builder_test.rb
===================================================================
--- test/unit/lib/redmine/views/labelled_form_builder_test.rb (revision 16900)
+++ test/unit/lib/redmine/views/labelled_form_builder_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/html_parser_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/html_parser_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/wiki_formatting/macros_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/macros_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/macros_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -87,7 +88,7 @@
def test_multiple_macros_on_the_same_line
Redmine::WikiFormatting::Macros.macro :foo do |obj, args|
- args.any? ? "args: #{args.join(',')}" : "no args"
+ args.any? ? "args: #{args.join(',')}" : "no args"
end
assert_equal 'no args no args
', textilizable("{{foo}} {{foo}}")
@@ -210,7 +211,7 @@
text = "{{collapse\n*Collapsed* block of text\n}}"
with_locale 'en' do
result = textilizable(text)
-
+
assert_select_in result, 'div.collapsed-text'
assert_select_in result, 'strong', :text => 'Collapsed'
assert_select_in result, 'a.collapsible.collapsed', :text => 'Show'
@@ -247,7 +248,7 @@
h1. Title
{{collapse(Show example, Hide example)
-h2. Heading
+h2. Heading
}}"
RAW
Index: test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb (working copy)
@@ -1,4 +1,5 @@
-#encoding: utf-8
+# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -276,7 +277,7 @@
This is a table with trailing whitespace in one row:
|cell11|cell12|
-|cell21|cell22|
+|cell21|cell22|
|cell31|cell32|
RAW
@@ -378,8 +379,8 @@
expected = ';")
'
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
end
-
-
+
+
STR_WITHOUT_PRE = [
# 0
"h1. Title
@@ -409,36 +410,36 @@
Ut rhoncus elementum adipiscing."]
TEXT_WITHOUT_PRE = STR_WITHOUT_PRE.join("\n\n").freeze
-
+
def test_get_section_should_return_the_requested_section_and_its_hash
assert_section_with_hash STR_WITHOUT_PRE[1], TEXT_WITHOUT_PRE, 2
assert_section_with_hash STR_WITHOUT_PRE[2..3].join("\n\n"), TEXT_WITHOUT_PRE, 3
assert_section_with_hash STR_WITHOUT_PRE[3], TEXT_WITHOUT_PRE, 5
assert_section_with_hash STR_WITHOUT_PRE[4], TEXT_WITHOUT_PRE, 6
-
+
assert_section_with_hash '', TEXT_WITHOUT_PRE, 0
assert_section_with_hash '', TEXT_WITHOUT_PRE, 10
end
-
+
def test_update_section_should_update_the_requested_section
replacement = "New text"
-
+
assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement)
assert_equal [STR_WITHOUT_PRE[0..1], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(3, replacement)
assert_equal [STR_WITHOUT_PRE[0..2], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(5, replacement)
assert_equal [STR_WITHOUT_PRE[0..3], replacement].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(6, replacement)
-
+
assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(0, replacement)
assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(10, replacement)
end
-
+
def test_update_section_with_hash_should_update_the_requested_section
replacement = "New text"
-
+
assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"),
@formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement, Digest::MD5.hexdigest(STR_WITHOUT_PRE[1]))
end
-
+
def test_update_section_with_wrong_hash_should_raise_an_error
assert_raise Redmine::WikiFormatting::StaleSectionError do
@formatter.new(TEXT_WITHOUT_PRE).update_section(2, "New text", Digest::MD5.hexdigest("Old text"))
@@ -489,7 +490,7 @@
def test_update_section_should_not_escape_pre_content_outside_section
text = STR_WITH_PRE.join("\n\n")
replacement = "New text"
-
+
assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"),
@formatter.new(text).update_section(3, replacement)
end
@@ -504,13 +505,13 @@
h1. Heading 2
Content 2
-
+
h1. Heading 3
Content 3
h1. Heading 4
-
+
Content 4
STR
@@ -588,10 +589,10 @@
def to_html(text)
@formatter.new(text).to_html
end
-
+
def assert_section_with_hash(expected, text, index)
result = @formatter.new(text).get_section(index)
-
+
assert_kind_of Array, result
assert_equal 2, result.size
assert_equal expected, result.first, "section content did not match"
Index: test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/lib/redmine/wiki_formatting_test.rb
===================================================================
--- test/unit/lib/redmine/wiki_formatting_test.rb (revision 16900)
+++ test/unit/lib/redmine/wiki_formatting_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -64,7 +65,7 @@
link: https://www.redmine.org
http://www.redmine.org
EXPECTED
-
+
end
def test_supports_section_edit
@@ -71,7 +72,7 @@
with_settings :text_formatting => 'textile' do
assert_equal true, Redmine::WikiFormatting.supports_section_edit?
end
-
+
with_settings :text_formatting => '' do
assert_equal false, Redmine::WikiFormatting.supports_section_edit?
end
Index: test/unit/lib/redmine_test.rb
===================================================================
--- test/unit/lib/redmine_test.rb (revision 16900)
+++ test/unit/lib/redmine_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/mail_handler_test.rb
===================================================================
--- test/unit/mail_handler_test.rb (revision 16900)
+++ test/unit/mail_handler_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -505,7 +506,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".dup.force_encoding('UTF-8')
tracker = Tracker.generate!(:name => ja_dev)
Project.find(1).trackers << tracker
issue = submit_email(
@@ -540,7 +541,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".dup.force_encoding('UTF-8')
attachment = issue.attachments.first
assert_equal ja, attachment.filename
assert_equal 5, attachment.filesize
@@ -555,7 +556,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?".dup.force_encoding('UTF-8')
assert_equal description, issue.description
end
@@ -566,7 +567,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".dup.force_encoding('UTF-8')
attachment = issue.attachments.first
assert_equal ja, attachment.filename
assert_equal 5, attachment.filesize
@@ -582,8 +583,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 = "".dup.force_encoding('UTF-8')
+ u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc".dup.force_encoding('UTF-8')
11.times { u << u1 }
attachment = issue.attachments.first
assert_equal "#{u}.png", attachment.filename
@@ -600,8 +601,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 = "".dup.force_encoding('UTF-8')
+ u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc".dup.force_encoding('UTF-8')
11.times { u << u1 }
attachment = issue.attachments.first
assert_equal "#{u}.txt", attachment.filename
@@ -623,8 +624,8 @@
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')
- assert_equal content, File.read(attachment.diskfile).force_encoding('CP852')
+ content = "p\xF8\xEDli\xB9 \xBEluou\xE8k\xFD k\xF9n".dup.force_encoding('CP852')
+ assert_equal content, File.read(attachment.diskfile).dup.force_encoding('CP852')
end
def test_multiple_inline_text_parts_should_be_appended_to_issue_description
@@ -657,7 +658,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...".dup.force_encoding('UTF-8')
assert_kind_of Issue, issue
assert_equal str, issue.subject
end
@@ -668,7 +669,7 @@
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
- str = "Freundliche Gr\xc3\xbcsse".force_encoding('UTF-8')
+ str = "Freundliche Gr\xc3\xbcsse".dup.force_encoding('UTF-8')
assert_equal str, issue.description
end
@@ -678,7 +679,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.".dup.force_encoding('UTF-8')
assert issue.description.include?(str)
end
@@ -688,7 +689,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".dup.force_encoding('UTF-8')
assert_equal ja, issue.subject
end
@@ -695,7 +696,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.".dup.force_encoding('UTF-8')
issue = submit_email(
'body_ks_c_5601-1987.eml',
:issue => {:project => 'ecookbook'}
@@ -719,7 +720,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".dup.force_encoding('UTF-8')
assert_equal ja, issue.subject
end
@@ -1110,8 +1111,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".dup.force_encoding('UTF-8')
+ str2 = "\xc3\x96\xc3\xb6".dup.force_encoding('UTF-8')
assert_equal str1, user.firstname
assert_equal str2, user.lastname
end
Index: test/unit/mailer_test.rb
===================================================================
--- test/unit/mailer_test.rb (revision 16900)
+++ test/unit/mailer_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/member_test.rb
===================================================================
--- test/unit/member_test.rb (revision 16900)
+++ test/unit/member_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -85,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)".dup.force_encoding('UTF-8'),
[member.errors.full_messages].flatten.join
end
Index: test/unit/message_test.rb
===================================================================
--- test/unit/message_test.rb (revision 16900)
+++ test/unit/message_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/news_test.rb
===================================================================
--- test/unit/news_test.rb (revision 16900)
+++ test/unit/news_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/principal_test.rb
===================================================================
--- test/unit/principal_test.rb (revision 16900)
+++ test/unit/principal_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/project_copy_test.rb
===================================================================
--- test/unit/project_copy_test.rb (revision 16900)
+++ test/unit/project_copy_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/project_members_inheritance_test.rb
===================================================================
--- test/unit/project_members_inheritance_test.rb (revision 16900)
+++ test/unit/project_members_inheritance_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/project_nested_set_concurrency_test.rb
===================================================================
--- test/unit/project_nested_set_concurrency_test.rb (revision 16900)
+++ test/unit/project_nested_set_concurrency_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/project_nested_set_test.rb
===================================================================
--- test/unit/project_nested_set_test.rb (revision 16900)
+++ test/unit/project_nested_set_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/project_test.rb
===================================================================
--- test/unit/project_test.rb (revision 16900)
+++ test/unit/project_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/query_test.rb
===================================================================
--- test/unit/query_test.rb (revision 16900)
+++ test/unit/query_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -1717,7 +1718,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".dup.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 16900)
+++ test/unit/repository_bazaar_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -44,8 +45,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".dup.force_encoding('UTF-8')
+ CHAR_1_LATIN1_HEX = "\xdc".dup.force_encoding('ASCII-8BIT')
def setup
@project = Project.find(3)
@@ -69,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)".dup.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 16900)
+++ test/unit/repository_cvs_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -52,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)".dup.force_encoding('UTF-8')
repo = Repository::Cvs.new(
:project => @project,
:identifier => 'test',
@@ -80,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)".dup.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 16900)
+++ test/unit/repository_filesystem_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -47,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)".dup.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 16900)
+++ test/unit/repository_git_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -28,8 +29,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".dup.force_encoding('UTF-8')
+ CHAR_1_HEX = "\xc3\x9c".dup.force_encoding('UTF-8')
## Git, Mercurial and CVS path encodings are binary.
## Subversion supports URL encoding for path.
@@ -93,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)".dup.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 16900)
+++ test/unit/repository_mercurial_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -25,8 +26,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".dup.force_encoding('UTF-8')
+ BRANCH_CHAR_1 = "branch-#{CHAR_1_HEX}-01".dup.force_encoding('UTF-8')
def setup
@project = Project.find(3)
@@ -51,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)".dup.force_encoding('UTF-8')
repo = Repository::Mercurial.new(
:project => @project,
:url => "",
Index: test/unit/repository_subversion_test.rb
===================================================================
--- test/unit/repository_subversion_test.rb (revision 16900)
+++ test/unit/repository_subversion_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -233,7 +234,7 @@
def test_log_encoding_ignore_setting
with_settings :commit_logs_encoding => 'windows-1252' do
- s2 = "\xc3\x82\xc2\x80".force_encoding('UTF-8')
+ s2 = "\xc3\x82\xc2\x80".dup.force_encoding('UTF-8')
c = Changeset.new(:repository => @repository,
:comments => s2,
:revision => '123',
Index: test/unit/repository_test.rb
===================================================================
--- test/unit/repository_test.rb (revision 16900)
+++ test/unit/repository_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
@@ -55,7 +56,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)".dup.force_encoding('UTF-8')
repo = Repository::Bazaar.new(
:project => Project.find(3),
:url => "/test"
@@ -281,7 +282,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".dup
3.times {comment << "#{long_whitespace}\n"}
changeset = Changeset.new(
:comments => comment, :commit_date => Time.now,
Index: test/unit/role_test.rb
===================================================================
--- test/unit/role_test.rb (revision 16900)
+++ test/unit/role_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/search_test.rb
===================================================================
--- test/unit/search_test.rb (revision 16900)
+++ test/unit/search_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/setting_test.rb
===================================================================
--- test/unit/setting_test.rb (revision 16900)
+++ test/unit/setting_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
Index: test/unit/time_entry_activity_test.rb
===================================================================
--- test/unit/time_entry_activity_test.rb (revision 16900)
+++ test/unit/time_entry_activity_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/time_entry_query_test.rb
===================================================================
--- test/unit/time_entry_query_test.rb (revision 16900)
+++ test/unit/time_entry_query_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/time_entry_test.rb
===================================================================
--- test/unit/time_entry_test.rb (revision 16900)
+++ test/unit/time_entry_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/token_test.rb
===================================================================
--- test/unit/token_test.rb (revision 16900)
+++ test/unit/token_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/tracker_test.rb
===================================================================
--- test/unit/tracker_test.rb (revision 16900)
+++ test/unit/tracker_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/user_preference_test.rb
===================================================================
--- test/unit/user_preference_test.rb (revision 16900)
+++ test/unit/user_preference_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/user_test.rb
===================================================================
--- test/unit/user_test.rb (revision 16900)
+++ test/unit/user_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/version_test.rb
===================================================================
--- test/unit/version_test.rb (revision 16900)
+++ test/unit/version_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/watcher_test.rb
===================================================================
--- test/unit/watcher_test.rb (revision 16900)
+++ test/unit/watcher_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/wiki_content_test.rb
===================================================================
--- test/unit/wiki_content_test.rb (revision 16900)
+++ test/unit/wiki_content_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/wiki_content_version_test.rb
===================================================================
--- test/unit/wiki_content_version_test.rb (revision 16900)
+++ test/unit/wiki_content_version_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/wiki_page_test.rb
===================================================================
--- test/unit/wiki_page_test.rb (revision 16900)
+++ test/unit/wiki_page_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/wiki_redirect_test.rb
===================================================================
--- test/unit/wiki_redirect_test.rb (revision 16900)
+++ test/unit/wiki_redirect_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/wiki_test.rb
===================================================================
--- test/unit/wiki_test.rb (revision 16900)
+++ test/unit/wiki_test.rb (working copy)
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@@ -78,7 +79,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".dup.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
Index: test/unit/workflow_test.rb
===================================================================
--- test/unit/workflow_test.rb (revision 16900)
+++ test/unit/workflow_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
Index: test/unit/workflow_transition_test.rb
===================================================================
--- test/unit/workflow_transition_test.rb (revision 16900)
+++ test/unit/workflow_transition_test.rb (working copy)
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#