forked from mike-hu/openx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
40 lines (36 loc) · 1.38 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- ruby -*-
require 'rubygems'
require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "jjp-openx"
gemspec.summary = "A Ruby interface to the OpenX XML-RPC API with more OpenX APIs used"
gemspec.description = "A Ruby interface to the OpenX XML-RPC API. Used touchlocal 1.1.2 version as base for adding more API calls to OpenX API from http://developer.openx.org/api/ . It also works with v2 of OpenX API, especially that it now can pass localTZ to the OpenX API which will give back the correct statistics for the local time zone."
gemspec.email = "jacobjp@mac.com"
gemspec.homepage = "http://github.com/DoppioJP/openx"
gemspec.authors = ["Aaron Patterson", "Andy Smith", "TouchLocal Plc", "DoppioJP"]
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
$: << "lib/"
require 'openx'
namespace :openx do
task :clean do
include OpenX::Services
ENV['OPENX_ENV'] = 'test'
Agency.find(:all) do |agency|
Advertiser.find(:all, agency.id).each do |advertiser|
Campaign.find(:all, advertiser.id).each do |campaign|
Banner.find(:all, campaign.id).each do |banner|
banner.destroy
end
campaign.destroy
end
advertiser.destroy
end
end
end
end