Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support for options email-notification. #4

Merged
merged 2 commits into from Mar 20, 2012
Jump to file or symbol
Failed to load files and symbols.
+5 −2
Split
@@ -6,6 +6,7 @@ class Configuration
:cachecontrol_password,
:cachecontrol_domain,
:cachecontrol_purge_action,
+ :cachecontrol_email_notification,
:netstorage_username,
:netstorage_password,
:netstorage_ftp_host,
@@ -17,7 +18,7 @@ def initialize(args = {})
self.wsdl_url = 'http://ccuapi.akamai.com/ccuapi-axis.wsdl'
self.cachecontrol_domain = "production"
self.cachecontrol_purge_action = "remove"
-
+
for key, val in args
send("#{key}=".to_sym, val)
end
View
@@ -18,7 +18,9 @@ def driver
end
def purge(*urls)
- result = driver.purgeRequest(config.cachecontrol_username, config.cachecontrol_password, '', ["domain=#{config.cachecontrol_domain}", "action=#{config.cachecontrol_purge_action}"], urls)
+ opts = ["domain=#{config.cachecontrol_domain}", "action=#{config.cachecontrol_purge_action}"]
+ opts << "email-notification=#{config.cachecontrol_email_notification}" if config.cachecontrol_email_notification
+ result = driver.purgeRequest(config.cachecontrol_username, config.cachecontrol_password, '', opts, urls)
raise PurgeError, result.inspect unless result.resultCode == '100'
true
end