madmimi 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be4672c1319bb8ab018016377765b23bf7dd99a5
4
- data.tar.gz: edcb37c771c1c11a7ebe34342ebd8971d7d26285
3
+ metadata.gz: 4aee62825b032cd78b82b09ab0ac0f1c83848cbf
4
+ data.tar.gz: 1c340035d5e013775f4d181141f174a1c86964b2
5
5
  SHA512:
6
- metadata.gz: e577ff522f35537b25bea05a7d8aa1a4bf9064b8678f510058413cef9fd94a671a4fa179b29b8f216cf5c160ec1400d065de66e5470c5cbc9067480c102f22bb
7
- data.tar.gz: 26eac26ebec69e51f232b1913f4238d3a3f041bdb1559e2aacc9dc27e1768606961933026d0d8bf9e664e7b52c862bd264e55dc14536648efc0e4397e55668ae
6
+ metadata.gz: 75535a7e2ef71ddb00a7b20a83384d81b41e6f57a242dd7a2502cbb0f4298e14dd5a04646ad34e7ff2f0fd0964c089989659e0af347b80920279aace008d2cbb
7
+ data.tar.gz: 70155098cdc2fe413f05545612f05cf9c15e7150bf49339134c71a7c82aba54194bcd192bf8221ee052cd521aa4da00acb412cef67208d0648539d5f970b1302
@@ -62,6 +62,8 @@ You can set +verify_ssl+ to either true or false in initializer, if you wish ver
62
62
 
63
63
  mimi.list_members('Test List') # get audience members in specific list
64
64
 
65
+ mimi.list_members('Test List', 2, 50) # get audience members on the 2nd page in specific list (50 members per page)
66
+
65
67
  mimi.suppressed?('dave@example.com') # check if audience member is suppressed
66
68
 
67
69
  mimi.suppress_email('dave@example.com') # move email to suppressed list
data/Rakefile CHANGED
@@ -26,3 +26,10 @@ Rake::RDocTask.new do |rdoc|
26
26
  rdoc.rdoc_files.include('README*')
27
27
  rdoc.rdoc_files.include('lib/**/*.rb')
28
28
  end
29
+
30
+ begin
31
+ require 'rspec/core/rake_task'
32
+ RSpec::Core::RakeTask.new(:spec)
33
+ task :default => :spec
34
+ rescue LoadError
35
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.2
@@ -1,23 +1,25 @@
1
- :create_list: /audience_lists.json
2
- :remove_from_all_lists: /audience_lists/remove_all
3
- :destroy_list: /audience_lists/%{list}
4
- :add_to_list: /audience_lists/%{list}/add
5
- :remove_from_list: /audience_lists/%{list}/remove
6
- :audience_lists: /audience_lists/lists.xml
7
- :audience_list_members: /audience_lists/%{list}/members.xml
8
- :audience_members: /audience_members
9
- :get_audience_members: /audience_members.xml
10
- :search: /audience_members/search.xml
11
- :memberships: /audience_members/%{email}/lists.xml
12
- :is_suppressed: /audience_members/%{email}/is_suppressed
13
- :update_user_email: /audience_members/%{email}/update_email
14
- :suppressed_since: /audience_members/suppressed_since/%{timestamp}.txt
15
- :suppress_user: /suppressed_audience_members
16
- :unsuppress_user: /suppressed_audience_members/%{email}
17
- :promotions: /promotions.xml
18
- :promotion_save: /promotions/save
19
- :mailing_stats: /promotions/%{promotion_id}/mailings/%{mailing_id}.xml
20
- :mailer: /mailer
21
- :mailer_to_list: /mailer/to_list
22
- :mailer_to_all: /mailer/to_all
23
- :mailer_status: /mailers/status/%{transaction_id}
1
+ :create_list: /audience_lists.json
2
+ :remove_from_all_lists: /audience_lists/remove_all
3
+ :destroy_list: /audience_lists/%{list}
4
+ :add_to_list: /audience_lists/%{list}/add
5
+ :remove_from_list: /audience_lists/%{list}/remove
6
+ :audience_lists: /audience_lists/lists.xml
7
+ :audience_list_members: /audience_lists/%{list}/members.xml
8
+ :audience_members: /audience_members
9
+ :get_audience_members: /audience_members.xml
10
+ :search: /audience_members/search.xml
11
+ :memberships: /audience_members/%{email}/lists.xml
12
+ :is_suppressed: /audience_members/%{email}/is_suppressed
13
+ :update_user_email: /audience_members/%{email}/update_email
14
+ :suppressed_since: /audience_members/suppressed_since/%{timestamp}.txt
15
+ :suppress_user: /suppressed_audience_members
16
+ :unsuppress_user: /suppressed_audience_members/%{email}
17
+ :promotions: /promotions.xml
18
+ :promotion_save: /promotions/save
19
+ :mailing_stats: /promotions/%{promotion_id}/mailings/%{mailing_id}.xml
20
+ :mailer: /mailer
21
+ :mailer_to_list: /mailer/to_list
22
+ :mailer_to_all: /mailer/to_all
23
+ :mailer_status: /mailers/status/%{transaction_id}
24
+ :audience_list_size: /audience_lists/%{list}/list_size
25
+ :audience_list_size_since: /audience_lists/%{list}/list_size_since/%{date}
@@ -146,12 +146,23 @@ class MadMimi
146
146
  end
147
147
  end
148
148
 
149
- def list_members(list_name)
149
+ def list_members(list_name, page = 1, per_page = 30)
150
150
  wrap_with_array('audience', 'member') do
151
- do_request(path(:audience_list_members, :list => list_name), :get)
151
+ do_request(path(:audience_list_members, :list => list_name), :get, {
152
+ :page => page,
153
+ :per_page => per_page
154
+ })
152
155
  end
153
156
  end
154
157
 
158
+ def list_size(list_name)
159
+ do_request(path(:audience_list_size, :list => list_name), :get)
160
+ end
161
+
162
+ def list_size_since(list_name, date)
163
+ do_request(path(:audience_list_size, :list => list_name, :date => date), :get)
164
+ end
165
+
155
166
  def suppressed_since(timestamp, show_suppression_reason = false)
156
167
  do_request(path(:suppressed_since, :timestamp => timestamp), :get, {
157
168
  :show_suppression_reason => show_suppression_reason
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: madmimi 1.1.0 ruby lib
5
+ # stub: madmimi 1.1.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "madmimi"
9
- s.version = "1.1.0"
9
+ s.version = "1.1.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Nicholas Young", "Marc Heiligers", "Maxim Gladkov"]
14
- s.date = "2014-10-15"
14
+ s.date = "2015-07-30"
15
15
  s.description = "Send emails, track statistics, and manage your subscriber base with ease."
16
16
  s.email = "nicholas@madmimi.com"
17
17
  s.extra_rdoc_files = [
@@ -63,6 +63,8 @@ Gem::Specification.new do |s|
63
63
  "spec/cassettes/delete_list/users_exist.yml",
64
64
  "spec/cassettes/list_members/multiple.yml",
65
65
  "spec/cassettes/list_members/single.yml",
66
+ "spec/cassettes/list_size/list_exists.yml",
67
+ "spec/cassettes/list_size_since/list_members.yml",
66
68
  "spec/cassettes/lists/multiple.yml",
67
69
  "spec/cassettes/lists/single.yml",
68
70
  "spec/cassettes/mailing_stats/mailing_does_not_exist.yml",
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.madmimi.com/audience_lists/list%201/list_size
6
+ body:
7
+ encoding: UTF-8
8
+ string: username=test%40example.com&api_key=TEST_API_KEY
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 401
13
+ message: Unauthorized
14
+ headers:
15
+ Date:
16
+ - Thu, 30 Jul 2015 13:12:08 GMT
17
+ Content-Type:
18
+ - text/html; charset=utf-8
19
+ Transfer-Encoding:
20
+ - chunked
21
+ Connection:
22
+ - keep-alive
23
+ Set-Cookie:
24
+ - __cfduid=d4542b816ea9a3523d05ac11b4f7f092b1438261928; expires=Fri, 29-Jul-16
25
+ 13:12:08 GMT; path=/; domain=.madmimi.com; HttpOnly
26
+ - non_eu=true; path=/
27
+ Status:
28
+ - 401 Unauthorized
29
+ X-Ua-Compatible:
30
+ - IE=Edge,chrome=1
31
+ Cache-Control:
32
+ - no-cache
33
+ X-Request-Id:
34
+ - c25c8d7d689170cc4a167481fb15df91
35
+ X-Rack-Cache:
36
+ - miss
37
+ Server:
38
+ - cloudflare-nginx
39
+ Cf-Ray:
40
+ - 20e1503a799515f8-JNB
41
+ body:
42
+ encoding: UTF-8
43
+ string: Unable to authenticate
44
+ http_version:
45
+ recorded_at: Thu, 30 Jul 2015 13:12:08 GMT
46
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.madmimi.com/audience_lists/list%201/list_size
6
+ body:
7
+ encoding: UTF-8
8
+ string: username=test%40example.com&api_key=TEST_API_KEY
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 401
13
+ message: Unauthorized
14
+ headers:
15
+ Date:
16
+ - Thu, 30 Jul 2015 13:12:09 GMT
17
+ Content-Type:
18
+ - text/html; charset=utf-8
19
+ Transfer-Encoding:
20
+ - chunked
21
+ Connection:
22
+ - keep-alive
23
+ Set-Cookie:
24
+ - __cfduid=dd8c1fee3b57b32820faeeb7368c4b1fa1438261928; expires=Fri, 29-Jul-16
25
+ 13:12:08 GMT; path=/; domain=.madmimi.com; HttpOnly
26
+ - non_eu=true; path=/
27
+ Status:
28
+ - 401 Unauthorized
29
+ X-Ua-Compatible:
30
+ - IE=Edge,chrome=1
31
+ Cache-Control:
32
+ - no-cache
33
+ X-Request-Id:
34
+ - 1bbd9624aa78c4c919e3efb688f37486
35
+ X-Rack-Cache:
36
+ - miss
37
+ Server:
38
+ - cloudflare-nginx
39
+ Cf-Ray:
40
+ - 20e1503f798615ec-JNB
41
+ body:
42
+ encoding: UTF-8
43
+ string: Unable to authenticate
44
+ http_version:
45
+ recorded_at: Thu, 30 Jul 2015 13:12:09 GMT
46
+ recorded_with: VCR 2.9.2
@@ -534,6 +534,27 @@ describe MadMimi do
534
534
  end
535
535
  end
536
536
 
537
+ context '#list_size' do
538
+ subject { mad_mimi.list_size('list 1') }
539
+
540
+ context 'when list exists', :vcr => { :cassette_name => 'list_size/list_exists' } do
541
+
542
+ it 'returns an success message' do
543
+ expect(subject).to be_truthy
544
+ end
545
+ end
546
+ end
547
+
548
+ context '#list_size_since' do
549
+ subject { mad_mimi.list_size_since('list 1',1409512823) }
550
+
551
+ context 'when there are members', :vcr => { :cassette_name => 'list_size_since/list_members' } do
552
+ it 'returns a success response' do
553
+ expect(subject).to be_truthy
554
+ end
555
+ end
556
+ end
557
+
537
558
  context '#suppressed_since' do
538
559
  subject { mad_mimi.suppressed_since(1409512823) }
539
560
 
@@ -1,6 +1,3 @@
1
- require 'bundler/setup'
2
- Bundler.setup
3
-
4
1
  require 'madmimi'
5
2
  require 'vcr'
6
3
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madmimi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Young
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-15 00:00:00.000000000 Z
13
+ date: 2015-07-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -162,6 +162,8 @@ files:
162
162
  - spec/cassettes/delete_list/users_exist.yml
163
163
  - spec/cassettes/list_members/multiple.yml
164
164
  - spec/cassettes/list_members/single.yml
165
+ - spec/cassettes/list_size/list_exists.yml
166
+ - spec/cassettes/list_size_since/list_members.yml
165
167
  - spec/cassettes/lists/multiple.yml
166
168
  - spec/cassettes/lists/single.yml
167
169
  - spec/cassettes/mailing_stats/mailing_does_not_exist.yml