lib/prodder/pg.rb in prodder-1.7.1 vs lib/prodder/pg.rb in prodder-1.7.2

- old
+ new

@@ -60,12 +60,13 @@ run ['psql', *arguments.push(db_name)] do |out, err, success| raise PGDumpError.new(err) if !success File.open(filename, 'w') do |f| out.each_line do |setting| - unless setting.gsub(/\s+/, '').empty? + setting.gsub!(/\s+/, '') + unless setting.empty? setting.chomp! - setting += "''" if setting.match /.*=$/ + setting += "''" if setting.match(/=$/) # using the magic of psql variables through :DBNAME f.puts "ALTER DATABASE :DBNAME SET #{setting};" end end end