summaryrefslogtreecommitdiffstats
path: root/lib/tasks
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-22 17:37:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-22 17:37:16 +0000
commit2d1866d966d94c688f9cb87c5bf3f096dffac844 (patch)
tree7a733c1cc51448ab69b3f892285305dbfb0ae15e /lib/tasks
parenta6ec78a4dc658e3517ed682792016b6530458696 (diff)
downloadredmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.tar.gz
redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.zip
Merged rails-4.1 branch (#14534).
git-svn-id: http://svn.redmine.org/redmine/trunk@13482 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/ci.rake4
-rw-r--r--lib/tasks/locales.rake3
-rw-r--r--lib/tasks/migrate_from_mantis.rake8
-rw-r--r--lib/tasks/migrate_from_trac.rake10
4 files changed, 5 insertions, 20 deletions
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index 41a334c5e..857cc232d 100644
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -33,7 +33,7 @@ namespace :ci do
else
Rake::Task["test"].invoke
end
- # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3'
+ # Rake::Task["test:ui"].invoke
end
desc "Finish the build"
@@ -52,7 +52,7 @@ file 'config/database.yml' do
case database
when 'mysql'
- dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'),
+ dev_conf = {'adapter' => 'mysql2',
'database' => dev_db_name, 'host' => 'localhost',
'encoding' => 'utf8'}
if ENV['RUN_ON_NOT_OFFICIAL']
diff --git a/lib/tasks/locales.rake b/lib/tasks/locales.rake
index 6311d6ab1..7d2ecfe80 100644
--- a/lib/tasks/locales.rake
+++ b/lib/tasks/locales.rake
@@ -68,9 +68,6 @@ namespace :locales do
desc <<-END_DESC
Removes a translation string from all locale file (only works for top-level childless non-multiline keys, probably doesn\'t work on windows).
-This task does not work on Ruby 1.8.6.
-You need to use Ruby 1.8.7 or later.
-
Options:
key=key_1,key_2 Comma-separated list of keys to delete
skip=en,de Comma-separated list of locale files to ignore (filename without extension)
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake
index 2d5f66f81..1040dbb0a 100644
--- a/lib/tasks/migrate_from_mantis.rake
+++ b/lib/tasks/migrate_from_mantis.rake
@@ -18,7 +18,6 @@
desc 'Mantis migration script'
require 'active_record'
-require 'iconv' if RUBY_VERSION < '1.9'
require 'pp'
namespace :redmine do
@@ -452,12 +451,7 @@ task :migrate_from_mantis => :environment do
end
def self.encode(text)
- if RUBY_VERSION < '1.9'
- @ic ||= Iconv.new('UTF-8', @charset)
- @ic.iconv text
- else
- text.to_s.force_encoding(@charset).encode('UTF-8')
- end
+ text.to_s.force_encoding(@charset).encode('UTF-8')
end
end
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 0d1af9abc..d1a3873f5 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'active_record'
-require 'iconv' if RUBY_VERSION < '1.9'
require 'pp'
namespace :redmine do
@@ -155,7 +154,7 @@ namespace :redmine do
attachment_type = read_attribute(:type)
#replace exotic characters with their hex representation to avoid invalid filenames
trac_file = filename.gsub( /[^a-zA-Z0-9\-_\.!~*']/n ) do |x|
- codepoint = RUBY_VERSION < '1.9' ? x[0] : x.codepoints.to_a[0]
+ codepoint = x.codepoints.to_a[0]
sprintf('%%%02x', codepoint)
end
"#{TracMigrate.trac_attachments_directory}/#{attachment_type}/#{id}/#{trac_file}"
@@ -715,12 +714,7 @@ namespace :redmine do
end
def self.encode(text)
- if RUBY_VERSION < '1.9'
- @ic ||= Iconv.new('UTF-8', @charset)
- @ic.iconv text
- else
- text.to_s.force_encoding(@charset).encode('UTF-8')
- end
+ text.to_s.force_encoding(@charset).encode('UTF-8')
end
end