Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New: Ruby 2.1 compatibility fixes

  • Loading branch information...
commit 6202972e46c95b6e2db6a8deab6e18eb3b3fa3cc 1 parent db759db
@scrapper scrapper authored
View
2  lib/taskjuggler/AppConfig.rb
@@ -109,7 +109,7 @@ def AppConfig.dataDirs(baseDir = 'data')
dirs = dataSearchDirs(baseDir)
# Remove non-existing directories from the list again
dirs.delete_if do |dir|
- !File.exists?(dir.untaint)
+ !File.exist?(dir.untaint)
end
dirs
end
View
2  lib/taskjuggler/SheetHandlerBase.rb
@@ -246,7 +246,7 @@ def htmlMailBody(message)
auxSrcDir = AppConfig.dataDirs('data/css')[0]
cssFileName = (auxSrcDir ? auxSrcDir + '/tjreport.css' : '')
# Raise an error if we haven't found the data directory
- if auxSrcDir.nil? || !File.exists?(cssFileName)
+ if auxSrcDir.nil? || !File.exist?(cssFileName)
dataDirError(cssFileName)
end
cssFile = IO.read(cssFileName)
View
4 lib/taskjuggler/StatusSheetSender.rb
@@ -94,7 +94,7 @@ def defaulterList
missingFile = "#{tsDir}/missing-reports"
# Check if it's got a missing-reports file.
- return [] if !File.exists?(missingFile)
+ return [] if !File.exist?(missingFile)
# The sheet could have been submitted after tj3ts_summary was run. We
# ignore the entry if a time sheet file now exists. There is a race
@@ -106,7 +106,7 @@ def defaulterList
list = File.readlines(missingFile)
list.delete_if do |resource|
tsDate = tsDir[-10..-1]
- File.exists?("#{tsDir}/#{resource.chomp}_#{tsDate}.tji")
+ File.exist?("#{tsDir}/#{resource.chomp}_#{tsDate}.tji")
end
# Return the content of the file.
View
2  lib/taskjuggler/TaskJuggler.rb
@@ -232,7 +232,7 @@ def freeze(freezeDate, taskBookings)
bookingsFileBase = masterFileBase + '-bookings'
bookingsFile = bookingsFileBase + '.tji'
- if !File.exists?(bookingsFile) || !File.exists?(headerFile)
+ if !File.exist?(bookingsFile) || !File.exist?(headerFile)
info('incl_freeze_files',
"Please make sure you include #{headerFile} at " +
"the end of the project header and " +
View
2  lib/taskjuggler/TimeSheetSummary.rb
@@ -78,7 +78,7 @@ def sendSummary(resourceIds)
templateFile = "#{@templateDir}/#{@date}/#{resourceId}_#{@date}.tji"
sheetFile = "#{@sheetDir}/#{@date}/#{resourceId}_#{@date}.tji"
if File.exist?(templateFile)
- if File.exists?(sheetFile)
+ if File.exist?(sheetFile)
# If there are no recipients specified, we don't need to compile
# the summary.
unless @digestRecipients.empty? && @sheetRecipients.empty?
View
2  lib/taskjuggler/apps/Tj3Man.rb
@@ -110,7 +110,7 @@ def startBrowser(keyword = nil)
'manual', 'html')
file = "#{manualDir}/#{keyword || 'index'}.html"
# Make sure the file exists.
- unless File.exists?(file)
+ unless File.exist?(file)
$stderr.puts "Cannot open manual file #{file}"
exit 1
end
View
6 lib/taskjuggler/reports/Report.rb
@@ -187,7 +187,7 @@ def generateHTML
auxSrcDir = AppConfig.dataDirs('data/css')[0]
cssFileName = (auxSrcDir ? auxSrcDir + '/tjreport.css' : '')
# Raise an error if we haven't found the data directory
- if auxSrcDir.nil? || !File.exists?(cssFileName)
+ if auxSrcDir.nil? || !File.exist?(cssFileName)
dataDirError(cssFileName, AppConfig.dataSearchDirs('data/css'))
end
cssFile = IO.read(cssFileName)
@@ -403,7 +403,7 @@ def copyDirectory(dirName)
# Find the data directory that came with the TaskJuggler installation.
auxSrcDir = AppConfig.dataDirs("data/#{dirName}")[0].untaint
# Raise an error if we haven't found the data directory
- if auxSrcDir.nil? || !File.exists?(auxSrcDir)
+ if auxSrcDir.nil? || !File.exist?(auxSrcDir)
dataDirError(dirName, AppConfig.dataSearchDirs("data/#{dirName}"))
end
# Don't copy directory if all files are up-to-date.
@@ -419,7 +419,7 @@ def copyDirectory(dirName)
end
def directoryUpToDate?(auxSrcDir, auxDstDir)
- return false unless File.exists?(auxDstDir.untaint)
+ return false unless File.exist?(auxDstDir.untaint)
Dir.entries(auxSrcDir).each do |file|
next if file == '.' || file == '..'
View
2  lib/taskjuggler/reports/TraceReport.rb
@@ -86,7 +86,7 @@ def generateIntermediateFormat
generatePropertyListHeader(taskList, query)
discontinuedColumns = 0
- if File.exists?(@fileName)
+ if File.exist?(@fileName)
begin
@table = CSVFile.new(nil, nil).read(@fileName)
rescue

0 comments on commit 6202972

Please sign in to comment.
Something went wrong with that request. Please try again.