[rubyripper] push by boukewou...@gmail.com - Fix based on the suggested patch in issue 543. on 2013-01-05 21:44 GMT

2 views
Skip to first unread message

rubyr...@googlecode.com

unread,
Jan 5, 2013, 4:44:33 PM1/5/13
to rubyrippe...@googlegroups.com
Revision: ad93a741c5ef
Author: Bouke Woudstra <boukew...@gmail.com>
Date: Sat Jan 5 13:43:29 2013
Log: Fix based on the suggested patch in issue 543.

http://code.google.com/p/rubyripper/source/detail?r=ad93a741c5ef

Modified:
/lib/rubyripper/log.rb
/lib/rubyripper/system/fileAndDir.rb

=======================================
--- /lib/rubyripper/log.rb Thu Dec 27 12:16:49 2012
+++ /lib/rubyripper/log.rb Sat Jan 5 13:43:29 2013
@@ -52,9 +52,9 @@
def createLog
@logfiles = Array.new
@prefs.codecs.each do |codec|
- path = @fileScheme.getLogFile(codec)
- @file.createDir(path)
- @logfiles << File.open(path, 'a')
+ logfile = @fileScheme.getLogFile(codec)
+ @file.createDirForFile(logfile)
+ @logfiles << File.open(logfile, 'a')
end
end

=======================================
--- /lib/rubyripper/system/fileAndDir.rb Wed Mar 14 13:14:45 2012
+++ /lib/rubyripper/system/fileAndDir.rb Sat Jan 5 13:43:29 2013
@@ -24,11 +24,15 @@

# create dir + parent directories if needed
def createDir(dir)
- dir = File.dirname(dir) unless File.extname(dir).empty?
dir = File.expand_path(dir)
FileUtils.mkdir_p(dir) unless File.directory?(dir)
end

+ # autodetection if it is a file or directory fails when directory
contains a dot
+ def createDirForFile(file)
+ createDir(File.dirname(file))
+ end
+
# remove dir + subdirectories if needed
def removeDir(dir)
dir = File.expand_path(dir)
@@ -88,7 +92,7 @@
if !update && File.file?(filename)
status = 'fileExists'
else
- createDir(File.dirname(filename))
+ createDirForFile(filename)
writeContent(filename, content)
status = 'ok'
end
Reply all
Reply to author
Forward
0 new messages