mailee 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +8 -8
- data/VERSION +1 -1
- data/lib/mailee/active_record.rb +2 -2
- data/lib/mailee/active_resource.rb +2 -2
- data/lib/mailee/railties.rb +2 -1
- data/mailee.gemspec +11 -12
- data/spec/mailee-api-ar_spec.rb +2 -2
- data/spec/mailee-api_spec.rb +14 -2
- data/spec/spec_helper.rb +1 -1
- metadata +71 -119
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -52,14 +52,14 @@ GEM
|
|
52
52
|
rack-test (0.5.7)
|
53
53
|
rack (>= 1.0)
|
54
54
|
rake (0.9.2)
|
55
|
-
rspec (2.
|
56
|
-
rspec-core (~> 2.
|
57
|
-
rspec-expectations (~> 2.
|
58
|
-
rspec-mocks (~> 2.
|
59
|
-
rspec-core (2.
|
60
|
-
rspec-expectations (2.
|
55
|
+
rspec (2.8.0)
|
56
|
+
rspec-core (~> 2.8.0)
|
57
|
+
rspec-expectations (~> 2.8.0)
|
58
|
+
rspec-mocks (~> 2.8.0)
|
59
|
+
rspec-core (2.8.0)
|
60
|
+
rspec-expectations (2.8.0)
|
61
61
|
diff-lcs (~> 1.1.2)
|
62
|
-
rspec-mocks (2.
|
62
|
+
rspec-mocks (2.8.0)
|
63
63
|
sqlite3 (1.3.4)
|
64
64
|
treetop (1.4.10)
|
65
65
|
polyglot
|
@@ -75,5 +75,5 @@ DEPENDENCIES
|
|
75
75
|
activeresource (~> 3.0)
|
76
76
|
bundler (~> 1.0.0)
|
77
77
|
jeweler (~> 1.6.4)
|
78
|
-
rspec (~> 2.
|
78
|
+
rspec (~> 2.8.0)
|
79
79
|
sqlite3 (~> 1.3.4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/lib/mailee/active_record.rb
CHANGED
@@ -67,7 +67,7 @@ module Mailee
|
|
67
67
|
contact.email = send(sync_options[:email])
|
68
68
|
contact.name = send(sync_options[:name]) if sync_options[:name]
|
69
69
|
contact.save
|
70
|
-
contact.put(:
|
70
|
+
contact.put(:list_subscribe, :list => sync_options[:list]) if sync_options[:list]
|
71
71
|
end
|
72
72
|
rescue
|
73
73
|
logger.warn "MAILEE-API: Falhou ao criar o contato #{id} no Mailee"
|
@@ -84,7 +84,7 @@ module Mailee
|
|
84
84
|
contact.email = send(sync_options[:email])
|
85
85
|
contact.name = send(sync_options[:name]) if sync_options[:name]
|
86
86
|
contact.save
|
87
|
-
contact.put(:
|
87
|
+
contact.put(:list_subscribe, :list => sync_options[:list]) if sync_options[:list]
|
88
88
|
end
|
89
89
|
else
|
90
90
|
create_in_mailee # Se não achou o contato tem q inserir.
|
@@ -32,10 +32,10 @@ module Mailee
|
|
32
32
|
find(:first, :params => {:internal_id => iid})
|
33
33
|
end
|
34
34
|
def self.find_by_email email
|
35
|
-
find(:first, :params => {:email => email})
|
35
|
+
find(:first, :params => {:email => email, :status => 'all'})
|
36
36
|
end
|
37
37
|
def self.search keyword, page=1
|
38
|
-
find(:all, :params => {:page => page, :by_keyword => keyword })
|
38
|
+
find(:all, :params => {:page => page, :by_keyword => keyword, :status => 'all' })
|
39
39
|
end
|
40
40
|
def unsubscribe(data={})
|
41
41
|
#E.g. data --> {:reason => 'Trip to nowhere', :spam => false}
|
data/lib/mailee/railties.rb
CHANGED
@@ -25,6 +25,7 @@ class MaileeRails < Rails::Railtie
|
|
25
25
|
exit
|
26
26
|
end
|
27
27
|
end
|
28
|
+
url.gsub!('http://','https://')
|
28
29
|
initializer("mailee.rb") do
|
29
30
|
"Mailee::Config.site = '#{url}'"
|
30
31
|
end
|
@@ -33,4 +34,4 @@ class MaileeRails < Rails::Railtie
|
|
33
34
|
puts "*** Thanks for using Mailee.me"
|
34
35
|
end
|
35
36
|
end
|
36
|
-
end
|
37
|
+
end
|
data/mailee.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.6.
|
7
|
+
s.name = "mailee"
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Juan Maiz"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-01-13"
|
13
|
+
s.description = "Permite sincronizar automaticamente seus modelos com o Mailee.me, inclusive com gerenciamento de optin."
|
14
|
+
s.email = "suporte@mailee.me"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.markdown"
|
@@ -97,20 +97,19 @@ Gem::Specification.new do |s|
|
|
97
97
|
"spec/spec_helper.rb",
|
98
98
|
"tasks/mailee_tasks.rake"
|
99
99
|
]
|
100
|
-
s.homepage =
|
100
|
+
s.homepage = "http://help.mailee.me/integration_rails.html"
|
101
101
|
s.require_paths = ["lib"]
|
102
|
-
s.rubygems_version =
|
103
|
-
s.summary =
|
102
|
+
s.rubygems_version = "1.8.10"
|
103
|
+
s.summary = "Gem para uso da API do Mailee.me"
|
104
104
|
|
105
105
|
if s.respond_to? :specification_version then
|
106
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
107
106
|
s.specification_version = 3
|
108
107
|
|
109
108
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
110
109
|
s.add_runtime_dependency(%q<actionmailer>, ["~> 3.0"])
|
111
110
|
s.add_runtime_dependency(%q<activeresource>, ["~> 3.0"])
|
112
111
|
s.add_runtime_dependency(%q<activerecord>, ["~> 3.0"])
|
113
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.
|
112
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
114
113
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
115
114
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
116
115
|
s.add_development_dependency(%q<sqlite3>, ["~> 1.3.4"])
|
@@ -118,7 +117,7 @@ Gem::Specification.new do |s|
|
|
118
117
|
s.add_dependency(%q<actionmailer>, ["~> 3.0"])
|
119
118
|
s.add_dependency(%q<activeresource>, ["~> 3.0"])
|
120
119
|
s.add_dependency(%q<activerecord>, ["~> 3.0"])
|
121
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
120
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
122
121
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
123
122
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
124
123
|
s.add_dependency(%q<sqlite3>, ["~> 1.3.4"])
|
@@ -127,7 +126,7 @@ Gem::Specification.new do |s|
|
|
127
126
|
s.add_dependency(%q<actionmailer>, ["~> 3.0"])
|
128
127
|
s.add_dependency(%q<activeresource>, ["~> 3.0"])
|
129
128
|
s.add_dependency(%q<activerecord>, ["~> 3.0"])
|
130
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
129
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
131
130
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
132
131
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
133
132
|
s.add_dependency(%q<sqlite3>, ["~> 1.3.4"])
|
data/spec/mailee-api-ar_spec.rb
CHANGED
@@ -35,7 +35,7 @@ describe "Mailee" do
|
|
35
35
|
foo.update_attribute :news, true
|
36
36
|
found = Mailee::Contact.find_by_email("rest_test_foo_#{@moment}@test.com")
|
37
37
|
found.internal_id.to_i.should be foo.id
|
38
|
-
|
38
|
+
#==
|
39
39
|
bar = Bar.create :other_name => "rest_test_bar_#{@moment}", :other_email => "rest_test_bar_#{@moment}@test.com", :other_news => false
|
40
40
|
bar.update_attribute :other_news, true
|
41
41
|
found = Mailee::Contact.find_by_email("rest_test_bar_#{@moment}@test.com")
|
@@ -47,4 +47,4 @@ describe "Mailee" do
|
|
47
47
|
# TODO I really cannot know if the email was subscribed successfully :S
|
48
48
|
end
|
49
49
|
|
50
|
-
end
|
50
|
+
end
|
data/spec/mailee-api_spec.rb
CHANGED
@@ -36,7 +36,7 @@ describe "Mailee" do
|
|
36
36
|
Array.new(25){|i| Mailee::Contact.create :email => "rest_test_#{@moment}_#{i}@test.com"}
|
37
37
|
contacts = Mailee::Contact.find(:all)
|
38
38
|
contacts.size.should == 15
|
39
|
-
contacts = Mailee::Contact.find(:all, :params => {:page => 2, :by_keyword => "rest_test_#{@moment}" })
|
39
|
+
contacts = Mailee::Contact.find(:all, :params => {:page => 2, :status => 'all', :by_keyword => "rest_test_#{@moment}" })
|
40
40
|
contacts.size.should == 10
|
41
41
|
end
|
42
42
|
|
@@ -125,12 +125,24 @@ describe "Mailee" do
|
|
125
125
|
found.id.should be(contact.id)
|
126
126
|
end
|
127
127
|
|
128
|
+
#it "should create an invalid contact and find by internal id" do
|
129
|
+
#contact = Mailee::Contact.create :email => "rest_test_#{@moment}@test.com", :internal_id => @moment, :contact_status_id => -1
|
130
|
+
#found = Mailee::Contact.find_by_internal_id(@moment)
|
131
|
+
#found.id.should be(contact.id)
|
132
|
+
#end
|
133
|
+
|
128
134
|
it "should create and find by email" do
|
129
135
|
contact = Mailee::Contact.create :email => "rest_test_#{@moment}@test.com"
|
130
136
|
found = Mailee::Contact.find_by_email("rest_test_#{@moment}@test.com")
|
131
137
|
found.id.should be(contact.id)
|
132
138
|
end
|
133
139
|
|
140
|
+
it "should create an invalid contact and find by email" do
|
141
|
+
contact = Mailee::Contact.create :email => "rest_test_#{@moment}@test.com", :contact_status_id => -1
|
142
|
+
found = Mailee::Contact.find_by_email("rest_test_#{@moment}@test.com")
|
143
|
+
found.id.should be(contact.id)
|
144
|
+
end
|
145
|
+
|
134
146
|
it "should create, test and send message - specific methods" do
|
135
147
|
list = Mailee::List.create :name => "rest_test_#{@moment}"
|
136
148
|
contact = Mailee::Contact.create :email => "rest_test_#{@moment}@test.com"
|
@@ -153,4 +165,4 @@ describe "Mailee" do
|
|
153
165
|
Mailee::Quick.import("rest_test_#{@moment}@test.com\nrest_test_2_#{@moment}@test.com\nrest_test_3_#{@moment}@test.com").should_not be nil
|
154
166
|
end
|
155
167
|
|
156
|
-
end
|
168
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,142 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailee
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 0.6.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.2
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Juan Maiz
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-01-13 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: actionmailer
|
16
|
+
requirement: &2154127700 !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
18
|
+
requirements:
|
25
19
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 0
|
31
|
-
version: "3.0"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
32
22
|
type: :runtime
|
33
|
-
name: actionmailer
|
34
23
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
|
24
|
+
version_requirements: *2154127700
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activeresource
|
27
|
+
requirement: &2154127200 !ruby/object:Gem::Requirement
|
38
28
|
none: false
|
39
|
-
requirements:
|
29
|
+
requirements:
|
40
30
|
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 3
|
45
|
-
- 0
|
46
|
-
version: "3.0"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
47
33
|
type: :runtime
|
48
|
-
name: activeresource
|
49
34
|
prerelease: false
|
50
|
-
version_requirements: *
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
|
35
|
+
version_requirements: *2154127200
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activerecord
|
38
|
+
requirement: &2154126620 !ruby/object:Gem::Requirement
|
53
39
|
none: false
|
54
|
-
requirements:
|
40
|
+
requirements:
|
55
41
|
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 3
|
60
|
-
- 0
|
61
|
-
version: "3.0"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
62
44
|
type: :runtime
|
63
|
-
name: activerecord
|
64
45
|
prerelease: false
|
65
|
-
version_requirements: *
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
|
46
|
+
version_requirements: *2154126620
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &2154126060 !ruby/object:Gem::Requirement
|
68
50
|
none: false
|
69
|
-
requirements:
|
51
|
+
requirements:
|
70
52
|
- - ~>
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
segments:
|
74
|
-
- 2
|
75
|
-
- 6
|
76
|
-
- 0
|
77
|
-
version: 2.6.0
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.8.0
|
78
55
|
type: :development
|
79
|
-
name: rspec
|
80
56
|
prerelease: false
|
81
|
-
version_requirements: *
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
|
57
|
+
version_requirements: *2154126060
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: bundler
|
60
|
+
requirement: &2154125540 !ruby/object:Gem::Requirement
|
84
61
|
none: false
|
85
|
-
requirements:
|
62
|
+
requirements:
|
86
63
|
- - ~>
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
hash: 23
|
89
|
-
segments:
|
90
|
-
- 1
|
91
|
-
- 0
|
92
|
-
- 0
|
64
|
+
- !ruby/object:Gem::Version
|
93
65
|
version: 1.0.0
|
94
66
|
type: :development
|
95
|
-
name: bundler
|
96
67
|
prerelease: false
|
97
|
-
version_requirements: *
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
|
68
|
+
version_requirements: *2154125540
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: &2154125020 !ruby/object:Gem::Requirement
|
100
72
|
none: false
|
101
|
-
requirements:
|
73
|
+
requirements:
|
102
74
|
- - ~>
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
hash: 7
|
105
|
-
segments:
|
106
|
-
- 1
|
107
|
-
- 6
|
108
|
-
- 4
|
75
|
+
- !ruby/object:Gem::Version
|
109
76
|
version: 1.6.4
|
110
77
|
type: :development
|
111
|
-
name: jeweler
|
112
78
|
prerelease: false
|
113
|
-
version_requirements: *
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
|
79
|
+
version_requirements: *2154125020
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: sqlite3
|
82
|
+
requirement: &2154124480 !ruby/object:Gem::Requirement
|
116
83
|
none: false
|
117
|
-
requirements:
|
84
|
+
requirements:
|
118
85
|
- - ~>
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
hash: 19
|
121
|
-
segments:
|
122
|
-
- 1
|
123
|
-
- 3
|
124
|
-
- 4
|
86
|
+
- !ruby/object:Gem::Version
|
125
87
|
version: 1.3.4
|
126
88
|
type: :development
|
127
|
-
name: sqlite3
|
128
89
|
prerelease: false
|
129
|
-
version_requirements: *
|
130
|
-
description: Permite sincronizar automaticamente seus modelos com o Mailee.me, inclusive
|
90
|
+
version_requirements: *2154124480
|
91
|
+
description: Permite sincronizar automaticamente seus modelos com o Mailee.me, inclusive
|
92
|
+
com gerenciamento de optin.
|
131
93
|
email: suporte@mailee.me
|
132
94
|
executables: []
|
133
|
-
|
134
95
|
extensions: []
|
135
|
-
|
136
|
-
extra_rdoc_files:
|
96
|
+
extra_rdoc_files:
|
137
97
|
- LICENSE
|
138
98
|
- README.markdown
|
139
|
-
files:
|
99
|
+
files:
|
140
100
|
- .rspec
|
141
101
|
- Gemfile
|
142
102
|
- Gemfile.lock
|
@@ -216,39 +176,31 @@ files:
|
|
216
176
|
- spec/mailee-api_spec.rb
|
217
177
|
- spec/spec_helper.rb
|
218
178
|
- tasks/mailee_tasks.rake
|
219
|
-
has_rdoc: true
|
220
179
|
homepage: http://help.mailee.me/integration_rails.html
|
221
180
|
licenses: []
|
222
|
-
|
223
181
|
post_install_message:
|
224
182
|
rdoc_options: []
|
225
|
-
|
226
|
-
require_paths:
|
183
|
+
require_paths:
|
227
184
|
- lib
|
228
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
229
186
|
none: false
|
230
|
-
requirements:
|
231
|
-
- -
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
|
234
|
-
segments:
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
segments:
|
235
192
|
- 0
|
236
|
-
|
237
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
hash: 73340575297455940
|
194
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
195
|
none: false
|
239
|
-
requirements:
|
240
|
-
- -
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
|
243
|
-
segments:
|
244
|
-
- 0
|
245
|
-
version: "0"
|
196
|
+
requirements:
|
197
|
+
- - ! '>='
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
246
200
|
requirements: []
|
247
|
-
|
248
201
|
rubyforge_project:
|
249
|
-
rubygems_version: 1.
|
202
|
+
rubygems_version: 1.8.10
|
250
203
|
signing_key:
|
251
204
|
specification_version: 3
|
252
205
|
summary: Gem para uso da API do Mailee.me
|
253
206
|
test_files: []
|
254
|
-
|