Sha256: 224627b6e8ea244f03da3e0bead8bde93bf40c6f428c4f2b5a5daccc7a87a6c1
Contents?: true
Size: 896 Bytes
Versions: 53
Compression:
Stored size: 896 Bytes
Contents
module S3Website class Keyboard def self.if_user_confirms_delete(to_delete, config, standard_input=STDIN) delete_all = false keep_all = false confirmed_deletes = to_delete.map do |f| delete = false keep = false until delete || delete_all || keep || keep_all puts "#{f} is on S3 but not in your website directory anymore. Do you want to [d]elete, [D]elete all, [k]eep, [K]eep all?" case standard_input.gets.chomp when 'd' then delete = true when 'D' then delete_all = true when 'k' then keep = true when 'K' then keep_all = true end end if (delete_all || delete) && !(keep_all || keep) f end end.select { |f| f } Parallelism.each_in_parallel_or_sequentially(confirmed_deletes, config) { |f| yield f } end end end
Version data entries
53 entries across 53 versions & 2 rubygems