mallet 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rvmrc +1 -1
- data/Gemfile +2 -4
- data/Gemfile.lock +5 -8
- data/lib/generators/active_record/templates/migration.rb +0 -16
- data/lib/mallet.rb +0 -1
- data/lib/mallet/mail.rb +0 -8
- data/lib/mallet/version.rb +1 -1
- data/mallet.gemspec +0 -1
- metadata +20 -54
- data/spec/README +0 -0
- data/spec/internal/config/database.yml +0 -3
- data/spec/internal/config/database.yml.sample +0 -3
- data/spec/internal/config/routes.rb +0 -3
- data/spec/internal/db/mallet_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +0 -35
- data/spec/internal/log/.gitignore +0 -1
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/lib/mallet/mail_spec.rb +0 -101
- data/spec/spec_helper.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbbc94de710c39031154385d6c93856ebae55bbb
|
4
|
+
data.tar.gz: bbc00fa3852f38b3ca0868d65e3bdac2ec1449e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6447dd374d7820ab52e7c34315029787fb865d7a3a042d92cad67ba987f5449ee3356677dc9c83a1ef80d38e0af35384a79b30ce7548da81cb8c4a61e57292b6
|
7
|
+
data.tar.gz: 50fd75a9c9085c5b75acce8605a4e64f3889f0495adcc83d2d7935425527e10dfccf05a8c82eea89cc7e9dd5e7d91491ae5f39525dbc8bc7a1702e5edc80e9be
|
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 1.
|
1
|
+
rvm use 2.1.2@mallet --create
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mallet (0.1.
|
4
|
+
mallet (0.1.7)
|
5
5
|
actionmailer
|
6
6
|
activerecord
|
7
7
|
activesupport
|
8
|
-
delayed_job_active_record
|
9
8
|
i18n
|
10
9
|
workflow
|
11
10
|
|
@@ -45,11 +44,6 @@ GEM
|
|
45
44
|
rails (>= 3.0.0)
|
46
45
|
thor (>= 0.14.6)
|
47
46
|
database_cleaner (0.9.1)
|
48
|
-
delayed_job (4.0.2)
|
49
|
-
activesupport (>= 3.0, < 4.2)
|
50
|
-
delayed_job_active_record (4.0.1)
|
51
|
-
activerecord (>= 3.0, < 4.2)
|
52
|
-
delayed_job (>= 3.0, < 4.1)
|
53
47
|
diff-lcs (1.2.1)
|
54
48
|
erubis (2.7.0)
|
55
49
|
hike (1.2.1)
|
@@ -115,7 +109,7 @@ GEM
|
|
115
109
|
polyglot
|
116
110
|
polyglot (>= 0.3.1)
|
117
111
|
tzinfo (0.3.37)
|
118
|
-
workflow (1.
|
112
|
+
workflow (1.2.0)
|
119
113
|
|
120
114
|
PLATFORMS
|
121
115
|
ruby
|
@@ -127,3 +121,6 @@ DEPENDENCIES
|
|
127
121
|
rspec
|
128
122
|
rspec-rails
|
129
123
|
sqlite3
|
124
|
+
|
125
|
+
BUNDLED WITH
|
126
|
+
1.10.3
|
@@ -16,22 +16,6 @@ class CreateMalletTables < ActiveRecord::Migration
|
|
16
16
|
add_index "mallet_mails", ["definition"], :name => "index_mallet_mails_on_definition"
|
17
17
|
add_index "mallet_mails", ["malletable_type", "malletable_id"], :name => "index_mallet_mails_on_malletable_type_and_malletable_id"
|
18
18
|
add_index "mallet_mails", ["send_date"], :name => "index_mallet_mails_on_send_date"
|
19
|
-
|
20
|
-
create_table "delayed_jobs", :force => true do |t|
|
21
|
-
t.integer "priority", :default => 0
|
22
|
-
t.integer "attempts", :default => 0
|
23
|
-
t.text "handler"
|
24
|
-
t.text "last_error"
|
25
|
-
t.datetime "run_at"
|
26
|
-
t.datetime "locked_at"
|
27
|
-
t.datetime "failed_at"
|
28
|
-
t.string "locked_by"
|
29
|
-
t.string "queue"
|
30
|
-
t.datetime "created_at", :null => false
|
31
|
-
t.datetime "updated_at", :null => false
|
32
|
-
end
|
33
|
-
|
34
|
-
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
35
19
|
|
36
20
|
end
|
37
21
|
|
data/lib/mallet.rb
CHANGED
data/lib/mallet/mail.rb
CHANGED
data/lib/mallet/version.rb
CHANGED
data/mallet.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mallet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Douglas Anderson
|
@@ -9,107 +9,93 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activerecord
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: actionmailer
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: i18n
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: workflow
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: delayed_job_active_record
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ! '>='
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
91
|
-
type: :runtime
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ! '>='
|
81
|
+
- - ">="
|
96
82
|
- !ruby/object:Gem::Version
|
97
83
|
version: '0'
|
98
84
|
- !ruby/object:Gem::Dependency
|
99
85
|
name: combustion
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
101
87
|
requirements:
|
102
|
-
- -
|
88
|
+
- - ">="
|
103
89
|
- !ruby/object:Gem::Version
|
104
90
|
version: '0'
|
105
91
|
type: :development
|
106
92
|
prerelease: false
|
107
93
|
version_requirements: !ruby/object:Gem::Requirement
|
108
94
|
requirements:
|
109
|
-
- -
|
95
|
+
- - ">="
|
110
96
|
- !ruby/object:Gem::Version
|
111
97
|
version: '0'
|
112
|
-
description:
|
98
|
+
description: " Send and track mails asynchronously. "
|
113
99
|
email:
|
114
100
|
- i.am.douglas.anderson@gmail.com
|
115
101
|
- tjegels@gmail.com
|
@@ -117,7 +103,7 @@ executables: []
|
|
117
103
|
extensions: []
|
118
104
|
extra_rdoc_files: []
|
119
105
|
files:
|
120
|
-
- .rvmrc
|
106
|
+
- ".rvmrc"
|
121
107
|
- Gemfile
|
122
108
|
- Gemfile.lock
|
123
109
|
- README.md
|
@@ -131,16 +117,6 @@ files:
|
|
131
117
|
- lib/mallet/mail_generation.rb
|
132
118
|
- lib/mallet/version.rb
|
133
119
|
- mallet.gemspec
|
134
|
-
- spec/README
|
135
|
-
- spec/internal/config/database.yml
|
136
|
-
- spec/internal/config/database.yml.sample
|
137
|
-
- spec/internal/config/routes.rb
|
138
|
-
- spec/internal/db/mallet_test.sqlite
|
139
|
-
- spec/internal/db/schema.rb
|
140
|
-
- spec/internal/log/.gitignore
|
141
|
-
- spec/internal/public/favicon.ico
|
142
|
-
- spec/lib/mallet/mail_spec.rb
|
143
|
-
- spec/spec_helper.rb
|
144
120
|
homepage: ''
|
145
121
|
licenses: []
|
146
122
|
metadata: {}
|
@@ -150,28 +126,18 @@ require_paths:
|
|
150
126
|
- lib
|
151
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
128
|
requirements:
|
153
|
-
- -
|
129
|
+
- - ">="
|
154
130
|
- !ruby/object:Gem::Version
|
155
131
|
version: '0'
|
156
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
133
|
requirements:
|
158
|
-
- -
|
134
|
+
- - ">="
|
159
135
|
- !ruby/object:Gem::Version
|
160
136
|
version: '0'
|
161
137
|
requirements: []
|
162
138
|
rubyforge_project: mallet
|
163
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.2.2
|
164
140
|
signing_key:
|
165
141
|
specification_version: 4
|
166
142
|
summary: A mail gem.
|
167
|
-
test_files:
|
168
|
-
- spec/README
|
169
|
-
- spec/internal/config/database.yml
|
170
|
-
- spec/internal/config/database.yml.sample
|
171
|
-
- spec/internal/config/routes.rb
|
172
|
-
- spec/internal/db/mallet_test.sqlite
|
173
|
-
- spec/internal/db/schema.rb
|
174
|
-
- spec/internal/log/.gitignore
|
175
|
-
- spec/internal/public/favicon.ico
|
176
|
-
- spec/lib/mallet/mail_spec.rb
|
177
|
-
- spec/spec_helper.rb
|
143
|
+
test_files: []
|
data/spec/README
DELETED
File without changes
|
Binary file
|
data/spec/internal/db/schema.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
ActiveRecord::Schema.define do
|
2
|
-
|
3
|
-
create_table "mallet_mails", :force => true do |t|
|
4
|
-
t.string "definition"
|
5
|
-
t.string "malletable_type"
|
6
|
-
t.string "malletable_id"
|
7
|
-
t.string "workflow_state"
|
8
|
-
t.string "message_id"
|
9
|
-
t.text "data"
|
10
|
-
t.float "wait_time"
|
11
|
-
t.date "send_date"
|
12
|
-
t.timestamps
|
13
|
-
end
|
14
|
-
|
15
|
-
add_index "mallet_mails", ["definition"], :name => "index_mallet_mails_on_definition"
|
16
|
-
add_index "mallet_mails", ["malletable_type", "malletable_id"], :name => "index_mallet_mails_on_malletable_type_and_malletable_id"
|
17
|
-
add_index "mallet_mails", ["send_date"], :name => "index_mallet_mails_on_send_date"
|
18
|
-
|
19
|
-
create_table "delayed_jobs", :force => true do |t|
|
20
|
-
t.integer "priority", :default => 0
|
21
|
-
t.integer "attempts", :default => 0
|
22
|
-
t.text "handler"
|
23
|
-
t.text "last_error"
|
24
|
-
t.datetime "run_at"
|
25
|
-
t.datetime "locked_at"
|
26
|
-
t.datetime "failed_at"
|
27
|
-
t.string "locked_by"
|
28
|
-
t.string "queue"
|
29
|
-
t.datetime "created_at", :null => false
|
30
|
-
t.datetime "updated_at", :null => false
|
31
|
-
end
|
32
|
-
|
33
|
-
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
34
|
-
|
35
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
*.log
|
File without changes
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Mallet::Mail do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
@job = Delayed::Job.create!
|
7
|
-
|
8
|
-
Mallet::DEFINITIONS['welcome'] = {
|
9
|
-
'mailer' => 'ActionMailer::Base',
|
10
|
-
'method' => 'welcome'
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
context "on creation" do
|
15
|
-
|
16
|
-
before(:each) do
|
17
|
-
@mail = Mallet::mail(for: @job, definition: 'welcome')
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should default to a pending state" do
|
21
|
-
@mail.should be_pending
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should record the malletable class" do
|
25
|
-
@mail.malletable.should == @job
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
context "on delivery" do
|
31
|
-
|
32
|
-
before(:each) do
|
33
|
-
@mail = Mallet::mail(for: @job, definition: 'welcome')
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should mark the mail as sent" do
|
37
|
-
@mail.deliver!
|
38
|
-
@mail.should be_sent
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
context "hooks" do
|
44
|
-
|
45
|
-
it "should call a hook on creation" do
|
46
|
-
Mallet::Hooks.should_receive(:on_create).once
|
47
|
-
|
48
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should call a hook when delivering" do
|
52
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
53
|
-
Mallet::Hooks.should_receive(:on_deliver).with(mail).once
|
54
|
-
mail.deliver!
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should call a hook on error" do
|
58
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
59
|
-
Mallet::Hooks.should_receive(:on_error).with(mail).once
|
60
|
-
mail.error!
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should call a hook when delivered successfully" do
|
64
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
65
|
-
mail.update_column(:workflow_state, 'sent')
|
66
|
-
Mallet::Hooks.should_receive(:on_success).with(mail).once
|
67
|
-
mail.success!
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should call a hook when bounced" do
|
71
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
72
|
-
mail.update_column(:workflow_state, 'sent')
|
73
|
-
Mallet::Hooks.should_receive(:on_bounce).with(mail).once
|
74
|
-
mail.bounce!
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
context "filtering mails" do
|
80
|
-
|
81
|
-
it "should filter by pending" do
|
82
|
-
expect { Mallet::mail(for: @job, definition: 'welcome') }.to change{ Mallet::Mail.with_pending_state.count }.by(1)
|
83
|
-
end
|
84
|
-
|
85
|
-
it "should filter by sent" do
|
86
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
87
|
-
expect {mail.deliver!}.to change{ Mallet::Mail.with_sent_state.count }.by(1)
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should filter by failed" do
|
91
|
-
mail = Mallet::mail(for: @job, definition: 'welcome')
|
92
|
-
expect {mail.error!}.to change{ Mallet::Mail.with_failed_state.count }.by(1)
|
93
|
-
end
|
94
|
-
|
95
|
-
it "should filter by malletable item" do
|
96
|
-
expect{ Mallet::mail(for: @job, definition: 'welcome') }.to change{ Mallet::Mail.for(@job).count }.by(1)
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'rubygems'
|
3
|
-
require 'bundler'
|
4
|
-
|
5
|
-
Bundler.require :default, :development
|
6
|
-
|
7
|
-
Combustion.initialize! :active_record
|
8
|
-
|
9
|
-
require 'rspec/rails'
|
10
|
-
|
11
|
-
RSpec.configure do |config|
|
12
|
-
config.use_transactional_fixtures = true
|
13
|
-
config.color_enabled = true
|
14
|
-
config.formatter = :documentation # :progress, :html, :textmate
|
15
|
-
#config.include FactoryGirl::Syntax::Methods
|
16
|
-
|
17
|
-
# config.before(:suite) do
|
18
|
-
# DatabaseCleaner.strategy = :transaction
|
19
|
-
# DatabaseCleaner.clean_with(:truncation)
|
20
|
-
# end
|
21
|
-
|
22
|
-
# config.before(:each) do
|
23
|
-
# DatabaseCleaner.start
|
24
|
-
# end
|
25
|
-
|
26
|
-
# config.after(:each) do
|
27
|
-
# DatabaseCleaner.clean
|
28
|
-
# end
|
29
|
-
end
|
30
|
-
|
31
|
-
#FactoryGirl.find_definitions
|