catarse_monkeymail 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.gitmodules +3 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +548 -0
- data/MIT-LICENSE +20 -0
- data/README.md +3 -0
- data/Rakefile +34 -0
- data/app/controllers/catarse_monkeymail/application_controller.rb +4 -0
- data/app/controllers/catarse_monkeymail/controller_concerns.rb +9 -0
- data/app/models/catarse_monkeymail/mailchimp_api.rb +7 -0
- data/app/models/catarse_monkeymail/project_concern.rb +32 -0
- data/app/models/catarse_monkeymail/user_concern.rb +34 -0
- data/app/observers/catarse_monkeymail/monkey_project_observer.rb +15 -0
- data/bin/rails +12 -0
- data/catarse_monkeymail.gemspec +25 -0
- data/config/routes.rb +2 -0
- data/lib/catarse_monkeymail/engine.rb +11 -0
- data/lib/catarse_monkeymail/version.rb +3 -0
- data/lib/catarse_monkeymail.rb +4 -0
- data/lib/tasks/catarse_monkeymail_tasks.rake +4 -0
- data/spec/models/catarse_monkeymail/project_spec.rb +32 -0
- data/spec/models/catarse_monkeymail/user_spec.rb +52 -0
- data/spec/spec_helper.rb +106 -0
- metadata +112 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: deb390340c759808013f6f0e892f59024cd98eb0
|
|
4
|
+
data.tar.gz: 9d9b80737a26891588c5e150301a39d9a8988644
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2165c734d2c88ef6f327c3b8bb11e5287e4d4e3455c323aca2b740d0bc58dbda6a662b5f3399fd7f7653339a9bcc5314910eb9d6f6cf559c13046f7ec7670c3d
|
|
7
|
+
data.tar.gz: 9de109719e1f28c5673768acf1b4fff1765e543df90f425cd29eeeef1a04cc6aa67745b079b7389a61594f93d130fdb9f4c7cf097887fd36ef3d0652676c366f
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
gemfile_url = File.join(File.dirname(__FILE__), 'spec/dummy/Gemfile')
|
|
4
|
+
gemfile_content = File.open(gemfile_url, "rb") { |f| f.read }
|
|
5
|
+
eval_gemfile gemfile_url, gemfile_content.gsub(/(gem 'catarse_monkeymail'.+)/, '')
|
|
6
|
+
|
|
7
|
+
gemspec
|
|
8
|
+
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: git://github.com/bernat/best_in_place.git
|
|
3
|
+
revision: 366413be357d65cdf47031e928aea969f72e3659
|
|
4
|
+
branch: rails-4
|
|
5
|
+
specs:
|
|
6
|
+
best_in_place (2.0.3)
|
|
7
|
+
jquery-rails
|
|
8
|
+
rails (~> 4)
|
|
9
|
+
|
|
10
|
+
GIT
|
|
11
|
+
remote: git://github.com/catarse/catarse_mailchimp
|
|
12
|
+
revision: 2ed4f3931dfa292e5c1c62619772f04e41c68629
|
|
13
|
+
ref: 2ed4f39
|
|
14
|
+
specs:
|
|
15
|
+
catarse_mailchimp (0.0.1)
|
|
16
|
+
mailchimp
|
|
17
|
+
supermodel
|
|
18
|
+
|
|
19
|
+
GIT
|
|
20
|
+
remote: git://github.com/catarse/moip-ruby.git
|
|
21
|
+
revision: c0225ad71645cd1df35dafa1e45c9f092b3abb9e
|
|
22
|
+
specs:
|
|
23
|
+
moip (1.0.2)
|
|
24
|
+
activesupport (>= 2.3.2)
|
|
25
|
+
httparty (~> 0.6.1)
|
|
26
|
+
nokogiri (>= 1.5.0)
|
|
27
|
+
|
|
28
|
+
PATH
|
|
29
|
+
remote: .
|
|
30
|
+
specs:
|
|
31
|
+
catarse_monkeymail (0.0.1)
|
|
32
|
+
mailchimp-api (~> 2.0.4)
|
|
33
|
+
rails (~> 4.0.3)
|
|
34
|
+
|
|
35
|
+
GEM
|
|
36
|
+
remote: https://rubygems.org/
|
|
37
|
+
remote: https://rubygems.org/
|
|
38
|
+
specs:
|
|
39
|
+
RedCloth (4.2.9)
|
|
40
|
+
actionmailer (4.0.3)
|
|
41
|
+
actionpack (= 4.0.3)
|
|
42
|
+
mail (~> 2.5.4)
|
|
43
|
+
actionpack (4.0.3)
|
|
44
|
+
activesupport (= 4.0.3)
|
|
45
|
+
builder (~> 3.1.0)
|
|
46
|
+
erubis (~> 2.7.0)
|
|
47
|
+
rack (~> 1.5.2)
|
|
48
|
+
rack-test (~> 0.6.2)
|
|
49
|
+
active_utils (2.0.2)
|
|
50
|
+
activesupport (>= 2.3.11)
|
|
51
|
+
i18n
|
|
52
|
+
activemerchant (1.42.6)
|
|
53
|
+
active_utils (~> 2.0, >= 2.0.1)
|
|
54
|
+
activesupport (>= 2.3.14, < 5.0.0)
|
|
55
|
+
builder (>= 2.1.2, < 4.0.0)
|
|
56
|
+
i18n (~> 0.5)
|
|
57
|
+
json (~> 1.7)
|
|
58
|
+
money (< 7.0.0)
|
|
59
|
+
nokogiri (~> 1.4)
|
|
60
|
+
activemodel (4.0.3)
|
|
61
|
+
activesupport (= 4.0.3)
|
|
62
|
+
builder (~> 3.1.0)
|
|
63
|
+
activerecord (4.0.3)
|
|
64
|
+
activemodel (= 4.0.3)
|
|
65
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
|
66
|
+
activesupport (= 4.0.3)
|
|
67
|
+
arel (~> 4.0.0)
|
|
68
|
+
activerecord-deprecated_finders (1.0.3)
|
|
69
|
+
activesupport (4.0.3)
|
|
70
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
71
|
+
minitest (~> 4.2)
|
|
72
|
+
multi_json (~> 1.3)
|
|
73
|
+
thread_safe (~> 0.1)
|
|
74
|
+
tzinfo (~> 0.3.37)
|
|
75
|
+
addressable (2.3.5)
|
|
76
|
+
arel (4.0.2)
|
|
77
|
+
auto_html (1.4.2)
|
|
78
|
+
RedCloth
|
|
79
|
+
redcarpet
|
|
80
|
+
rinku
|
|
81
|
+
tag_helper
|
|
82
|
+
bcrypt (3.1.7)
|
|
83
|
+
better_errors (1.1.0)
|
|
84
|
+
coderay (>= 1.0.0)
|
|
85
|
+
erubis (>= 2.6.6)
|
|
86
|
+
binding_of_caller (0.7.2)
|
|
87
|
+
debug_inspector (>= 0.0.1)
|
|
88
|
+
browser (0.3.2)
|
|
89
|
+
builder (3.1.4)
|
|
90
|
+
capybara (2.1.0)
|
|
91
|
+
mime-types (>= 1.16)
|
|
92
|
+
nokogiri (>= 1.3.3)
|
|
93
|
+
rack (>= 1.0.0)
|
|
94
|
+
rack-test (>= 0.5.4)
|
|
95
|
+
xpath (~> 2.0)
|
|
96
|
+
carrierwave (0.10.0)
|
|
97
|
+
activemodel (>= 3.2.0)
|
|
98
|
+
activesupport (>= 3.2.0)
|
|
99
|
+
json (>= 1.7)
|
|
100
|
+
mime-types (>= 1.16)
|
|
101
|
+
catarse_moip (2.3.5)
|
|
102
|
+
enumerate_it
|
|
103
|
+
libxml-ruby (~> 2.6.0)
|
|
104
|
+
rails (~> 4.0)
|
|
105
|
+
catarse_paypal_express (2.2.3)
|
|
106
|
+
activemerchant (>= 1.34.0)
|
|
107
|
+
rails (~> 4.0)
|
|
108
|
+
slim-rails
|
|
109
|
+
catarse_settings_db (0.0.1)
|
|
110
|
+
rails (~> 4.0.3)
|
|
111
|
+
celluloid (0.15.2)
|
|
112
|
+
timers (~> 1.1.0)
|
|
113
|
+
chartkick (1.2.1)
|
|
114
|
+
childprocess (0.4.0)
|
|
115
|
+
ffi (~> 1.0, >= 1.0.11)
|
|
116
|
+
chunky_png (1.2.9)
|
|
117
|
+
cliver (0.3.2)
|
|
118
|
+
coderay (1.1.0)
|
|
119
|
+
coffee-rails (4.0.1)
|
|
120
|
+
coffee-script (>= 2.2.0)
|
|
121
|
+
railties (>= 4.0.0, < 5.0)
|
|
122
|
+
coffee-script (2.2.0)
|
|
123
|
+
coffee-script-source
|
|
124
|
+
execjs
|
|
125
|
+
coffee-script-source (1.6.3)
|
|
126
|
+
compass (0.12.2)
|
|
127
|
+
chunky_png (~> 1.2)
|
|
128
|
+
fssm (>= 0.2.7)
|
|
129
|
+
sass (~> 3.1)
|
|
130
|
+
compass-960-plugin (0.10.4)
|
|
131
|
+
compass (>= 0.10.0)
|
|
132
|
+
compass-rails (1.1.3)
|
|
133
|
+
compass (>= 0.12.2)
|
|
134
|
+
connection_pool (1.2.0)
|
|
135
|
+
coveralls (0.7.0)
|
|
136
|
+
multi_json (~> 1.3)
|
|
137
|
+
rest-client
|
|
138
|
+
simplecov (>= 0.7)
|
|
139
|
+
term-ansicolor
|
|
140
|
+
thor
|
|
141
|
+
crack (0.1.8)
|
|
142
|
+
curb (0.8.5)
|
|
143
|
+
database_cleaner (1.2.0)
|
|
144
|
+
debug_inspector (0.0.2)
|
|
145
|
+
devise (3.2.4)
|
|
146
|
+
bcrypt (~> 3.0)
|
|
147
|
+
orm_adapter (~> 0.1)
|
|
148
|
+
railties (>= 3.2.6, < 5)
|
|
149
|
+
thread_safe (~> 0.1)
|
|
150
|
+
warden (~> 1.2.3)
|
|
151
|
+
diff-lcs (1.2.5)
|
|
152
|
+
docile (1.1.1)
|
|
153
|
+
dotenv (0.9.0)
|
|
154
|
+
draper (1.3.0)
|
|
155
|
+
actionpack (>= 3.0)
|
|
156
|
+
activemodel (>= 3.0)
|
|
157
|
+
activesupport (>= 3.0)
|
|
158
|
+
request_store (~> 1.0.3)
|
|
159
|
+
enumerate_it (1.2.1)
|
|
160
|
+
activesupport (>= 3.0.0)
|
|
161
|
+
erubis (2.7.0)
|
|
162
|
+
excon (0.31.0)
|
|
163
|
+
execjs (2.0.2)
|
|
164
|
+
ezcrypto (0.7.2)
|
|
165
|
+
factory_girl (4.3.0)
|
|
166
|
+
activesupport (>= 3.0.0)
|
|
167
|
+
factory_girl_rails (4.3.0)
|
|
168
|
+
factory_girl (~> 4.3.0)
|
|
169
|
+
railties (>= 3.0.0)
|
|
170
|
+
fakeweb (1.3.0)
|
|
171
|
+
faraday (0.8.8)
|
|
172
|
+
multipart-post (~> 1.2.0)
|
|
173
|
+
feedzirra (0.7.0)
|
|
174
|
+
curb (~> 0.8.1)
|
|
175
|
+
loofah (~> 1.2.1)
|
|
176
|
+
sax-machine (~> 0.2.1)
|
|
177
|
+
ffi (1.9.3)
|
|
178
|
+
fog (1.19.0)
|
|
179
|
+
builder
|
|
180
|
+
excon (~> 0.31.0)
|
|
181
|
+
formatador (~> 0.2.0)
|
|
182
|
+
mime-types
|
|
183
|
+
multi_json (~> 1.0)
|
|
184
|
+
net-scp (~> 1.1)
|
|
185
|
+
net-ssh (>= 2.1.3)
|
|
186
|
+
nokogiri (~> 1.5)
|
|
187
|
+
ruby-hmac
|
|
188
|
+
foreman (0.63.0)
|
|
189
|
+
dotenv (>= 0.7)
|
|
190
|
+
thor (>= 0.13.6)
|
|
191
|
+
formatador (0.2.4)
|
|
192
|
+
formtastic (2.2.1)
|
|
193
|
+
actionpack (>= 3.0)
|
|
194
|
+
fssm (0.2.10)
|
|
195
|
+
has_scope (0.6.0.rc)
|
|
196
|
+
actionpack (>= 3.2, < 5)
|
|
197
|
+
activesupport (>= 3.2, < 5)
|
|
198
|
+
hashie (2.0.5)
|
|
199
|
+
heroku-deflater (0.5.3)
|
|
200
|
+
rack (>= 1.4.5)
|
|
201
|
+
high_voltage (2.1.0)
|
|
202
|
+
hike (1.2.3)
|
|
203
|
+
htmlentities (4.3.1)
|
|
204
|
+
http_accept_language (2.0.0)
|
|
205
|
+
httparty (0.6.1)
|
|
206
|
+
crack (= 0.1.8)
|
|
207
|
+
httpauth (0.2.0)
|
|
208
|
+
httpclient (2.3.4.1)
|
|
209
|
+
i18n (0.6.9)
|
|
210
|
+
inherited_resources (1.4.1)
|
|
211
|
+
has_scope (~> 0.6.0.rc)
|
|
212
|
+
responders (~> 1.0.0.rc)
|
|
213
|
+
jasmine-core (2.0.0)
|
|
214
|
+
jasmine-rails (0.6.0)
|
|
215
|
+
jasmine-core (>= 1.3, < 3.0)
|
|
216
|
+
phantomjs
|
|
217
|
+
rails (>= 3.1.0)
|
|
218
|
+
sprockets-rails
|
|
219
|
+
jquery-rails (3.0.4)
|
|
220
|
+
railties (>= 3.0, < 5.0)
|
|
221
|
+
thor (>= 0.14, < 2.0)
|
|
222
|
+
json (1.8.1)
|
|
223
|
+
jwt (0.1.8)
|
|
224
|
+
multi_json (>= 1.5)
|
|
225
|
+
kaminari (0.15.0)
|
|
226
|
+
actionpack (>= 3.0.0)
|
|
227
|
+
activesupport (>= 3.0.0)
|
|
228
|
+
kgio (2.8.1)
|
|
229
|
+
launchy (2.4.2)
|
|
230
|
+
addressable (~> 2.3)
|
|
231
|
+
letter_opener (1.2.0)
|
|
232
|
+
launchy (~> 2.2)
|
|
233
|
+
libxml-ruby (2.6.0)
|
|
234
|
+
loofah (1.2.1)
|
|
235
|
+
nokogiri (>= 1.4.4)
|
|
236
|
+
mail (2.5.4)
|
|
237
|
+
mime-types (~> 1.16)
|
|
238
|
+
treetop (~> 1.4.8)
|
|
239
|
+
mailchimp (0.0.9)
|
|
240
|
+
httparty
|
|
241
|
+
mailchimp-api (2.0.4)
|
|
242
|
+
excon (>= 0.16.0)
|
|
243
|
+
json (>= 1.7.7)
|
|
244
|
+
method_source (0.8.2)
|
|
245
|
+
mime-types (1.25.1)
|
|
246
|
+
mini_portile (0.5.2)
|
|
247
|
+
minitest (4.7.5)
|
|
248
|
+
mixpanel-ruby (1.4.0)
|
|
249
|
+
monetize (0.1.4)
|
|
250
|
+
money (6.0.1)
|
|
251
|
+
i18n (~> 0.6.4)
|
|
252
|
+
monetize (~> 0.1.3)
|
|
253
|
+
multi_json (1.9.2)
|
|
254
|
+
multipart-post (1.2.0)
|
|
255
|
+
net-scp (1.1.2)
|
|
256
|
+
net-ssh (>= 2.6.5)
|
|
257
|
+
net-ssh (2.7.0)
|
|
258
|
+
newrelic_rpm (3.6.5.130)
|
|
259
|
+
nokogiri (1.6.1)
|
|
260
|
+
mini_portile (~> 0.5.0)
|
|
261
|
+
oauth (0.4.7)
|
|
262
|
+
oauth2 (0.8.1)
|
|
263
|
+
faraday (~> 0.8)
|
|
264
|
+
httpauth (~> 0.1)
|
|
265
|
+
jwt (~> 0.1.4)
|
|
266
|
+
multi_json (~> 1.0)
|
|
267
|
+
rack (~> 1.2)
|
|
268
|
+
omniauth (1.1.4)
|
|
269
|
+
hashie (>= 1.2, < 3)
|
|
270
|
+
rack
|
|
271
|
+
omniauth-facebook (1.4.0)
|
|
272
|
+
omniauth-oauth2 (~> 1.0.2)
|
|
273
|
+
omniauth-oauth (1.0.1)
|
|
274
|
+
oauth
|
|
275
|
+
omniauth (~> 1.0)
|
|
276
|
+
omniauth-oauth2 (1.0.3)
|
|
277
|
+
oauth2 (~> 0.8.0)
|
|
278
|
+
omniauth (~> 1.0)
|
|
279
|
+
omniauth-twitter (1.0.1)
|
|
280
|
+
multi_json (~> 1.3)
|
|
281
|
+
omniauth-oauth (~> 1.0)
|
|
282
|
+
orm_adapter (0.5.0)
|
|
283
|
+
pg (0.17.1)
|
|
284
|
+
pg_search (0.7.2)
|
|
285
|
+
activerecord (>= 3.1)
|
|
286
|
+
activesupport (>= 3.1)
|
|
287
|
+
arel
|
|
288
|
+
phantomjs (1.9.7.0)
|
|
289
|
+
poltergeist (1.5.0)
|
|
290
|
+
capybara (~> 2.1)
|
|
291
|
+
cliver (~> 0.3.1)
|
|
292
|
+
multi_json (~> 1.0)
|
|
293
|
+
websocket-driver (>= 0.2.0)
|
|
294
|
+
polyglot (0.3.4)
|
|
295
|
+
postgres-copy (0.8.0)
|
|
296
|
+
activerecord (~> 4.0)
|
|
297
|
+
pg
|
|
298
|
+
rails (~> 4.0)
|
|
299
|
+
responders
|
|
300
|
+
protected_attributes (1.0.5)
|
|
301
|
+
activemodel (>= 4.0.1, < 5.0)
|
|
302
|
+
pry (0.9.12.4)
|
|
303
|
+
coderay (~> 1.0)
|
|
304
|
+
method_source (~> 0.8)
|
|
305
|
+
slop (~> 3.4)
|
|
306
|
+
pundit (0.2.1)
|
|
307
|
+
activesupport (>= 3.0.0)
|
|
308
|
+
rack (1.5.2)
|
|
309
|
+
rack-protection (1.5.1)
|
|
310
|
+
rack
|
|
311
|
+
rack-test (0.6.2)
|
|
312
|
+
rack (>= 1.0)
|
|
313
|
+
rails (4.0.3)
|
|
314
|
+
actionmailer (= 4.0.3)
|
|
315
|
+
actionpack (= 4.0.3)
|
|
316
|
+
activerecord (= 4.0.3)
|
|
317
|
+
activesupport (= 4.0.3)
|
|
318
|
+
bundler (>= 1.3.0, < 2.0)
|
|
319
|
+
railties (= 4.0.3)
|
|
320
|
+
sprockets-rails (~> 2.0.0)
|
|
321
|
+
rails-observers (0.1.2)
|
|
322
|
+
activemodel (~> 4.0)
|
|
323
|
+
rails_12factor (0.0.2)
|
|
324
|
+
rails_serve_static_assets
|
|
325
|
+
rails_stdout_logging
|
|
326
|
+
rails_serve_static_assets (0.0.2)
|
|
327
|
+
rails_stdout_logging (0.0.3)
|
|
328
|
+
railties (4.0.3)
|
|
329
|
+
actionpack (= 4.0.3)
|
|
330
|
+
activesupport (= 4.0.3)
|
|
331
|
+
rake (>= 0.8.7)
|
|
332
|
+
thor (>= 0.18.1, < 2.0)
|
|
333
|
+
raindrops (0.12.0)
|
|
334
|
+
rake (10.2.2)
|
|
335
|
+
ranked-model (0.3)
|
|
336
|
+
activerecord (>= 3.1.12)
|
|
337
|
+
redcarpet (3.0.0)
|
|
338
|
+
redis (3.0.6)
|
|
339
|
+
redis-namespace (1.4.1)
|
|
340
|
+
redis (~> 3.0.4)
|
|
341
|
+
request_store (1.0.5)
|
|
342
|
+
responders (1.0.0)
|
|
343
|
+
railties (>= 3.2, < 5)
|
|
344
|
+
rest-client (1.6.7)
|
|
345
|
+
mime-types (>= 1.16)
|
|
346
|
+
rinku (1.7.3)
|
|
347
|
+
rmagick (2.13.2)
|
|
348
|
+
routing-filter (0.4.0.pre)
|
|
349
|
+
actionpack
|
|
350
|
+
rspec-core (2.14.7)
|
|
351
|
+
rspec-expectations (2.14.4)
|
|
352
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
353
|
+
rspec-mocks (2.14.4)
|
|
354
|
+
rspec-rails (2.14.1)
|
|
355
|
+
actionpack (>= 3.0)
|
|
356
|
+
activemodel (>= 3.0)
|
|
357
|
+
activesupport (>= 3.0)
|
|
358
|
+
railties (>= 3.0)
|
|
359
|
+
rspec-core (~> 2.14.0)
|
|
360
|
+
rspec-expectations (~> 2.14.0)
|
|
361
|
+
rspec-mocks (~> 2.14.0)
|
|
362
|
+
ruby-hmac (0.4.0)
|
|
363
|
+
ruby-ole (1.2.11.7)
|
|
364
|
+
rubyzip (1.1.0)
|
|
365
|
+
sass (3.2.13)
|
|
366
|
+
sass-rails (4.0.1)
|
|
367
|
+
railties (>= 4.0.0, < 5.0)
|
|
368
|
+
sass (>= 3.1.10)
|
|
369
|
+
sprockets-rails (~> 2.0.0)
|
|
370
|
+
sax-machine (0.2.1)
|
|
371
|
+
nokogiri (~> 1.6.0)
|
|
372
|
+
schema_associations (1.2.0)
|
|
373
|
+
schema_plus (>= 1.2.0)
|
|
374
|
+
schema_plus (1.3.2)
|
|
375
|
+
rails (>= 3.2)
|
|
376
|
+
valuable
|
|
377
|
+
selenium-webdriver (2.39.0)
|
|
378
|
+
childprocess (>= 0.2.5)
|
|
379
|
+
multi_json (~> 1.0)
|
|
380
|
+
rubyzip (~> 1.0)
|
|
381
|
+
websocket (~> 1.0.4)
|
|
382
|
+
shoulda (3.5.0)
|
|
383
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
|
384
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
385
|
+
shoulda-context (1.1.6)
|
|
386
|
+
shoulda-matchers (2.4.0)
|
|
387
|
+
activesupport (>= 3.0.0)
|
|
388
|
+
sidekiq (2.15.2)
|
|
389
|
+
celluloid (>= 0.15.2)
|
|
390
|
+
connection_pool (>= 1.0.0)
|
|
391
|
+
json
|
|
392
|
+
redis (>= 3.0.4)
|
|
393
|
+
redis-namespace (>= 1.3.1)
|
|
394
|
+
simple_form (3.0.1)
|
|
395
|
+
actionpack (>= 4.0.0, < 4.1)
|
|
396
|
+
activemodel (>= 4.0.0, < 4.1)
|
|
397
|
+
simplecov (0.8.2)
|
|
398
|
+
docile (~> 1.1.0)
|
|
399
|
+
multi_json
|
|
400
|
+
simplecov-html (~> 0.8.0)
|
|
401
|
+
simplecov-html (0.8.0)
|
|
402
|
+
sinatra (1.4.4)
|
|
403
|
+
rack (~> 1.4)
|
|
404
|
+
rack-protection (~> 1.4)
|
|
405
|
+
tilt (~> 1.3, >= 1.3.4)
|
|
406
|
+
slim (2.0.2)
|
|
407
|
+
temple (~> 0.6.6)
|
|
408
|
+
tilt (>= 1.3.3, < 2.1)
|
|
409
|
+
slim-rails (2.1.2)
|
|
410
|
+
actionpack (>= 3.0, < 4.1)
|
|
411
|
+
activesupport (>= 3.0, < 4.1)
|
|
412
|
+
railties (>= 3.0, < 4.1)
|
|
413
|
+
slim (~> 2.0)
|
|
414
|
+
slop (3.4.7)
|
|
415
|
+
spectator-validates_email (0.2.0)
|
|
416
|
+
activemodel (>= 3.0.0)
|
|
417
|
+
spreadsheet (0.9.6)
|
|
418
|
+
ruby-ole (>= 1.0)
|
|
419
|
+
sprockets (2.10.1)
|
|
420
|
+
hike (~> 1.2)
|
|
421
|
+
multi_json (~> 1.0)
|
|
422
|
+
rack (~> 1.0)
|
|
423
|
+
tilt (~> 1.1, != 1.3.0)
|
|
424
|
+
sprockets-rails (2.0.1)
|
|
425
|
+
actionpack (>= 3.0)
|
|
426
|
+
activesupport (>= 3.0)
|
|
427
|
+
sprockets (~> 2.8)
|
|
428
|
+
sqlite3 (1.3.9)
|
|
429
|
+
state_machine (1.2.0)
|
|
430
|
+
supermodel (0.1.4)
|
|
431
|
+
activemodel (>= 3.0.0.beta)
|
|
432
|
+
tag_helper (0.0.3)
|
|
433
|
+
temple (0.6.7)
|
|
434
|
+
term-ansicolor (1.2.2)
|
|
435
|
+
tins (~> 0.8)
|
|
436
|
+
thor (0.19.1)
|
|
437
|
+
thread_safe (0.3.3)
|
|
438
|
+
tilt (1.4.1)
|
|
439
|
+
timers (1.1.0)
|
|
440
|
+
tins (0.13.1)
|
|
441
|
+
to_xls (1.5.2)
|
|
442
|
+
spreadsheet
|
|
443
|
+
treetop (1.4.15)
|
|
444
|
+
polyglot
|
|
445
|
+
polyglot (>= 0.3.1)
|
|
446
|
+
tzinfo (0.3.39)
|
|
447
|
+
uglifier (2.4.0)
|
|
448
|
+
execjs (>= 0.3.0)
|
|
449
|
+
json (>= 1.8.0)
|
|
450
|
+
unicorn (4.7.0)
|
|
451
|
+
kgio (~> 2.6)
|
|
452
|
+
rack
|
|
453
|
+
raindrops (~> 0.7)
|
|
454
|
+
valuable (0.9.8)
|
|
455
|
+
video_info (2.0.2)
|
|
456
|
+
addressable
|
|
457
|
+
htmlentities
|
|
458
|
+
multi_json
|
|
459
|
+
warden (1.2.3)
|
|
460
|
+
rack (>= 1.0)
|
|
461
|
+
websocket (1.0.7)
|
|
462
|
+
websocket-driver (0.3.2)
|
|
463
|
+
weekdays (1.0.2)
|
|
464
|
+
xpath (2.0.0)
|
|
465
|
+
nokogiri (~> 1.3)
|
|
466
|
+
|
|
467
|
+
PLATFORMS
|
|
468
|
+
ruby
|
|
469
|
+
|
|
470
|
+
DEPENDENCIES
|
|
471
|
+
RedCloth
|
|
472
|
+
auto_html (= 1.4.2)
|
|
473
|
+
best_in_place!
|
|
474
|
+
better_errors
|
|
475
|
+
binding_of_caller
|
|
476
|
+
browser
|
|
477
|
+
capybara (~> 2.1.0)
|
|
478
|
+
carrierwave (~> 0.10.0)
|
|
479
|
+
catarse_mailchimp!
|
|
480
|
+
catarse_moip (~> 2.3.5)
|
|
481
|
+
catarse_monkeymail!
|
|
482
|
+
catarse_paypal_express (= 2.2.3)
|
|
483
|
+
catarse_settings_db
|
|
484
|
+
chartkick
|
|
485
|
+
coffee-rails (~> 4.0.0)
|
|
486
|
+
compass-960-plugin
|
|
487
|
+
compass-rails
|
|
488
|
+
coveralls
|
|
489
|
+
database_cleaner
|
|
490
|
+
devise
|
|
491
|
+
draper
|
|
492
|
+
ezcrypto
|
|
493
|
+
factory_girl_rails
|
|
494
|
+
fakeweb
|
|
495
|
+
feedzirra
|
|
496
|
+
fog (>= 1.3.1)
|
|
497
|
+
foreman
|
|
498
|
+
formtastic (~> 2.2.1)
|
|
499
|
+
has_scope (~> 0.6.0.rc)
|
|
500
|
+
heroku-deflater (>= 0.4.1)
|
|
501
|
+
high_voltage
|
|
502
|
+
http_accept_language
|
|
503
|
+
httparty (~> 0.6.1)
|
|
504
|
+
httpclient (>= 2.2.5)
|
|
505
|
+
inherited_resources (~> 1.4.1)
|
|
506
|
+
jasmine-rails
|
|
507
|
+
jquery-rails
|
|
508
|
+
kaminari
|
|
509
|
+
launchy
|
|
510
|
+
letter_opener
|
|
511
|
+
mixpanel-ruby
|
|
512
|
+
moip!
|
|
513
|
+
newrelic_rpm (= 3.6.5.130)
|
|
514
|
+
omniauth
|
|
515
|
+
omniauth-facebook (= 1.4.0)
|
|
516
|
+
omniauth-twitter
|
|
517
|
+
pg
|
|
518
|
+
pg_search
|
|
519
|
+
poltergeist
|
|
520
|
+
postgres-copy
|
|
521
|
+
protected_attributes (~> 1.0.5)
|
|
522
|
+
pry
|
|
523
|
+
pundit
|
|
524
|
+
rails (= 4.0.3)
|
|
525
|
+
rails-observers (~> 0.1.2)
|
|
526
|
+
rails_12factor
|
|
527
|
+
ranked-model
|
|
528
|
+
rmagick
|
|
529
|
+
routing-filter (~> 0.4.0.pre)
|
|
530
|
+
rspec-rails (~> 2.14.0)
|
|
531
|
+
sass-rails (~> 4.0.0)
|
|
532
|
+
schema_associations
|
|
533
|
+
schema_plus
|
|
534
|
+
selenium-webdriver
|
|
535
|
+
shoulda
|
|
536
|
+
sidekiq (~> 2.15.2)
|
|
537
|
+
simple_form
|
|
538
|
+
sinatra
|
|
539
|
+
slim-rails
|
|
540
|
+
spectator-validates_email
|
|
541
|
+
sprockets (~> 2.10.1)
|
|
542
|
+
sqlite3
|
|
543
|
+
state_machine
|
|
544
|
+
to_xls
|
|
545
|
+
uglifier
|
|
546
|
+
unicorn
|
|
547
|
+
video_info (>= 1.1.1)
|
|
548
|
+
weekdays
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2014 YOURNAME
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require 'rdoc/task'
|
|
8
|
+
|
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
11
|
+
rdoc.title = 'CatarseMonkeymail'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
|
18
|
+
load 'rails/tasks/engine.rake'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Bundler::GemHelper.install_tasks
|
|
23
|
+
|
|
24
|
+
require 'rake/testtask'
|
|
25
|
+
|
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
|
27
|
+
t.libs << 'lib'
|
|
28
|
+
t.libs << 'test'
|
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
|
30
|
+
t.verbose = false
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
task default: :test
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module CatarseMonkeymail::ProjectConcern
|
|
2
|
+
extend ActiveSupport::Concern
|
|
3
|
+
|
|
4
|
+
included do
|
|
5
|
+
def mailchimp
|
|
6
|
+
@mailchimp ||= ::CatarseMonkeymail::MailchimpApi.start
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def subscribe_owner_to_success_list
|
|
10
|
+
subscribe_to_list ::CatarseSettings[:mailchimp_successful_projects_list]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def subscribe_owner_to_failed_list
|
|
14
|
+
subscribe_to_list ::CatarseSettings[:mailchimp_failed_projects_list]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def subscribe_to_list list_id
|
|
20
|
+
mailchimp.list.subscribe list_id, { email: self.user.email }, subscriber_args
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def subscriber_args
|
|
24
|
+
{
|
|
25
|
+
fname: self.user.name,
|
|
26
|
+
city: self.user.address_city,
|
|
27
|
+
state: self.user.address_state
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module CatarseMonkeymail::UserConcern
|
|
2
|
+
extend ActiveSupport::Concern
|
|
3
|
+
|
|
4
|
+
included do
|
|
5
|
+
|
|
6
|
+
before_save do
|
|
7
|
+
if self.newsletter_changed? && self.newsletter
|
|
8
|
+
return subscribe_to_newsletter_list
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
if self.newsletter && self.email_changed? && !self.new_record?
|
|
12
|
+
unsubscribe_from_newsletter_list self.email_was
|
|
13
|
+
return subscribe_to_newsletter_list
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
if self.newsletter_changed? && !self.newsletter
|
|
17
|
+
return unsubscribe_from_newsletter_list
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def mailchimp
|
|
22
|
+
@mailchimp ||= ::CatarseMonkeymail::MailchimpApi.start
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def subscribe_to_newsletter_list
|
|
26
|
+
mailchimp.list.subscribe ::CatarseSettings[:mailchimp_list_id], { email: self.email }, { name: self.name }
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def unsubscribe_from_newsletter_list email_arg = self.email
|
|
30
|
+
mailchimp.list.unsubscribe ::CatarseMonkeymail[:mailchimp_list_id], { email: email_arg }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module CatarseMonkeymail
|
|
2
|
+
class MonkeyProjectObserver < ActiveRecord::Observer
|
|
3
|
+
observe :project
|
|
4
|
+
|
|
5
|
+
def from_online_to_successful(project)
|
|
6
|
+
project.subscribe_owner_to_success_list
|
|
7
|
+
end
|
|
8
|
+
alias :from_waiting_funds_to_successful :from_online_to_successful
|
|
9
|
+
|
|
10
|
+
def from_online_to_failed(project)
|
|
11
|
+
project.subscribe_owner_to_failed_list
|
|
12
|
+
end
|
|
13
|
+
alias :from_waiting_funds_to_failed :from_online_to_failed
|
|
14
|
+
end
|
|
15
|
+
end
|
data/bin/rails
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
|
3
|
+
|
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/catarse_monkeymail/engine', __FILE__)
|
|
6
|
+
|
|
7
|
+
# Set up gems listed in the Gemfile.
|
|
8
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
9
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
10
|
+
|
|
11
|
+
require 'rails/all'
|
|
12
|
+
require 'rails/engine/commands'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
2
|
+
|
|
3
|
+
# Maintain your gem's version:
|
|
4
|
+
require "catarse_monkeymail/version"
|
|
5
|
+
|
|
6
|
+
# Describe your gem and declare its dependencies:
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = "catarse_monkeymail"
|
|
9
|
+
s.version = CatarseMonkeymail::VERSION
|
|
10
|
+
s.authors = ["Antônio Roberto Silva"]
|
|
11
|
+
s.email = ["ton@catarse.me"]
|
|
12
|
+
s.homepage = "http://catarse.me"
|
|
13
|
+
s.summary = "Integration with the best newsletter services <3"
|
|
14
|
+
s.description = "A new catarse integration with mailchimp"
|
|
15
|
+
|
|
16
|
+
s.files = `git ls-files`.split($/)
|
|
17
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
s.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
s.add_dependency "rails", "~> 4.0.3"
|
|
22
|
+
s.add_dependency "mailchimp-api", "~> 2.0.4"
|
|
23
|
+
|
|
24
|
+
s.add_development_dependency "sqlite3"
|
|
25
|
+
end
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module CatarseMonkeymail
|
|
2
|
+
class Engine < ::Rails::Engine
|
|
3
|
+
isolate_namespace CatarseMonkeymail
|
|
4
|
+
|
|
5
|
+
initializer 'include modules' do
|
|
6
|
+
::ApplicationController.send(:include, CatarseMonkeymail::ControllerConcerns)
|
|
7
|
+
::User.send(:include, CatarseMonkeymail::UserConcern)
|
|
8
|
+
::Project.send(:include, CatarseMonkeymail::ProjectConcern)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Project do
|
|
4
|
+
before do
|
|
5
|
+
Project.any_instance.stub(:subscribe_owner_to_success_list)
|
|
6
|
+
Project.any_instance.stub(:subscribe_owner_to_failed_list)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
context "when project is successful" do
|
|
10
|
+
let(:project) { create(:project, state: 'waiting_funds', goal: 10, online_days: -10, online_date: 20.days.ago ) }
|
|
11
|
+
|
|
12
|
+
before do
|
|
13
|
+
project.stub(:pledged).and_return(30)
|
|
14
|
+
|
|
15
|
+
project.should_receive(:subscribe_owner_to_success_list)
|
|
16
|
+
project.should_not_receive(:subscribe_owner_to_failed_list)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it { project.finish }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
context "when project is failed" do
|
|
23
|
+
let(:project) { create(:project, state: 'waiting_funds', goal: 10, online_days: -10, online_date: 20.days.ago ) }
|
|
24
|
+
|
|
25
|
+
before do
|
|
26
|
+
project.should_not_receive(:subscribe_owner_to_success_list)
|
|
27
|
+
project.should_receive(:subscribe_owner_to_failed_list)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it { project.finish }
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe User do
|
|
4
|
+
describe "before_save" do
|
|
5
|
+
before do
|
|
6
|
+
User.any_instance.stub(:subscribe_to_newsletter_list)
|
|
7
|
+
User.any_instance.stub(:unsubscribe_from_newsletter_list)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
context "when user want to receive a newsletter" do
|
|
11
|
+
let(:user) { build(:user, newsletter: true) }
|
|
12
|
+
|
|
13
|
+
before do
|
|
14
|
+
user.should_receive(:subscribe_to_newsletter_list)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it { user.save }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context "when user want to receive a newsletter but he changed they email" do
|
|
21
|
+
let(:user) { create(:user, newsletter: true, email: 'foo@bar.com') }
|
|
22
|
+
|
|
23
|
+
before do
|
|
24
|
+
user.should_receive(:subscribe_to_newsletter_list)
|
|
25
|
+
user.should_receive(:unsubscribe_from_newsletter_list).with('foo@bar.com')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it { user.update_attributes(email: 'new@email.com') }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
context "when user is a new account and don't want to receive newsletter" do
|
|
32
|
+
let(:user) { build(:user, newsletter: false) }
|
|
33
|
+
|
|
34
|
+
before do
|
|
35
|
+
user.should_not_receive(:subscribe_to_newsletter_list)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it { user.save }
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
context "when user want to not receive newsletter anymore" do
|
|
42
|
+
let(:user) { create(:user, newsletter: true, email: 'foo@bar.com') }
|
|
43
|
+
|
|
44
|
+
before do
|
|
45
|
+
user.should_not_receive(:subscribe_to_newsletter_list)
|
|
46
|
+
user.should_receive(:unsubscribe_from_newsletter_list)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it { user.update_attributes(newsletter: false) }
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
3
|
+
require 'coveralls'
|
|
4
|
+
Coveralls.wear!('rails')
|
|
5
|
+
|
|
6
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
|
7
|
+
require 'rspec/rails'
|
|
8
|
+
require 'sidekiq/testing'
|
|
9
|
+
require 'fakeweb'
|
|
10
|
+
require "pundit/rspec"
|
|
11
|
+
|
|
12
|
+
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
|
13
|
+
|
|
14
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
15
|
+
# in spec/support/ and its subdirectories.
|
|
16
|
+
Dir[Rails.root.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f}
|
|
17
|
+
|
|
18
|
+
def fixture_path(basename)
|
|
19
|
+
"spec/fixtures/#{basename}"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Checks for pending migrations before tests are run.
|
|
24
|
+
# If you are not using ActiveRecord, you can remove this line.
|
|
25
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
|
26
|
+
|
|
27
|
+
RSpec.configure do |config|
|
|
28
|
+
config.include FactoryGirl::Syntax::Methods
|
|
29
|
+
config.include ActionView::Helpers::TextHelper
|
|
30
|
+
|
|
31
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
32
|
+
# examples within a transaction, remove the following line or assign false
|
|
33
|
+
# instead of true.
|
|
34
|
+
config.use_transactional_fixtures = false
|
|
35
|
+
|
|
36
|
+
# If true, the base class of anonymous controllers will be inferred
|
|
37
|
+
# automatically. This will be the default behavior in future versions of
|
|
38
|
+
# rspec-rails.
|
|
39
|
+
#config.infer_base_class_for_anonymous_controllers = false
|
|
40
|
+
|
|
41
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
42
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
43
|
+
# the seed, which is printed after each run.
|
|
44
|
+
# --seed 1234
|
|
45
|
+
config.order = "random"
|
|
46
|
+
|
|
47
|
+
config.before(:suite) do
|
|
48
|
+
ActiveRecord::Base.connection.execute "SET client_min_messages TO warning;"
|
|
49
|
+
ActiveRecord::Base.connection.execute "SET timezone TO 'utc';"
|
|
50
|
+
DatabaseCleaner.clean_with :truncation
|
|
51
|
+
I18n.locale = :pt
|
|
52
|
+
I18n.default_locale = :pt
|
|
53
|
+
|
|
54
|
+
FakeWeb.register_uri(:get, "http://vimeo.com/api/v2/video/17298435.json", response: fixture_path('vimeo_default_json_request.txt'))
|
|
55
|
+
FakeWeb.register_uri(:get, "http://vimeo.com/17298435", response: fixture_path('vimeo_default_request.txt'))
|
|
56
|
+
FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=Brw7bzU_t4c", response: fixture_path("youtube_request.txt"))
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
config.before(:each) do
|
|
60
|
+
if example.metadata[:type] == :feature
|
|
61
|
+
DatabaseCleaner.strategy = :truncation
|
|
62
|
+
else
|
|
63
|
+
DatabaseCleaner.strategy = :transaction
|
|
64
|
+
end
|
|
65
|
+
DatabaseCleaner.start
|
|
66
|
+
ActionMailer::Base.deliveries.clear
|
|
67
|
+
RoutingFilter.active = false # Because this issue: https://github.com/svenfuchs/routing-filter/issues/36
|
|
68
|
+
Sidekiq::Testing.fake!
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
config.after(:each) do
|
|
72
|
+
DatabaseCleaner.clean
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
[:controller, :feature].each do |spec_type|
|
|
76
|
+
config.before(:each, type: spec_type) do
|
|
77
|
+
[:detect_old_browsers, :render_facebook_sdk, :render_facebook_like, :render_twitter, :display_uservoice_sso].each do |method|
|
|
78
|
+
ApplicationController.any_instance.stub(method)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Stubs and configuration
|
|
84
|
+
config.before(:each) do
|
|
85
|
+
CatarseMonkeymail::MailchimpApi.stub(:start)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
CatarseMailchimp::API.stub(:subscribe).and_return(true)
|
|
89
|
+
CatarseMailchimp::API.stub(:unsubscribe).and_return(true)
|
|
90
|
+
Project.any_instance.stub(:store_image_url).and_return('http://www.store_image_url.com')
|
|
91
|
+
ProjectObserver.any_instance.stub(:after_create)
|
|
92
|
+
UserObserver.any_instance.stub(:after_create)
|
|
93
|
+
Project.any_instance.stub(:download_video_thumbnail)
|
|
94
|
+
CatarseMailchimp::API.stub(:subscribe)
|
|
95
|
+
CatarseMailchimp::API.stub(:unsubscribe)
|
|
96
|
+
Notification.stub(:notify)
|
|
97
|
+
Notification.stub(:notify_once)
|
|
98
|
+
Calendar.any_instance.stub(:fetch_events_from)
|
|
99
|
+
Blog.stub(:fetch_last_posts).and_return([])
|
|
100
|
+
CatarseSettings[:base_domain] = 'localhost'
|
|
101
|
+
CatarseSettings[:email_contact] = 'foo@bar.com'
|
|
102
|
+
CatarseSettings[:company_name] = 'Foo Bar Company'
|
|
103
|
+
Contribution.any_instance.stub(:payment_engine).and_return(PaymentEngines::Interface.new)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
metadata
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: catarse_monkeymail
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Antônio Roberto Silva
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 4.0.3
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 4.0.3
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: mailchimp-api
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 2.0.4
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 2.0.4
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: sqlite3
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
description: A new catarse integration with mailchimp
|
|
56
|
+
email:
|
|
57
|
+
- ton@catarse.me
|
|
58
|
+
executables:
|
|
59
|
+
- rails
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- ".gitignore"
|
|
64
|
+
- ".gitmodules"
|
|
65
|
+
- Gemfile
|
|
66
|
+
- Gemfile.lock
|
|
67
|
+
- MIT-LICENSE
|
|
68
|
+
- README.md
|
|
69
|
+
- Rakefile
|
|
70
|
+
- app/controllers/catarse_monkeymail/application_controller.rb
|
|
71
|
+
- app/controllers/catarse_monkeymail/controller_concerns.rb
|
|
72
|
+
- app/models/catarse_monkeymail/mailchimp_api.rb
|
|
73
|
+
- app/models/catarse_monkeymail/project_concern.rb
|
|
74
|
+
- app/models/catarse_monkeymail/user_concern.rb
|
|
75
|
+
- app/observers/catarse_monkeymail/monkey_project_observer.rb
|
|
76
|
+
- bin/rails
|
|
77
|
+
- catarse_monkeymail.gemspec
|
|
78
|
+
- config/routes.rb
|
|
79
|
+
- lib/catarse_monkeymail.rb
|
|
80
|
+
- lib/catarse_monkeymail/engine.rb
|
|
81
|
+
- lib/catarse_monkeymail/version.rb
|
|
82
|
+
- lib/tasks/catarse_monkeymail_tasks.rake
|
|
83
|
+
- spec/models/catarse_monkeymail/project_spec.rb
|
|
84
|
+
- spec/models/catarse_monkeymail/user_spec.rb
|
|
85
|
+
- spec/spec_helper.rb
|
|
86
|
+
homepage: http://catarse.me
|
|
87
|
+
licenses: []
|
|
88
|
+
metadata: {}
|
|
89
|
+
post_install_message:
|
|
90
|
+
rdoc_options: []
|
|
91
|
+
require_paths:
|
|
92
|
+
- lib
|
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - ">="
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '0'
|
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
requirements: []
|
|
104
|
+
rubyforge_project:
|
|
105
|
+
rubygems_version: 2.2.0
|
|
106
|
+
signing_key:
|
|
107
|
+
specification_version: 4
|
|
108
|
+
summary: Integration with the best newsletter services <3
|
|
109
|
+
test_files:
|
|
110
|
+
- spec/models/catarse_monkeymail/project_spec.rb
|
|
111
|
+
- spec/models/catarse_monkeymail/user_spec.rb
|
|
112
|
+
- spec/spec_helper.rb
|