campaign_monitor_subscriber 0.6.0 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Manifest CHANGED
@@ -1,4 +1,4 @@
1
1
  Manifest
2
+ README.rdoc
2
3
  Rakefile
3
- campaign_monitor_subscriber.gemspec
4
4
  lib/campaign_monitor_subscriber.rb
data/README.rdoc ADDED
@@ -0,0 +1,59 @@
1
+ = campaign_monitor_subscriber
2
+
3
+ http://github.com/mpowered/campaign_monitor_subscriber
4
+
5
+ == DESCRIPTION:
6
+
7
+ Automatically push/delete a model's email address to a Campaign Monitor mailing when the model is created or destroyed.
8
+
9
+ == FEATURES:
10
+
11
+ * Push email addresses to CM on create
12
+ * Delete email address from CM on destroy
13
+
14
+ == SYNOPSIS:
15
+
16
+ Specify the model's email address field name:
17
+ Class User < ActiveRecord::Base
18
+ subscribe_me_using :email
19
+ end
20
+
21
+ Set the list id & api key in config/campaign_monitor_subscriber_config.yml:
22
+ list_id: 12oeu0089oe8gf9794oe498587o5
23
+ api_key: 23rbmoe351sd123d12134hbi1234
24
+ development: false # disable in development
25
+
26
+ Thats it!
27
+
28
+ == REQUIREMENTS:
29
+
30
+ * campaigning gem
31
+
32
+ == INSTALL:
33
+
34
+ gem install campaign_monitor_subscriber
35
+
36
+ == LICENSE:
37
+
38
+ (The MIT License)
39
+
40
+ Copyright (c) 2010 FIX
41
+
42
+ Permission is hereby granted, free of charge, to any person obtaining
43
+ a copy of this software and associated documentation files (the
44
+ 'Software'), to deal in the Software without restriction, including
45
+ without limitation the rights to use, copy, modify, merge, publish,
46
+ distribute, sublicense, and/or sell copies of the Software, and to
47
+ permit persons to whom the Software is furnished to do so, subject to
48
+ the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be
51
+ included in all copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
54
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
55
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
56
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
57
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
58
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
59
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.st
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('campaign_monitor_subscriber', '0.6.0') do |p|
6
+ Echoe.new('campaign_monitor_subscriber', '0.6.3') do |p|
7
7
  p.description = "Sync user emails with Campaign Monitor mailing lists"
8
8
  p.url = "http://github.com/mpowered/campaign_monitor_subscriber"
9
9
  p.author = "Gary Greyling"
@@ -2,26 +2,23 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{campaign_monitor_subscriber}
5
- s.version = "0.6.0"
5
+ s.version = "0.6.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Gary Greyling"]
9
- s.cert_chain = ["/Users/gary/.gem_certs/gem-public_cert.pem"]
10
- s.date = %q{2010-09-29}
9
+ s.date = %q{2011-04-05}
11
10
  s.description = %q{Sync user emails with Campaign Monitor mailing lists}
12
11
  s.email = %q{gary@mpowered.co.za}
13
- s.extra_rdoc_files = ["lib/campaign_monitor_subscriber.rb"]
14
- s.files = ["Manifest", "Rakefile", "campaign_monitor_subscriber.gemspec", "lib/campaign_monitor_subscriber.rb"]
12
+ s.extra_rdoc_files = ["README.rdoc", "lib/campaign_monitor_subscriber.rb"]
13
+ s.files = ["Manifest", "README.rdoc", "Rakefile", "lib/campaign_monitor_subscriber.rb", "campaign_monitor_subscriber.gemspec"]
15
14
  s.homepage = %q{http://github.com/mpowered/campaign_monitor_subscriber}
16
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Campaign_monitor_subscriber", "--main", "README.rdoc"]
17
16
  s.require_paths = ["lib"]
18
17
  s.rubyforge_project = %q{campaign_monitor_subscriber}
19
- s.rubygems_version = %q{1.3.7}
20
- s.signing_key = %q{/Users/gary/.gem_certs/gem-private_key.pem}
18
+ s.rubygems_version = %q{1.4.1}
21
19
  s.summary = %q{Sync user emails with Campaign Monitor mailing lists}
22
20
 
23
21
  if s.respond_to? :specification_version then
24
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
22
  s.specification_version = 3
26
23
 
27
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -1,39 +1,31 @@
1
1
  module CampaignMonitorSubscriber
2
- CAMPAIGN_MONITOR_API_KEY = YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))['api_key']
3
-
4
- def self.included(base)
5
- base.extend ClassMethods
6
- end
7
-
8
- module ClassMethods
9
- require 'campaigning'
2
+ require 'campaigning'
3
+ CM_CONFIG = YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))
4
+ ::CAMPAIGN_MONITOR_API_KEY = CM_CONFIG['api_key']
10
5
 
11
- def subcribe_me_using(email_field)
12
- return unless RAILS_ENV == 'production'
13
-
14
- after_create do |record|
15
- begin
16
- s = Campaigning::Subscriber.new(record.send(email_field))
17
- s.add!(cm_list_id)
18
- rescue RuntimeError
19
- end
20
- end
6
+ def subscribe_me_using(email_field)
7
+ return if CM_CONFIG[RAILS_ENV] == false
21
8
 
22
- after_destroy do |record|
23
- begin
24
- Campaigning::Subscriber.unsubscribe!(record.send(email_field), cm_list_id)
25
- rescue RuntimeError
26
- end
9
+ after_create do |record|
10
+ begin
11
+ s = Campaigning::Subscriber.new(record.send(email_field))
12
+ s.add!(cm_list_id)
13
+ rescue RuntimeError
27
14
  end
28
15
  end
29
16
 
30
- private
31
- def cm_list_id
32
- YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))['list_id']
17
+ after_destroy do |record|
18
+ begin
19
+ Campaigning::Subscriber.unsubscribe!(record.send(email_field), cm_list_id)
20
+ rescue RuntimeError
33
21
  end
22
+ end
34
23
  end
24
+
25
+ private
26
+ def cm_list_id
27
+ YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))['list_id']
28
+ end
35
29
  end
36
30
 
37
- class ActiveRecord::Base
38
- include CampaignMonitorSubscriber
39
- end
31
+ ActiveRecord::Base.extend(CampaignMonitorSubscriber)
metadata CHANGED
@@ -1,42 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campaign_monitor_subscriber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease: false
4
+ hash: 1
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gary Greyling
14
14
  autorequire:
15
15
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIDVjCCAj6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBRMQ0wCwYDVQQDDARnYXJ5
20
- MRgwFgYKCZImiZPyLGQBGRYIbXBvd2VyZWQxEjAQBgoJkiaJk/IsZAEZFgJjbzES
21
- MBAGCgmSJomT8ixkARkWAnphMB4XDTEwMDkyOTExMDczM1oXDTExMDkyOTExMDcz
22
- M1owUTENMAsGA1UEAwwEZ2FyeTEYMBYGCgmSJomT8ixkARkWCG1wb3dlcmVkMRIw
23
- EAYKCZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJ6YTCCASIwDQYJKoZI
24
- hvcNAQEBBQADggEPADCCAQoCggEBAKgoGyjXVfeJ10SWFNjlJe0bdPhpZZS+Culh
25
- dr53YjWUuvQ7WzM+wvkwrUAnARVL/pmX2nMn/RwXgen26RR41dk5DA2KRuA+U06n
26
- hxbZkDPpmzUSHXTZfya7a4YlzfqHkIPfzESxzl/r4XrtX7/bfZl4/Yx6sJKZ2Oxj
27
- p/4FG24oRk1sq02KahoogB+tRIbQZyyIctkRkxpuJ87Jr+eQ5M0d/XC1dbSKpHoC
28
- 7wvFeXKN2Calp1iFc/5ivbXb7oVxVLQANMShdlueLh4O2I0/j+/EsRHTZjNHart1
29
- R9slB5rgRp/mieX+QKCBqJ8gNv13I8thWBRcxv1HIAObKOJiUUECAwEAAaM5MDcw
30
- CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFAQ0h81rouVRKvMSoF2p
31
- VQmtFGwIMA0GCSqGSIb3DQEBBQUAA4IBAQBha9zG+tkYxyGq5GQtLzIukmNG5W/q
32
- q4kpQs8J6nK+6LbfP5iH7T65CT4Kb4+zTzleaOKSEp4exTsIvmaiH45makbSLRbn
33
- b8WkSdt2P1fy5uT9MVkieCvFfUP24Fbo0DiqP2coJLQ8BCnFZzN+GhJDVG0APd9X
34
- c9Nk9uAODl8IXJLPYYEJ0YmOj1Y31pO/PBqWWoZv0yesopFW7niMFv9ylwqRBjul
35
- hHuH2lU449ckVEXvs9lseZY8hHEvx5Bz90s7fv+gO+/NhKvEY+MeWuLORpZmPSD9
36
- JSzVUJL2pes8Sw+j0TmyW7A+CfMJJjNaGku4LvnRPgRRb6Gd973i6FUS
37
- -----END CERTIFICATE-----
16
+ cert_chain: []
38
17
 
39
- date: 2010-09-29 00:00:00 +02:00
18
+ date: 2011-04-05 00:00:00 +02:00
40
19
  default_executable:
41
20
  dependencies:
42
21
  - !ruby/object:Gem::Dependency
@@ -62,12 +41,14 @@ executables: []
62
41
  extensions: []
63
42
 
64
43
  extra_rdoc_files:
44
+ - README.rdoc
65
45
  - lib/campaign_monitor_subscriber.rb
66
46
  files:
67
47
  - Manifest
48
+ - README.rdoc
68
49
  - Rakefile
69
- - campaign_monitor_subscriber.gemspec
70
50
  - lib/campaign_monitor_subscriber.rb
51
+ - campaign_monitor_subscriber.gemspec
71
52
  has_rdoc: true
72
53
  homepage: http://github.com/mpowered/campaign_monitor_subscriber
73
54
  licenses: []
@@ -104,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
85
  requirements: []
105
86
 
106
87
  rubyforge_project: campaign_monitor_subscriber
107
- rubygems_version: 1.3.7
88
+ rubygems_version: 1.4.1
108
89
  signing_key:
109
90
  specification_version: 3
110
91
  summary: Sync user emails with Campaign Monitor mailing lists
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- ��z�K�sS�@�Q�/T����)Jd.쒌�e{GD��g�]��\�a�3a��G��T`�%ab������`W�H�J!2\���� �� ��S�a0��X��&yXqD;��s#���N��'R���)�("bqB&FWq928��Ε̌D�����Zf�í�B� ��m�,�/,\��;_^9���4���3������w+Q�z>s�\�Ŭg����D�`S_fы�HͧR���q(��k4$��}��#ܧ_A�