lib/flydata/compatibility_check.rb in flydata-0.2.27 vs lib/flydata/compatibility_check.rb in flydata-0.2.28

- old
+ new

@@ -79,11 +79,12 @@ #def initialize(de_hash, dump_dir=nil) def initialize(dp_hash, de_hash, options={}) super @db_opts = [:host, :port, :username, :password, :database].inject({}) {|h, sym| h[sym] = de_hash[sym.to_s]; h} - @dump_dir = options['dump_dir'] || nil + @dump_dir = options[:dump_dir] || nil + @backup_dir = options[:backup_dir] || nil end def print_errors return if @errors.empty? log_error_stderr "There may be some compatibility issues with your MySQL credentials: " @@ -185,14 +186,15 @@ def check_writing_permissions write_errors = [] paths_to_check = ["~/.flydata"] paths_to_check << @dump_dir unless @dump_dir.to_s.empty? + paths_to_check << @backup_dir unless @backup_dir.to_s.empty? paths_to_check.each do |path| full_path = File.expand_path(path) full_path = File.dirname(full_path) unless File.directory?(full_path) - write_errors << full_path unless File.writable?(full_path) + write_errors << full_path unless File.writable?(full_path) and File.executable?(full_path) end unless write_errors.empty? error_dir = write_errors.join(", ") raise MysqlCompatibilityError, "We cannot access the directories: #{error_dir}" end @@ -240,8 +242,5 @@ hostname.match(/rds.amazonaws.com$/) != nil end end end - - -