summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/abstract_adapter.rb2
-rw-r--r--lib/redmine/thumbnail.rb4
-rw-r--r--lib/redmine/utils.rb2
-rw-r--r--lib/tasks/testing.rake6
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb
index d0c3293a6..4c12f4a13 100644
--- a/lib/redmine/scm/adapters/abstract_adapter.rb
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb
@@ -216,7 +216,7 @@ module Redmine
writable = false
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.exist?(path)
if File.file?(path) && File.writable?(path)
writable = true
else
diff --git a/lib/redmine/thumbnail.rb b/lib/redmine/thumbnail.rb
index bb5c0ac06..c1da6aa41 100644
--- a/lib/redmine/thumbnail.rb
+++ b/lib/redmine/thumbnail.rb
@@ -36,14 +36,14 @@ module Redmine
return nil unless convert_available?
return nil if is_pdf && !gs_available?
- unless File.exists?(target)
+ unless File.exist?(target)
# Make sure we only invoke Imagemagick if the file type is allowed
mime_type = File.open(source) {|f| Marcel::MimeType.for(f)}
return nil if !ALLOWED_TYPES.include? mime_type
return nil if is_pdf && mime_type != "application/pdf"
directory = File.dirname(target)
- unless File.exists?(directory)
+ unless File.exist?(directory)
FileUtils.mkdir_p directory
end
size_option = "#{size}x#{size}>"
diff --git a/lib/redmine/utils.rb b/lib/redmine/utils.rb
index 2a8a04443..386919a25 100644
--- a/lib/redmine/utils.rb
+++ b/lib/redmine/utils.rb
@@ -51,7 +51,7 @@ module Redmine
def save_upload(upload, path)
directory = File.dirname(path)
- unless File.exists?(directory)
+ unless File.exist?(directory)
FileUtils.mkdir_p directory
end
File.open(path, "wb") do |f|
diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake
index 6a44c3eb7..3088a4c2d 100644
--- a/lib/tasks/testing.rake
+++ b/lib/tasks/testing.rake
@@ -31,7 +31,7 @@ namespace :test do
desc "Creates a test subversion repository"
task :subversion => :create_dir do
repo_path = "tmp/test/subversion_repository"
- unless File.exists?(repo_path)
+ unless File.exist?(repo_path)
system "svnadmin create #{repo_path}"
system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
end
@@ -40,7 +40,7 @@ namespace :test do
desc "Creates a test mercurial repository"
task :mercurial => :create_dir do
repo_path = "tmp/test/mercurial_repository"
- unless File.exists?(repo_path)
+ unless File.exist?(repo_path)
bundle_path = "test/fixtures/repositories/mercurial_repository.hg"
system "hg init #{repo_path}"
system "hg -R #{repo_path} pull #{bundle_path}"
@@ -48,7 +48,7 @@ namespace :test do
end
def extract_tar_gz(prefix)
- unless File.exists?("tmp/test/#{prefix}_repository")
+ unless File.exist?("tmp/test/#{prefix}_repository")
# system "gunzip < test/fixtures/repositories/#{prefix}_repository.tar.gz | tar -xv -C tmp/test"
system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{prefix}_repository.tar.gz"
end