Sha256: c0abd4bd7faf9670f3b67679456becec1f38964da4f63551afe21ffaa9534930

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

namespace :six_pm do
  def prompt
    loop do
      puts "It is later than 6p.m. Do you really want to deploy? [y/N]"
      input = $stdin.gets.chomp.downcase
      next unless ["", "y", "n"].include?(input)
      return input == "y"
    end
  end

  task :check do
    if Time.now.hour >= 18
      abort("wise choice. here you go: http://media.giphy.com/media/iyyJLZYjST3So/giphy.gif") unless prompt

      puts "__     ______  _      ____  \n\\ \\   / / __ \\| |    / __ \\ \n \\ \\_/ / |  | | |   | |  | | \n  \\   /| |  | | |   | |  | | \n   | | | |__| | |___| |__| | \n   |_|  \\____/|______\\____/"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-six_pm-0.1.0 lib/capistrano/tasks/six_pm.rake