Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9256: windows_binary_mode_bug.patch

File windows_binary_mode_bug.patch, 1.3 kB (added by fukas78, 1 year ago)
  • lib/capistrano/recipes/deploy.rb

    old new  
    224224    abort "Please specify at least one file to update (via the FILES environment variable)" if files.empty? 
    225225 
    226226    files.each do |file| 
    227       put File.read(file), File.join(current_path, file) 
     227      content = File.open(file, "rb") { |f| f.read } 
     228      put content, File.join(current_path, file) 
    228229    end 
    229230  end 
    230231 
  • lib/capistrano/recipes/deploy/strategy/copy.rb

    old new  
    3232          logger.trace "compressing #{destination} to #{filename}" 
    3333          Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) } 
    3434 
    35           put File.read(filename), remote_filename 
     35          content = File.open(filename, "rb") { |f| f.read } 
     36          put content, remote_filename  
    3637          run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}" 
    3738        ensure 
    3839          FileUtils.rm filename rescue nil