Sha256: cd920f2f6ad39d05e19f90869765c812a7c8ebde6c454ea557028d789bad37c8

Contents?: true

Size: 576 Bytes

Versions: 9

Compression:

Stored size: 576 Bytes

Contents

module Instapusher2
  class SpecialInstructionForProduction

    def run
      question = "You are deploying to production. Did you take backup? If not then execute rake handy:heroku:backup_production and then come back. "
      STDOUT.puts question
      STDOUT.puts "Answer 'yes' or 'no' "
      
      input = STDIN.gets.chomp.downcase

      if %w(yes y).include?(input)
        #do nothing
      elsif %w(no n).include?(input)
        abort "Please try again when you have taken the backup"
      else
        abort "Please answer yes or no"
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
instapusher2-0.0.8 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.7 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.6 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.5 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.4 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.3 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.2 lib/instapusher2/special_instruction_for_production.rb
instapusher2-0.0.1 lib/instapusher2/special_instruction_for_production.rb
instapusher-0.0.1 lib/instapusher2/special_instruction_for_production.rb