campaign_monitor_subscriber 0.6.0
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 +4 -0
- data/Rakefile +13 -0
- data/campaign_monitor_subscriber.gemspec +35 -0
- data/lib/campaign_monitor_subscriber.rb +39 -0
- data.tar.gz.sig +0 -0
- metadata +112 -0
- metadata.gz.sig +1 -0
data/Manifest
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
require 'echoe'
|
5
|
+
|
6
|
+
Echoe.new('campaign_monitor_subscriber', '0.6.0') do |p|
|
7
|
+
p.description = "Sync user emails with Campaign Monitor mailing lists"
|
8
|
+
p.url = "http://github.com/mpowered/campaign_monitor_subscriber"
|
9
|
+
p.author = "Gary Greyling"
|
10
|
+
p.email = "gary@mpowered.co.za"
|
11
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
12
|
+
p.development_dependencies = [['campaigning', '>= 0.15.0']]
|
13
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{campaign_monitor_subscriber}
|
5
|
+
s.version = "0.6.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Gary Greyling"]
|
9
|
+
s.cert_chain = ["/Users/gary/.gem_certs/gem-public_cert.pem"]
|
10
|
+
s.date = %q{2010-09-29}
|
11
|
+
s.description = %q{Sync user emails with Campaign Monitor mailing lists}
|
12
|
+
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"]
|
15
|
+
s.homepage = %q{http://github.com/mpowered/campaign_monitor_subscriber}
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Campaign_monitor_subscriber", "--main", "README.rdoc"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
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}
|
21
|
+
s.summary = %q{Sync user emails with Campaign Monitor mailing lists}
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
+
s.specification_version = 3
|
26
|
+
|
27
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
|
+
s.add_development_dependency(%q<campaigning>, [">= 0.15.0"])
|
29
|
+
else
|
30
|
+
s.add_dependency(%q<campaigning>, [">= 0.15.0"])
|
31
|
+
end
|
32
|
+
else
|
33
|
+
s.add_dependency(%q<campaigning>, [">= 0.15.0"])
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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'
|
10
|
+
|
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
|
21
|
+
|
22
|
+
after_destroy do |record|
|
23
|
+
begin
|
24
|
+
Campaigning::Subscriber.unsubscribe!(record.send(email_field), cm_list_id)
|
25
|
+
rescue RuntimeError
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
def cm_list_id
|
32
|
+
YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))['list_id']
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class ActiveRecord::Base
|
38
|
+
include CampaignMonitorSubscriber
|
39
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: campaign_monitor_subscriber
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Gary Greyling
|
14
|
+
autorequire:
|
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-----
|
38
|
+
|
39
|
+
date: 2010-09-29 00:00:00 +02:00
|
40
|
+
default_executable:
|
41
|
+
dependencies:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: campaigning
|
44
|
+
prerelease: false
|
45
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
hash: 35
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
- 15
|
54
|
+
- 0
|
55
|
+
version: 0.15.0
|
56
|
+
type: :development
|
57
|
+
version_requirements: *id001
|
58
|
+
description: Sync user emails with Campaign Monitor mailing lists
|
59
|
+
email: gary@mpowered.co.za
|
60
|
+
executables: []
|
61
|
+
|
62
|
+
extensions: []
|
63
|
+
|
64
|
+
extra_rdoc_files:
|
65
|
+
- lib/campaign_monitor_subscriber.rb
|
66
|
+
files:
|
67
|
+
- Manifest
|
68
|
+
- Rakefile
|
69
|
+
- campaign_monitor_subscriber.gemspec
|
70
|
+
- lib/campaign_monitor_subscriber.rb
|
71
|
+
has_rdoc: true
|
72
|
+
homepage: http://github.com/mpowered/campaign_monitor_subscriber
|
73
|
+
licenses: []
|
74
|
+
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options:
|
77
|
+
- --line-numbers
|
78
|
+
- --inline-source
|
79
|
+
- --title
|
80
|
+
- Campaign_monitor_subscriber
|
81
|
+
- --main
|
82
|
+
- README.rdoc
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 11
|
100
|
+
segments:
|
101
|
+
- 1
|
102
|
+
- 2
|
103
|
+
version: "1.2"
|
104
|
+
requirements: []
|
105
|
+
|
106
|
+
rubyforge_project: campaign_monitor_subscriber
|
107
|
+
rubygems_version: 1.3.7
|
108
|
+
signing_key:
|
109
|
+
specification_version: 3
|
110
|
+
summary: Sync user emails with Campaign Monitor mailing lists
|
111
|
+
test_files: []
|
112
|
+
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
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�
|