constant-contact-ruby 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ == 0.2.3 == 2010/03/04
2
+
3
+ * bugfix for when activities return single or multiple records
@@ -50,10 +50,10 @@ HTTParty gem - http://rubygems.org/gems/httparty
50
50
  Activity.remove_all_contacts_from_lists( 1, 3, 4 ) # remove all contacts from lists 1, 3, and 4
51
51
 
52
52
  new_contacts = [
53
- { :email_address = 'user1@example.com', :first_name => 'User1', :last_name => 'test' },
54
- { :email_address = 'user2@example.com', :first_name => 'User2', :last_name => 'test 2' },
55
- { :email_address = 'user3@example.com', :first_name => 'User1' },
56
- { :email_address = 'user4@example.com' }
53
+ { :email_address => 'user1@example.com', :first_name => 'User1', :last_name => 'test' },
54
+ { :email_address => 'user2@example.com', :first_name => 'User2', :last_name => 'test 2' },
55
+ { :email_address => 'user3@example.com', :first_name => 'User1' },
56
+ { :email_address => 'user4@example.com' }
57
57
  ]
58
58
  Activity.add_contacts_to_lists( new_contacts, 3, 4 ) # all the users array to lists 3 and 4
59
59
  Activity.remove_contacts_from_lists( new_contacts, 4 ) # remove the users from list 4
@@ -2,4 +2,4 @@
2
2
  :major: 0
3
3
  :minor: 2
4
4
  :build:
5
- :patch: 2
5
+ :patch: 3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{constant-contact-ruby}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Craig P Jolicoeur"]
12
- s.date = %q{2010-03-03}
12
+ s.date = %q{2010-03-04}
13
13
  s.description = %q{Ruby wrapper around the Constant Contact REST API}
14
14
  s.email = %q{cpjolicoeur@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.files = [
21
21
  ".document",
22
22
  ".gitignore",
23
+ "CHANGELOG",
23
24
  "LICENSE",
24
25
  "README.rdoc",
25
26
  "Rakefile",
@@ -41,8 +41,10 @@ module ConstantContact
41
41
  data = ConstantContact.get( '/activities', options )
42
42
  return activities if ( data.nil? or data.empty? or data['feed']['entry'].nil? )
43
43
 
44
- data['feed']['entry'].each do |entry|
45
- activities << new( entry )
44
+ if( data['feed']['entry'].is_a?(Array) )
45
+ data['feed']['entry'].each { |entry| activities << new( entry ) }
46
+ else
47
+ activities << new( data['feed']['entry'] )
46
48
  end
47
49
 
48
50
  activities
@@ -92,7 +92,12 @@ module ConstantContact
92
92
  def self.members( id, options={} )
93
93
  members = ConstantContact.get( "/lists/#{id.to_s}/members", options )
94
94
  return nil if ( members.nil? or members.empty? )
95
- members['feed']['entry'].collect { |entry| Contact.new( entry, '', true ) }
95
+
96
+ if( members['feed']['entry'].is_a?(Array) )
97
+ members['feed']['entry'].collect { |entry| Contact.new( entry, '', true ) }
98
+ else
99
+ Contact.new( members['feed']['entry'], '', true )
100
+ end
96
101
  end
97
102
 
98
103
  # Returns the objects API URI
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constant-contact-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig P Jolicoeur
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-03 00:00:00 -05:00
12
+ date: 2010-03-04 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -26,6 +26,7 @@ extra_rdoc_files:
26
26
  files:
27
27
  - .document
28
28
  - .gitignore
29
+ - CHANGELOG
29
30
  - LICENSE
30
31
  - README.rdoc
31
32
  - Rakefile