gnumarcelo-campaigning 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ # Client is defined in default.rb which is automatically generated.
2
+ # In this file we add additional methods to the Client class.
3
+ class Client
4
+ attr_accessor :clientID
5
+ attr_accessor :name
6
+
7
+ def initialize(clientID = nil, name = nil)
8
+ @cm = Campaigning.new
9
+ self.clientID = clientID
10
+ self.name = name
11
+ end
12
+
13
+ # TODO: Refactor this method!
14
+ def lists
15
+ response = @cm.soap.getClientLists(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => self.clientID)
16
+ response.client_GetListsResult
17
+ end
18
+
19
+ end
@@ -1,16 +1,31 @@
1
1
  require 'test_helper'
2
2
 
3
3
  # Replace this API key with your own (http://www.campaignmonitor.com/api/)
4
- CAMPAIGN_MONITOR_API_KEY = '____PUT__YOUR__MONITOR__API__KEY__HERE____'
4
+ CAMPAIGN_MONITOR_API_KEY = '54cae7f3aa1f35cb3bb5bc41756d8b7f'
5
+ CLIENT_ID = 'd7acfd4cd2ffffc2d86b8903d18a1276'
5
6
 
6
- class FirstGemTest < Test::Unit::TestCase
7
+ class CampaigningTest < Test::Unit::TestCase
7
8
 
8
9
  def setup
9
- @cm = Campaigning.new
10
+ @cm = Campaigning.new
10
11
  end
11
-
12
+
12
13
  def test_clients
13
14
  clients = @cm.clients
14
- assert clients.size > 0
15
+ puts clients[0].methods
16
+ assert clients.length > 0
17
+ clients.each{ |c| puts c.clientID + " - " + c.name }
18
+ end
19
+
20
+ def test_client_lists
21
+ client = Client.new(CLIENT_ID)
22
+ assert client.lists.length > 0
15
23
  end
24
+
25
+ def test_system_date
26
+ sys_date = @cm.system_date
27
+ assert !sys_date.nil?
28
+ puts sys_date
29
+ end
30
+
16
31
  end
data/test/test_helper.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
 
4
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
- $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
5
+ require File.expand_path(File.dirname(__FILE__)) + '/../lib/campaigning'
6
+
6
7
  require 'campaigning'
7
8
 
8
9
  class Test::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnumarcelo-campaigning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Menezes
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-10 00:00:00 -07:00
12
+ date: 2009-04-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -37,10 +37,12 @@ files:
37
37
  - Rakefile
38
38
  - VERSION.yml
39
39
  - lib/campaigning.rb
40
- - lib/campaigning/Result.rb
41
40
  - lib/campaigning/apiClient.rb
42
- - lib/campaigning/client.rb
43
- - lib/campaigning/default.rb
41
+ - lib/campaigning/campaigning.rb
42
+ - lib/campaigning/soap/default.rb
43
+ - lib/campaigning/soap/defaultDriver.rb
44
+ - lib/campaigning/soap/defaultMappingRegistry.rb
45
+ - lib/campaigning/types/client.rb
44
46
  - test/campaigning_test.rb
45
47
  - test/test_helper.rb
46
48
  has_rdoc: true
@@ -1,12 +0,0 @@
1
- # {http://api.createsend.com/api/}Result
2
- # code - SOAP::SOAPInt
3
- # message - SOAP::SOAPString
4
- class Result
5
- attr_accessor :code
6
- attr_accessor :message
7
-
8
- def initialize(code = nil, message = nil)
9
- @code = code
10
- @message = message
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- # {http://api.createsend.com/api/}Client
2
- # clientID - SOAP::SOAPString
3
- # name - SOAP::SOAPString
4
- class Client
5
- attr_accessor :clientID
6
- attr_accessor :name
7
-
8
- def initialize(clientID = nil, name = nil)
9
- @clientID = clientID
10
- @name = name
11
- end
12
- end