Sha256: 2eda29e15fb8589be15e08b13efe3b740f3cb8aefca9d4b5480e9751af5909f1
Contents?: true
Size: 878 Bytes
Versions: 3
Compression:
Stored size: 878 Bytes
Contents
module S3Website class Keyboard def self.if_user_confirms_delete(to_delete, 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 _site 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) { |f| yield f } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
s3_website-0.2.1 | lib/s3_website/keyboard.rb |
s3_website-0.2.0 | lib/s3_website/keyboard.rb |
s3_website-0.1.0 | lib/s3_website/keyboard.rb |