jayzes-akamai_purger 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Jay Zeschin
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,7 @@
1
+ = akamai_purger
2
+
3
+ Description goes here.
4
+
5
+ == Copyright
6
+
7
+ Copyright (c) 2009 Jay Zeschin. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,60 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "akamai_purger"
8
+ gem.executables = 'akamai_purge'
9
+ gem.summary = %Q{TODO}
10
+ gem.email = "jay.zeschin@factorylabs.com"
11
+ gem.homepage = "http://github.com/jayzes/akamai_purger"
12
+ gem.authors = ["Jay Zeschin"]
13
+ # gem.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*"]
14
+ gem.add_dependency 'soap4r'
15
+ gem.add_dependency 'optparse'
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
21
+ end
22
+
23
+ require 'rake/testtask'
24
+ Rake::TestTask.new(:test) do |test|
25
+ test.libs << 'lib' << 'test'
26
+ test.pattern = 'test/**/*_test.rb'
27
+ test.verbose = true
28
+ end
29
+
30
+ begin
31
+ require 'rcov/rcovtask'
32
+ Rcov::RcovTask.new do |test|
33
+ test.libs << 'test'
34
+ test.pattern = 'test/**/*_test.rb'
35
+ test.verbose = true
36
+ end
37
+ rescue LoadError
38
+ task :rcov do
39
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
40
+ end
41
+ end
42
+
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ if File.exist?('VERSION.yml')
49
+ config = YAML.load(File.read('VERSION.yml'))
50
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
51
+ else
52
+ version = ""
53
+ end
54
+
55
+ rdoc.rdoc_dir = 'rdoc'
56
+ rdoc.title = "akamai_purger #{version}"
57
+ rdoc.rdoc_files.include('README*')
58
+ rdoc.rdoc_files.include('lib/**/*.rb')
59
+ end
60
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/bin/akamai_purge ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "#{File.dirname(__FILE__)}/../lib/akamai_purger.rb"
4
+
5
+ AkamaiPurger.new.run
@@ -0,0 +1,46 @@
1
+ require 'rubygems'
2
+ require 'optparse'
3
+ require 'soap/wsdlDriver'
4
+
5
+ class AkamaiPurger
6
+
7
+ WSDL_URL = "https://ccuapi.akamai.com/ccuapi-axis.wsdl"
8
+
9
+ def initialize(args)
10
+ opts = OptionParser.new do |opts|
11
+ opts.banner = "Usage: #{File.basename($0)} [options]"
12
+
13
+ opts.on('-h', '--help', 'Show this message') do
14
+ puts opts
15
+ exit 1
16
+ end
17
+
18
+ opts.on('-u', '--user=USER', 'Specifies the Akamai username to connect as.') do |user|
19
+ @username = user
20
+ end
21
+
22
+ opts.on('-p', '--password=password', "Specifies the password for the Akamai user.") do |pass|
23
+ @password = pass
24
+ end
25
+
26
+ opts.on('-l', '--url=url', "Specifies the URL to purge.") do |pass|
27
+ @url = url
28
+ end
29
+
30
+
31
+ end
32
+
33
+ @args = opts.parse!(args)
34
+ end
35
+
36
+ def run
37
+ parse_opts
38
+
39
+ puts "Sending purge request for #{@url}."
40
+ driver = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
41
+ driver.options["protocol.http.basic_auth"] << [WSDL_URL, @username, @password]
42
+ result = driver.purgeRequest(@username, @password, '', [], @url)
43
+
44
+ puts "Purge request #{ result.resultCode == '100' ? 'was successful' : 'failed' }."
45
+ end
46
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AkamaiPurgerTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'akamai_purger'
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jayzes-akamai_purger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jay Zeschin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-29 00:00:00 -07:00
13
+ default_executable: akamai_purge
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: soap4r
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: optparse
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description:
36
+ email: jay.zeschin@factorylabs.com
37
+ executables:
38
+ - akamai_purge
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.rdoc
44
+ files:
45
+ - .document
46
+ - .gitignore
47
+ - LICENSE
48
+ - README.rdoc
49
+ - Rakefile
50
+ - VERSION
51
+ - bin/akamai_purge
52
+ - lib/akamai_purger.rb
53
+ - test/akamai_purger_test.rb
54
+ - test/test_helper.rb
55
+ has_rdoc: false
56
+ homepage: http://github.com/jayzes/akamai_purger
57
+ post_install_message:
58
+ rdoc_options:
59
+ - --charset=UTF-8
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.2.0
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: TODO
81
+ test_files:
82
+ - test/akamai_purger_test.rb
83
+ - test/test_helper.rb