hominid 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/hominid.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hominid}
8
- s.version = "2.1.0"
8
+ s.version = "2.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Getting", "Michael Str\303\274der"]
12
- s.date = %q{2010-03-06}
12
+ s.date = %q{2010-04-21}
13
13
  s.description = %q{Hominid is a Ruby gem that provides a wrapper for interacting with the Mailchimp email marketing service API.}
14
14
  s.email = %q{brian@terra-firma-design.com}
15
15
  s.extra_rdoc_files = [
@@ -132,12 +132,13 @@ module Hominid
132
132
  # List all the folders for a user account.
133
133
  #
134
134
  # Returns:
135
- # An array of templates for this campaign including:
135
+ # An array of folders (or [] if none exist) for this account including:
136
136
  # * folder_id (Integer) = Folder Id for the given folder, this can be used in the campaigns() function to filter on.
137
137
  # * name (String) = Name of the given folder.
138
138
  #
139
139
  def folders
140
- call("campaignFolders")
140
+ folders = call("campaignFolders")
141
+ folders == "" ? [] : folders
141
142
  end
142
143
 
143
144
  # Retrieve all templates defined for your user account.
@@ -572,14 +573,14 @@ module Hominid
572
573
  # Send a test of this campaign to the provided email address(es).
573
574
  #
574
575
  # Parameters:
575
- # * campaign_id (String) = The ID of the campaign.
576
- # * emails (Hash) = A hash of email addresses to receive the test message.
577
- # * send_type (String) = One of 'html', 'text' or nil (send both). Defaults to nil.
576
+ # * campaign_id (String) = The ID of the campaign.
577
+ # * emails (Array) = An array of email addresses to receive the test message.
578
+ # * send_type (String) = One of 'html', 'text' or '' (send both). Defaults to ''.
578
579
  #
579
580
  # Returns:
580
581
  # True if successful.
581
582
  #
582
- def send_test(campaign_id, emails = {}, send_type = nil)
583
+ def send_test(campaign_id, emails = {}, send_type = '')
583
584
  call("campaignSendTest", campaign_id, emails, send_type)
584
585
  end
585
586
 
data/lib/hominid/list.rb CHANGED
@@ -11,9 +11,10 @@ module Hominid
11
11
  call("lists").find {|list| list["name"] == list_name}
12
12
  end
13
13
 
14
- # Find a mailing list ID by name
14
+ # Find a mailing list ID by name, returns nil if no list found
15
15
  def find_list_id_by_name(list_name)
16
- call("lists").find {|list| list["name"] == list_name}["id"]
16
+ list = find_list_by_name(list_name)
17
+ list && list["id"]
17
18
  end
18
19
 
19
20
  # Find a mailing list by ID
@@ -26,9 +27,10 @@ module Hominid
26
27
  call("lists").find {|list| list["web_id"] == list_web_id}
27
28
  end
28
29
 
29
- # Find a mailing list ID by web_id
30
+ # Find a mailing list ID by web_id, returns nil if no list found
30
31
  def find_list_id_by_web_id(list_web_id)
31
- call("lists").find {|list| list["web_id"] == list_web_id}["id"]
32
+ list = find_list_by_web_id(list_web_id)
33
+ list && list["id"]
32
34
  end
33
35
 
34
36
  # Find all the mailing lists IDs that an email address is subscribed to
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hominid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Getting
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-03-06 00:00:00 -08:00
13
+ date: 2010-04-21 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16