bin/calabash-ios-setup.rb in calabash-cucumber-0.9.141 vs bin/calabash-ios-setup.rb in calabash-cucumber-0.9.144
- old
+ new
@@ -295,42 +295,49 @@
def update(args)
if args.length > 0
target = args[0]
unless UPDATE_TARGETS.include?(target)
- msg("Error") do
+ msg('Error') do
puts "Invalid target #{target}. Must be one of: #{UPDATE_TARGETS.join(' ')}"
end
exit 1
end
- target_file = "features/support/launch.rb"
- msg("Question") do
+ target_file = 'features/support/launch.rb'
+ msg('Question') do
puts "I'm about to update the #{target_file} file."
puts "Please hit return to confirm that's what you want."
end
exit 2 unless STDIN.gets.chomp == ''
unless File.exist?(target_file)
- msg("Error") do
+ msg('Error') do
puts "Unable to find file #{target_file}"
puts "Please change directory so that #{target_file} exists."
end
exit 1
end
- new_launch_script = File.join(@script_dir,"launch.rb")
+ new_launch_script = File.join(@script_dir, 'launch.rb')
- FileUtils.cp(new_launch_script, target_file, :verbose => true)
+ FileUtils.cp(new_launch_script, 'features/support/01_launch.rb', :verbose => true)
+ FileUtils.rm(target_file, :force => true, :verbose => true)
- msg("Info") do
+ hooks_file = 'features/support/hooks.rb'
+ if File.exist?(hooks_file)
+ FileUtils.mv(hooks_file, 'features/support/02_pre_stop_hooks.rb', :verbose => true)
+ end
+
+ msg('Info') do
puts "File copied.\n"
- puts "Launch on device using environment variable DEVICE_TARGET=device."
+ puts 'Launch on device using environment variable DEVICE_TARGET=device.'
+ puts 'Launch on simulator by default or using environment variable DEVICE_TARGET=simulator.'
end
else
- msg("Error") do
+ msg('Error') do
puts "update must take one of the following targets: #{UPDATE_TARGETS.join(' ')}"
end
exit 1
end
\ No newline at end of file