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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20a22a894d34fabb23ea057f9e9afc63c9f77c7d
4
- data.tar.gz: 6512395df890e8a236f40ba7cc25cb21995824cc
3
+ metadata.gz: dbbc94de710c39031154385d6c93856ebae55bbb
4
+ data.tar.gz: bbc00fa3852f38b3ca0868d65e3bdac2ec1449e9
5
5
  SHA512:
6
- metadata.gz: 03f2eff8d3ff75351c02f3df1e712cb9046182b009dd4a6408c3dd4a5d9e439c58c6603495adaa100dcd2b31e04d4a9594de225dfcdc5c9594ee4bdcea8d481e
7
- data.tar.gz: 9df4378a0384dd88febcaa1f04e6a4e2f4a61c093f3190e4fd302a516e469a0b1d98d652df02a19470552f846f1d39ac337c98e5d7ab37dd7e7750eabc9b33d4
6
+ metadata.gz: 6447dd374d7820ab52e7c34315029787fb865d7a3a042d92cad67ba987f5449ee3356677dc9c83a1ef80d38e0af35384a79b30ce7548da81cb8c4a61e57292b6
7
+ data.tar.gz: 50fd75a9c9085c5b75acce8605a4e64f3889f0495adcc83d2d7935425527e10dfccf05a8c82eea89cc7e9dd5e7d91491ae5f39525dbc8bc7a1702e5edc80e9be
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 1.9.2@mallet --create
1
+ rvm use 2.1.2@mallet --create
data/Gemfile CHANGED
@@ -7,9 +7,7 @@ group :development do
7
7
  gem 'rspec'
8
8
  gem 'rspec-rails'
9
9
  gem 'sqlite3'
10
- gem 'database_cleaner', '>= 0.9.1'
11
10
  end
12
11
 
13
- group :test do
14
- gem 'database_cleaner', '>= 0.9.1'
15
- end
12
+ gem 'database_cleaner', '>= 0.9.1', group: [:development, :test]
13
+
@@ -1,11 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mallet (0.1.6)
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.1.0)
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
 
@@ -1,7 +1,6 @@
1
1
  require "active_record"
2
2
  require "action_mailer"
3
3
  require "workflow"
4
- require "delayed_job_active_record"
5
4
  require "mallet/version"
6
5
 
7
6
  module Mallet
@@ -69,14 +69,6 @@ module Mallet
69
69
  Hooks.on_success(self)
70
70
  end
71
71
 
72
- def delayed_delivery
73
- delay(queue: 'mallet_mails').deliver!
74
- end
75
-
76
- def self.deliver_all!
77
- with_pending_state.each(&:delayed_delivery)
78
- end
79
-
80
72
  end
81
73
 
82
74
  end
@@ -1,3 +1,3 @@
1
1
  module Mallet
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "actionmailer"
24
24
  s.add_dependency "i18n"
25
25
  s.add_dependency "workflow"
26
- s.add_dependency "delayed_job_active_record"
27
26
 
28
27
  s.add_development_dependency 'combustion'
29
28
  end
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.6
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-04-08 00:00:00.000000000 Z
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: ! ' Send and track mails asynchronously. '
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.4.1
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: []
File without changes
@@ -1,3 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: db/mallet_test.sqlite
@@ -1,3 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: db/mallet_test.sqlite
@@ -1,3 +0,0 @@
1
- Rails.application.routes.draw do
2
- #
3
- end
@@ -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
@@ -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