Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Support for options email-notification. #4

Merged
merged 2 commits into from about 2 years ago

3 participants

ladams02 Jay Zeschin RHM-billing
ladams02

Updated Configuration to accept cachecontrol_email_notification and updated Connection to append to purge options.

Jay Zeschin jayzes merged commit 5422528 into from March 20, 2012
Jay Zeschin jayzes closed this March 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
3  lib/akamai/configuration.rb
@@ -6,6 +6,7 @@ class Configuration
6 6
                   :cachecontrol_password,
7 7
                   :cachecontrol_domain,
8 8
                   :cachecontrol_purge_action,
  9
+                  :cachecontrol_email_notification,
9 10
                   :netstorage_username, 
10 11
                   :netstorage_password,
11 12
                   :netstorage_ftp_host,
@@ -17,7 +18,7 @@ def initialize(args = {})
17 18
       self.wsdl_url = 'http://ccuapi.akamai.com/ccuapi-axis.wsdl'
18 19
       self.cachecontrol_domain = "production"
19 20
       self.cachecontrol_purge_action = "remove"
20  
-
  21
+      
21 22
       for key, val in args
22 23
         send("#{key}=".to_sym, val)
23 24
       end
4  lib/akamai/connection.rb
@@ -18,7 +18,9 @@ def driver
18 18
     end
19 19
 
20 20
     def purge(*urls)
21  
-      result = driver.purgeRequest(config.cachecontrol_username, config.cachecontrol_password, '', ["domain=#{config.cachecontrol_domain}", "action=#{config.cachecontrol_purge_action}"], urls)
  21
+      opts = ["domain=#{config.cachecontrol_domain}", "action=#{config.cachecontrol_purge_action}"]
  22
+      opts << "email-notification=#{config.cachecontrol_email_notification}" if config.cachecontrol_email_notification
  23
+      result = driver.purgeRequest(config.cachecontrol_username, config.cachecontrol_password, '', opts, urls)
22 24
       raise PurgeError, result.inspect unless result.resultCode == '100'
23 25
       true
24 26
     end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.