Sha256: fa4184f5e7986ff35c73046e9c1e823c04361488cc9a31871d277e5ca3793ba3

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

namespace :lacquer do
  namespace :varnishd do
    desc "Start varnishd daemon using Lacquer's settings"
    task :start => :environment do
      Lacquer::Varnishd.new.start
    end

    desc "Stop varnishd daemon using Lacquer's settings"
    task :stop => :environment do
      Lacquer::Varnishd.new.stop
    end

    desc "Running status of varnishd daemon using Lacquer's settings"
    task :status => :environment do
      if Lacquer::Varnishd.new.running?
        puts "Varnishd is running"
      else
        puts "Varnishd is not running"
      end
    end

    desc "Restart varnishd daemon using Lacquer's settings"
    task :restart => :environment do
      varnishd = Lacquer::Varnishd.new
      if varnishd.running?
        varnishd.stop
        sleep(1)
      end
      varnishd.start
    end

    desc "Purge ALL urls from Varnish"
    task :global_purge => :environment do
      Lacquer::Varnish.new.purge('.*')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lacquer-0.5.7 lib/lacquer/tasks.rb
lacquer-0.5.6 lib/lacquer/tasks.rb