module RakeUtils
  def continue?(prompt = nil)
    prompt = prompt || 'Continue?'
    printf prompt.yellow + ": [no/yes] "
    response = STDIN.gets.chomp
    exit unless response.match?(/^(y|yes)$/i)
    true
  end

  def shell_working message = 'working', &block
    ShellSpinner message do
      yield
    end
  end

  def compress_file(filename)
    shell_working "compressing file #{filename}" do
      system "gzip -3 -f #{filename}"
    end
    "#{filename}.gz"
  end

  def decompress_file(filename)
    shell_working "decompressing file #{filename}" do
      system "gunzip -3 -f #{filename}"
    end
  end

  def production_protected
    raise 'This operation was aborted because the result might destroy production data' if Rails.host.production?
  end
end

module RakeUtils
  def continue?(prompt = nil)
    prompt = prompt || 'Continue?'
    printf prompt.yellow + ": [no/yes] "
    response = STDIN.gets.chomp
    exit unless response.match?(/^(y|yes)$/i)
    true
  end

  def shell_working message = 'working', &block
    ShellSpinner message do
      yield
    end
  end

  def compress_file(filename)
    shell_working "compressing file #{filename}" do
      system "gzip -3 -f #{filename}"
    end
    "#{filename}.gz"
  end

  def decompress_file(filename)
    shell_working "decompressing file #{filename}" do
      system "gunzip #{filename}"
    end
  end

  def production_protected
    raise 'This operation was aborted because the result might destroy production data' if Rails.host.production?
  end
end

Use decompression options available on hosted env
Use decompression options available on hosted env

Was getting this error trying to restore on
a hosted env (alpine image):
```
gunzip: unrecognized option: -3
BusyBox v1.30.1 (2019-10-26 11:23:07 UTC) multi-call binary.

Usage: gunzip [-cfkt] [FILE]...

Decompress FILEs (or stdin)

  -c  Write to stdout
  -f  Force
  -k  Keep input files
  -t  Test file integrity
```
