Do you like building cool stuff? Do APIs keep you up at night? We're looking for our next superstar hacker and you could be it. Interested? Check out our job posting on stackoverflow.
gem install maxcdnRequires Ruby 1.9.2+ (see: Travis for passing Ruby versions.)
bundle init
echo "gem 'maxcdn'" >> Gemfile
bundle install --path vendor/bundle
require'maxcdn'api=MaxCDN::Client.new("myalias","consumer_key","consumer_secret")##### Turn on debugging for underlying Curl::Easy and CurbFu modules## api.debug = trueapi.get("/account.json")It has support for GET, POST, PUT and DELETE OAuth 1.0a signed requests.
# To create a new Pull Zoneapi.post("/zones/pull.json",{'name'=>'test_zone','url'=>'http://my-test-site.com'})# To update an existing zoneapi.put("/zones/pull.json/1234",{'name'=>'i_didnt_like_test'})# To delete a zoneapi.delete("/zones/pull.json/1234")# To purge a file (robots.txt) from cacheapi.delete("/zones/pull.json/1234/cache",{"file"=>"/robots.txt"})zone_id=12345# Purge Zoneapi.purge(zone_id)# Purge Fileapi.purge(zone_id,'/some_file')# Purge Filesapi.purge(zone_id,['/some_file','/another_file'])max = MaxCDN::Client.new(alias, key, secret)
max.post("zones/pull/12345/ssl.json", {
:ssl_crt => File.read("/path/to/server.crt").strip,
:ssl_key => File.read("/path/to/server.key").strip })
# get it
git clone git@github.com:<fork repo>/ruby-maxcdn.git
# setupcd ruby-maxcdn
bundle install --path vendor/bundle
# unit tests
bundle exec ruby ./test/test.rb
# integration testsexport ALIAS=<your alias>export KEY=<your key>export SECRET=<your secret>
bundle exec ruby ./test/integration.rb # requires host's IP be whitelisted- Issue #4: Fixing purge files by array to return a hash of status results.
- Fixing bug where purging files purges entire zone.
- Requested changes for debugging and development support. (See issue #2).
- Fixing an issue with lib loading in
0.1.1.
- Fixing POST, DELETE and PUT to send data via request body.
- Adding debugging for CurbFu and Curl::Easy.
- Fixing/enhancing unit tests.
- Removing
secure_connectionhandling, as all connections should be secure. - Fixing 414 Request-URI Too Large from old netdnarws-ruby client.
- Initial Release

