Index: lib/plugins/acts_as_tree/Rakefile =================================================================== --- lib/plugins/acts_as_tree/Rakefile (revision 16900) +++ lib/plugins/acts_as_tree/Rakefile (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'rake' require 'rake/testtask' require 'rake/rdoctask' Index: lib/plugins/gravatar/Rakefile =================================================================== --- lib/plugins/gravatar/Rakefile (revision 16900) +++ lib/plugins/gravatar/Rakefile (working copy) @@ -1,32 +1,33 @@ -require 'spec/rake/spectask' -require 'rake/rdoctask' - -desc 'Default: run all specs' -task :default => :spec - -desc 'Run all application-specific specs' -Spec::Rake::SpecTask.new(:spec) do |t| - # t.rcov = true -end - -desc "Report code statistics (KLOCs, etc) from the application" -task :stats do - RAILS_ROOT = File.dirname(__FILE__) - STATS_DIRECTORIES = [ - %w(Libraries lib/), - %w(Specs spec/), - ].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) } - require 'code_statistics' - CodeStatistics.new(*STATS_DIRECTORIES).to_s -end - -namespace :doc do - desc 'Generate documentation for the assert_request plugin.' - Rake::RDocTask.new(:plugin) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Gravatar Rails Plugin' - rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=rw' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') - end -end +# frozen_string_literal: true +require 'spec/rake/spectask' +require 'rake/rdoctask' + +desc 'Default: run all specs' +task :default => :spec + +desc 'Run all application-specific specs' +Spec::Rake::SpecTask.new(:spec) do |t| + # t.rcov = true +end + +desc "Report code statistics (KLOCs, etc) from the application" +task :stats do + RAILS_ROOT = File.dirname(__FILE__) + STATS_DIRECTORIES = [ + %w(Libraries lib/), + %w(Specs spec/), + ].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) } + require 'code_statistics' + CodeStatistics.new(*STATS_DIRECTORIES).to_s +end + +namespace :doc do + desc 'Generate documentation for the assert_request plugin.' + Rake::RDocTask.new(:plugin) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'Gravatar Rails Plugin' + rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=rw' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') + end +end Index: lib/plugins/open_id_authentication/Rakefile =================================================================== --- lib/plugins/open_id_authentication/Rakefile (revision 16900) +++ lib/plugins/open_id_authentication/Rakefile (working copy) @@ -1,22 +1,23 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the open_id_authentication plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the open_id_authentication plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'OpenIdAuthentication' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end +# frozen_string_literal: true +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +desc 'Default: run unit tests.' +task :default => :test + +desc 'Test the open_id_authentication plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.pattern = 'test/**/*_test.rb' + t.verbose = true +end + +desc 'Generate documentation for the open_id_authentication plugin.' +Rake::RDocTask.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'OpenIdAuthentication' + rdoc.options << '--line-numbers' << '--inline-source' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') +end Index: Rakefile =================================================================== --- Rakefile (revision 16900) +++ Rakefile (working copy) @@ -1,7 +1,8 @@ -#!/usr/bin/env rake -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -RedmineApp::Application.load_tasks +# frozen_string_literal: true +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +RedmineApp::Application.load_tasks Index: lib/plugins/open_id_authentication/lib/tasks/open_id_authentication_tasks.rake =================================================================== --- lib/plugins/open_id_authentication/lib/tasks/open_id_authentication_tasks.rake (revision 16900) +++ lib/plugins/open_id_authentication/lib/tasks/open_id_authentication_tasks.rake (working copy) @@ -1,30 +1,31 @@ -namespace :open_id_authentication do - namespace :db do - desc "Creates authentication tables for use with OpenIdAuthentication" - task :create => :environment do - generate_migration(["open_id_authentication_tables", "add_open_id_authentication_tables"]) - end - - desc "Upgrade authentication tables from ruby-openid 1.x.x to 2.x.x" - task :upgrade => :environment do - generate_migration(["upgrade_open_id_authentication_tables", "upgrade_open_id_authentication_tables"]) - end - - def generate_migration(args) - require 'rails_generator' - require 'rails_generator/scripts/generate' - - if ActiveRecord::Base.connection.supports_migrations? - Rails::Generator::Scripts::Generate.new.run(args) - else - raise "Task unavailable to this database (no migration support)" - end - end - - desc "Clear the authentication tables" - task :clear => :environment do - OpenIdAuthentication::DbStore.cleanup_nonces - OpenIdAuthentication::DbStore.cleanup_associations - end - end -end +# frozen_string_literal: true +namespace :open_id_authentication do + namespace :db do + desc "Creates authentication tables for use with OpenIdAuthentication" + task :create => :environment do + generate_migration(["open_id_authentication_tables", "add_open_id_authentication_tables"]) + end + + desc "Upgrade authentication tables from ruby-openid 1.x.x to 2.x.x" + task :upgrade => :environment do + generate_migration(["upgrade_open_id_authentication_tables", "upgrade_open_id_authentication_tables"]) + end + + def generate_migration(args) + require 'rails_generator' + require 'rails_generator/scripts/generate' + + if ActiveRecord::Base.connection.supports_migrations? + Rails::Generator::Scripts::Generate.new.run(args) + else + raise "Task unavailable to this database (no migration support)" + end + end + + desc "Clear the authentication tables" + task :clear => :environment do + OpenIdAuthentication::DbStore.cleanup_nonces + OpenIdAuthentication::DbStore.cleanup_associations + end + end +end Index: lib/tasks/ci.rake =================================================================== --- lib/tasks/ci.rake (revision 16900) +++ lib/tasks/ci.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true desc "Run the Continuous Integration tests for Redmine" task :ci do # RAILS_ENV and ENV[] can diverge so force them both to test Index: lib/tasks/ciphering.rake =================================================================== --- lib/tasks/ciphering.rake (revision 16900) +++ lib/tasks/ciphering.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: lib/tasks/deprecated.rake =================================================================== --- lib/tasks/deprecated.rake (revision 16900) +++ lib/tasks/deprecated.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true def deprecated_task(name, new_name) task name=>new_name do $stderr.puts "\nNote: The rake task #{name} has been deprecated, please use the replacement version #{new_name}" Index: lib/tasks/email.rake =================================================================== --- lib/tasks/email.rake (revision 16900) +++ lib/tasks/email.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: lib/tasks/extract_fixtures.rake =================================================================== --- lib/tasks/extract_fixtures.rake (revision 16900) +++ lib/tasks/extract_fixtures.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true desc 'Create YAML test fixtures from data in an existing database. Defaults to development database. Set RAILS_ENV to override.' Index: lib/tasks/initializers.rake =================================================================== --- lib/tasks/initializers.rake (revision 16900) +++ lib/tasks/initializers.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true desc 'Generates a secret token for the application.' file 'config/initializers/secret_token.rb' do Index: lib/tasks/load_default_data.rake =================================================================== --- lib/tasks/load_default_data.rake (revision 16900) +++ lib/tasks/load_default_data.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true desc 'Load Redmine default configuration data. Language is chosen interactively or by setting REDMINE_LANG environment variable.' namespace :redmine do Index: lib/tasks/locales.rake =================================================================== --- lib/tasks/locales.rake (revision 16900) +++ lib/tasks/locales.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true desc 'Updates and checks locales against en.yml' task :locales do %w(locales:update locales:check_interpolation).collect do |task| Index: lib/tasks/metrics.rake =================================================================== --- lib/tasks/metrics.rake (revision 16900) +++ lib/tasks/metrics.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true begin require 'metric_fu' rescue LoadError Index: lib/tasks/migrate_from_mantis.rake =================================================================== --- lib/tasks/migrate_from_mantis.rake (revision 16900) +++ lib/tasks/migrate_from_mantis.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: lib/tasks/migrate_from_trac.rake =================================================================== --- lib/tasks/migrate_from_trac.rake (revision 16900) +++ lib/tasks/migrate_from_trac.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: lib/tasks/permissions.rake =================================================================== --- lib/tasks/permissions.rake (revision 16900) +++ lib/tasks/permissions.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true namespace :redmine do desc "List all permissions and the actions registered with them" task :permissions => :environment do Index: lib/tasks/redmine.rake =================================================================== --- lib/tasks/redmine.rake (revision 16900) +++ lib/tasks/redmine.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: lib/tasks/reminder.rake =================================================================== --- lib/tasks/reminder.rake (revision 16900) +++ lib/tasks/reminder.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # @@ -36,7 +37,7 @@ options[:project] = ENV['project'] if ENV['project'] options[:tracker] = ENV['tracker'].to_i if ENV['tracker'] options[:users] = (ENV['users'] || '').split(',').each(&:strip!) - options[:version] = ENV['version'] if ENV['version'] + options[:version] = ENV['version'] if ENV['version'] Mailer.with_synched_deliveries do Mailer.reminders(options) Index: lib/tasks/testing.rake =================================================================== --- lib/tasks/testing.rake (revision 16900) +++ lib/tasks/testing.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true namespace :test do desc 'Measures test coverage' task :coverage do Index: lib/tasks/yardoc.rake =================================================================== --- lib/tasks/yardoc.rake (revision 16900) +++ lib/tasks/yardoc.rake (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true begin require 'yard' Index: app/controllers/account_controller.rb =================================================================== --- app/controllers/account_controller.rb (revision 16900) +++ app/controllers/account_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/activities_controller.rb =================================================================== --- app/controllers/activities_controller.rb (revision 16900) +++ app/controllers/activities_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/admin_controller.rb =================================================================== --- app/controllers/admin_controller.rb (revision 16900) +++ app/controllers/admin_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/application_controller.rb =================================================================== --- app/controllers/application_controller.rb (revision 16900) +++ app/controllers/application_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/attachments_controller.rb =================================================================== --- app/controllers/attachments_controller.rb (revision 16900) +++ app/controllers/attachments_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/auth_sources_controller.rb =================================================================== --- app/controllers/auth_sources_controller.rb (revision 16900) +++ app/controllers/auth_sources_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/auto_completes_controller.rb =================================================================== --- app/controllers/auto_completes_controller.rb (revision 16900) +++ app/controllers/auto_completes_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/boards_controller.rb =================================================================== --- app/controllers/boards_controller.rb (revision 16900) +++ app/controllers/boards_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/calendars_controller.rb =================================================================== --- app/controllers/calendars_controller.rb (revision 16900) +++ app/controllers/calendars_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/comments_controller.rb =================================================================== --- app/controllers/comments_controller.rb (revision 16900) +++ app/controllers/comments_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/context_menus_controller.rb =================================================================== --- app/controllers/context_menus_controller.rb (revision 16900) +++ app/controllers/context_menus_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/custom_field_enumerations_controller.rb =================================================================== --- app/controllers/custom_field_enumerations_controller.rb (revision 16900) +++ app/controllers/custom_field_enumerations_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/custom_fields_controller.rb =================================================================== --- app/controllers/custom_fields_controller.rb (revision 16900) +++ app/controllers/custom_fields_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/documents_controller.rb =================================================================== --- app/controllers/documents_controller.rb (revision 16900) +++ app/controllers/documents_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/email_addresses_controller.rb =================================================================== --- app/controllers/email_addresses_controller.rb (revision 16900) +++ app/controllers/email_addresses_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/enumerations_controller.rb =================================================================== --- app/controllers/enumerations_controller.rb (revision 16900) +++ app/controllers/enumerations_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/files_controller.rb =================================================================== --- app/controllers/files_controller.rb (revision 16900) +++ app/controllers/files_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/gantts_controller.rb =================================================================== --- app/controllers/gantts_controller.rb (revision 16900) +++ app/controllers/gantts_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/groups_controller.rb =================================================================== --- app/controllers/groups_controller.rb (revision 16900) +++ app/controllers/groups_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/imports_controller.rb =================================================================== --- app/controllers/imports_controller.rb (revision 16900) +++ app/controllers/imports_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/issue_categories_controller.rb =================================================================== --- app/controllers/issue_categories_controller.rb (revision 16900) +++ app/controllers/issue_categories_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/issue_relations_controller.rb =================================================================== --- app/controllers/issue_relations_controller.rb (revision 16900) +++ app/controllers/issue_relations_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/issue_statuses_controller.rb =================================================================== --- app/controllers/issue_statuses_controller.rb (revision 16900) +++ app/controllers/issue_statuses_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/issues_controller.rb =================================================================== --- app/controllers/issues_controller.rb (revision 16900) +++ app/controllers/issues_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/journals_controller.rb =================================================================== --- app/controllers/journals_controller.rb (revision 16900) +++ app/controllers/journals_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # @@ -70,7 +71,8 @@ end # Replaces pre blocks with [...] text = text.to_s.strip.gsub(%r{
(.*?)
}m, '[...]') - @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> " + @content = ''.dup + @content << "#{ll(Setting.default_language, :text_user_wrote, user)}\n> " @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" rescue ActiveRecord::RecordNotFound render_404 Index: app/controllers/mail_handler_controller.rb =================================================================== --- app/controllers/mail_handler_controller.rb (revision 16900) +++ app/controllers/mail_handler_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/members_controller.rb =================================================================== --- app/controllers/members_controller.rb (revision 16900) +++ app/controllers/members_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/messages_controller.rb =================================================================== --- app/controllers/messages_controller.rb (revision 16900) +++ app/controllers/messages_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # @@ -112,7 +113,8 @@ @subject = @message.subject @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') - @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " + @content = ''.dup + @content << "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " @content << @message.content.to_s.strip.gsub(%r{
(.*?)
}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" end Index: app/controllers/my_controller.rb =================================================================== --- app/controllers/my_controller.rb (revision 16900) +++ app/controllers/my_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/news_controller.rb =================================================================== --- app/controllers/news_controller.rb (revision 16900) +++ app/controllers/news_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/previews_controller.rb =================================================================== --- app/controllers/previews_controller.rb (revision 16900) +++ app/controllers/previews_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/principal_memberships_controller.rb =================================================================== --- app/controllers/principal_memberships_controller.rb (revision 16900) +++ app/controllers/principal_memberships_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/project_enumerations_controller.rb =================================================================== --- app/controllers/project_enumerations_controller.rb (revision 16900) +++ app/controllers/project_enumerations_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/projects_controller.rb =================================================================== --- app/controllers/projects_controller.rb (revision 16900) +++ app/controllers/projects_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/queries_controller.rb =================================================================== --- app/controllers/queries_controller.rb (revision 16900) +++ app/controllers/queries_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/reports_controller.rb =================================================================== --- app/controllers/reports_controller.rb (revision 16900) +++ app/controllers/reports_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/repositories_controller.rb =================================================================== --- app/controllers/repositories_controller.rb (revision 16900) +++ app/controllers/repositories_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/roles_controller.rb =================================================================== --- app/controllers/roles_controller.rb (revision 16900) +++ app/controllers/roles_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/search_controller.rb =================================================================== --- app/controllers/search_controller.rb (revision 16900) +++ app/controllers/search_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # @@ -21,7 +22,7 @@ def index @question = params[:q] || "" - @question.strip! + @question = @question.strip @all_words = params[:all_words] ? params[:all_words].present? : true @titles_only = params[:titles_only] ? params[:titles_only].present? : false @search_attachments = params[:attachments].presence || '0' Index: app/controllers/settings_controller.rb =================================================================== --- app/controllers/settings_controller.rb (revision 16900) +++ app/controllers/settings_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/sys_controller.rb =================================================================== --- app/controllers/sys_controller.rb (revision 16900) +++ app/controllers/sys_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/timelog_controller.rb =================================================================== --- app/controllers/timelog_controller.rb (revision 16900) +++ app/controllers/timelog_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/trackers_controller.rb =================================================================== --- app/controllers/trackers_controller.rb (revision 16900) +++ app/controllers/trackers_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/users_controller.rb =================================================================== --- app/controllers/users_controller.rb (revision 16900) +++ app/controllers/users_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/versions_controller.rb =================================================================== --- app/controllers/versions_controller.rb (revision 16900) +++ app/controllers/versions_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: trues # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/watchers_controller.rb =================================================================== --- app/controllers/watchers_controller.rb (revision 16900) +++ app/controllers/watchers_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/welcome_controller.rb =================================================================== --- app/controllers/welcome_controller.rb (revision 16900) +++ app/controllers/welcome_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/wiki_controller.rb =================================================================== --- app/controllers/wiki_controller.rb (revision 16900) +++ app/controllers/wiki_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/wikis_controller.rb =================================================================== --- app/controllers/wikis_controller.rb (revision 16900) +++ app/controllers/wikis_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/controllers/workflows_controller.rb =================================================================== --- app/controllers/workflows_controller.rb (revision 16900) +++ app/controllers/workflows_controller.rb (working copy) @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang # Index: app/helpers/account_helper.rb =================================================================== --- app/helpers/account_helper.rb (revision 16900) +++ app/helpers/account_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/activities_helper.rb =================================================================== --- app/helpers/activities_helper.rb (revision 16900) +++ app/helpers/activities_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/admin_helper.rb =================================================================== --- app/helpers/admin_helper.rb (revision 16900) +++ app/helpers/admin_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 @@ -17,6 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# frozen_string_literal: true + module AdminHelper def project_status_options_for_select(selected) options_for_select([[l(:label_all), ''], Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 16900) +++ app/helpers/application_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 @@ -237,7 +238,8 @@ end def toggle_link(name, id, options={}) - onclick = "$('##{id}').toggle(); " + onclick = ''.dup + onclick << "$('##{id}').toggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll] onclick << "return false;" @@ -281,7 +283,7 @@ # The given collection may be a subset of the whole project tree # (eg. some intermediate nodes are private and can not be seen) def render_project_nested_lists(projects, &block) - s = '' + s = ''.dup if projects.any? ancestors = [] original_project = @project @@ -311,7 +313,7 @@ end def render_page_hierarchy(pages, node=nil, options={}) - content = '' + content = ''.dup if pages[node] content << "