Sha256: 41bc58e204bfc6e0f1d6604d46c7cd01bd201d6c01397f956e9b6b5cf3ebf146

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

namespace :shunt_cache do
  desc 'Mark the site as shunted'
  task :shunt => :environment do
    ShuntCache::Status.shunt!
  end

  desc 'Mark the site as unshunted'
  task :unshunt => :environment do
    ShuntCache::Status.unshunt!
  end

  desc 'Check the site status'
  task :status => :environment do
    puts ShuntCache::Status.status
  end

  desc "Wait until we get a 200 or 300 ranged http response code for ENV['URL']"
  task :wait_for_http => :environment do
    url = ENV.fetch('URL')
    options = {
      :host => ENV['HOST']
    }
    success = ShuntCache::Checker.wait_for_http(url, options)
    unless success
      puts "error checking: #{url} - never returned with status within 200..399"
      exit(1)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shunt_cache-0.1.0 lib/shunt_cache/shunt_cache.rake