diff --git a/Casks/adobe-illustrator-cc-de.rb b/Casks/adobe-illustrator-cc-de.rb index 607b2c39a..9ecca0999 100644 --- a/Casks/adobe-illustrator-cc-de.rb +++ b/Casks/adobe-illustrator-cc-de.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-de' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>de_DE<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>de_DE<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-illustrator-cc-es.rb b/Casks/adobe-illustrator-cc-es.rb index b65d22c92..374a021b6 100644 --- a/Casks/adobe-illustrator-cc-es.rb +++ b/Casks/adobe-illustrator-cc-es.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-es' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>es_ES<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>es_ES<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-illustrator-cc-fr.rb b/Casks/adobe-illustrator-cc-fr.rb index db1ebe79b..9aaaea10d 100644 --- a/Casks/adobe-illustrator-cc-fr.rb +++ b/Casks/adobe-illustrator-cc-fr.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-fr' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>fr_FR<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>fr_FR<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-illustrator-cc-it.rb b/Casks/adobe-illustrator-cc-it.rb index 4326d3615..a177b0c48 100644 --- a/Casks/adobe-illustrator-cc-it.rb +++ b/Casks/adobe-illustrator-cc-it.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-it' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>it_IT<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>it_IT<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-illustrator-cc-ja.rb b/Casks/adobe-illustrator-cc-ja.rb index 024eb0831..8c5519af9 100644 --- a/Casks/adobe-illustrator-cc-ja.rb +++ b/Casks/adobe-illustrator-cc-ja.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-ja' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>ja_JP<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>ja_JP<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-illustrator-cc-nl.rb b/Casks/adobe-illustrator-cc-nl.rb index 9d1fc895f..284cc3949 100644 --- a/Casks/adobe-illustrator-cc-nl.rb +++ b/Casks/adobe-illustrator-cc-nl.rb @@ -14,10 +14,7 @@ cask 'adobe-illustrator-cc-nl' do preflight do deployment_xml = "#{staged_path}/Adobe Illustrator CC 2015/Deployment/deployment.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>nl_NL<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>nl_NL<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Illustrator CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-de.rb b/Casks/adobe-indesign-cc-de.rb index 9f1895c49..f276389bd 100644 --- a/Casks/adobe-indesign-cc-de.rb +++ b/Casks/adobe-indesign-cc-de.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-de' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>de_DE<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>de_DE<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-es.rb b/Casks/adobe-indesign-cc-es.rb index 5491b7c99..978bb9d7c 100644 --- a/Casks/adobe-indesign-cc-es.rb +++ b/Casks/adobe-indesign-cc-es.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-es' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>es_ES<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>es_ES<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-fr.rb b/Casks/adobe-indesign-cc-fr.rb index ceef59a6c..5cf3a02d4 100644 --- a/Casks/adobe-indesign-cc-fr.rb +++ b/Casks/adobe-indesign-cc-fr.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-fr' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>fr_FR<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>fr_FR<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-it.rb b/Casks/adobe-indesign-cc-it.rb index 12e11c6dc..7980cb7b7 100644 --- a/Casks/adobe-indesign-cc-it.rb +++ b/Casks/adobe-indesign-cc-it.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-it' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>it_IT<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>it_IT<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-ja.rb b/Casks/adobe-indesign-cc-ja.rb index ec4bd6a21..a055094b1 100644 --- a/Casks/adobe-indesign-cc-ja.rb +++ b/Casks/adobe-indesign-cc-ja.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-ja' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>ja_JP<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>ja_JP<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-indesign-cc-nl.rb b/Casks/adobe-indesign-cc-nl.rb index de49535c2..b530d02ee 100644 --- a/Casks/adobe-indesign-cc-nl.rb +++ b/Casks/adobe-indesign-cc-nl.rb @@ -14,10 +14,7 @@ cask 'adobe-indesign-cc-nl' do preflight do deployment_xml = "#{staged_path}/Adobe InDesign CC 2015/deploy/install.xml" - File.open(deployment_xml) do |xml_before| - contents = xml_before.read.gsub!('>en_US<', '>nl_NL<') - File.open(deployment_xml, 'w+') { |xml_after| xml_after.write(contents) } - end + IO.write(deployment_xml, IO.read(deployment_xml).gsub('>en_US<', '>nl_NL<')) system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe InDesign CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{deployment_xml}" end diff --git a/Casks/adobe-photoshop-cc-de.rb b/Casks/adobe-photoshop-cc-de.rb index e9a634e15..859dca496 100644 --- a/Casks/adobe-photoshop-cc-de.rb +++ b/Casks/adobe-photoshop-cc-de.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-de' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/de_DE_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers' diff --git a/Casks/adobe-photoshop-cc-es.rb b/Casks/adobe-photoshop-cc-es.rb index 12cfc6a02..625580663 100644 --- a/Casks/adobe-photoshop-cc-es.rb +++ b/Casks/adobe-photoshop-cc-es.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-es' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/es_ES_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers' diff --git a/Casks/adobe-photoshop-cc-fr.rb b/Casks/adobe-photoshop-cc-fr.rb index 632661d0f..3d583be7a 100644 --- a/Casks/adobe-photoshop-cc-fr.rb +++ b/Casks/adobe-photoshop-cc-fr.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-fr' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/fr_FR_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers' diff --git a/Casks/adobe-photoshop-cc-it.rb b/Casks/adobe-photoshop-cc-it.rb index 0b343ac8c..25e3d0c74 100644 --- a/Casks/adobe-photoshop-cc-it.rb +++ b/Casks/adobe-photoshop-cc-it.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-it' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/it_IT_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers' diff --git a/Casks/adobe-photoshop-cc-ja.rb b/Casks/adobe-photoshop-cc-ja.rb index 68026c3b4..657d0c704 100644 --- a/Casks/adobe-photoshop-cc-ja.rb +++ b/Casks/adobe-photoshop-cc-ja.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-ja' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/ja_JP_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers' diff --git a/Casks/adobe-photoshop-cc-nl.rb b/Casks/adobe-photoshop-cc-nl.rb index 662435dbc..b6757e553 100644 --- a/Casks/adobe-photoshop-cc-nl.rb +++ b/Casks/adobe-photoshop-cc-nl.rb @@ -12,26 +12,28 @@ cask 'adobe-photoshop-cc-nl' do conflicts_with cask: 'adobe-photoshop-cc' preflight do - file = File.open "#{staged_path}/uninstall.xml", 'w' - file.puts ' - - - 0 - {2614BC86-757D-4293-9E25-E4E16F370A9E} - - - - remove - - -' - file.close - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/Adobe\ Photoshop\ CC\ 2015/Deployment/nl_NL_Deployment.xml" end uninstall_preflight do - system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{staged_path}/uninstall.xml" + uninstall_xml = "#{staged_path}/uninstall.xml" + + IO.write uninstall_xml, <<-EOF.undent + + + + 0 + {2614BC86-757D-4293-9E25-E4E16F370A9E} + + + + remove + + + + EOF + + system '/usr/bin/sudo', '-E', '--', "#{staged_path}/Adobe Photoshop CC 2015/Install.app/Contents/MacOS/Install", '--mode=silent', "--deploymentFile=#{uninstall_xml}" end uninstall rmdir: '/Applications/Utilities/Adobe Installers'