bin/calabash-ios-setup.rb in calabash-cucumber-0.9.27 vs bin/calabash-ios-setup.rb in calabash-cucumber-0.9.28

- old
+ new

@@ -1,6 +1,8 @@ require "calabash-cucumber/version" +require 'rexml/rexml' +require "rexml/document" def dup_scheme(project_name, pbx_dir, target) userdata_dirs = Dir.foreach("#{pbx_dir}/xcuserdata").find_all { |x| @@ -32,11 +34,11 @@ puts "-"*10 + "-------" + "-"*10 else if not cal_scheme.nil? msg("Warning") do puts "Scheme: #{target_name}-cal.xcscheme already exists." - puts "Will not try to duplicate #{project_name}.xcscheme." + puts "Will not try to duplicate #{target_name}.xcscheme." end else msg("Action") do puts "Duplicating scheme #{target_name}.xcscheme as #{target_name}-cal.xcscheme" @@ -52,10 +54,12 @@ la.attributes["buildConfiguration"] = "Calabash" end doc.elements.each("Scheme/ProfileAction") do |la| la.attributes["buildConfiguration"] = "Calabash" end - doc.write(File.open("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes/#{target_name}-cal.xcscheme", "w")) + f=File.open("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes/#{target_name}-cal.xcscheme", "w") + doc.write f + f.close end end end end \ No newline at end of file