Skip to content

Instantly share code, notes, and snippets.

@danwrong
Created March 11, 2011 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danwrong/866468 to your computer and use it in GitHub Desktop.
Save danwrong/866468 to your computer and use it in GitHub Desktop.
require 'akamai'
module Build
class Akamai
class << self
def configure(username, password)
::Akamai.configure do |c|
c.cachecontrol_username = username
c.cachecontrol_password = password
end
end
end
def initialize(base_path)
@base_path = base_path
end
def purge(files)
urls = files.to_a.map do |file|
"#{@base_path}#{file}"
end
::Akamai.purge(*urls)
urls
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment