mail_form 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +2 -2
- data/lib/mail_form/delivery.rb +6 -1
- data/lib/mail_form/version.rb +1 -1
- data/test/mail_form_test.rb +2 -2
- data/test/test_helper.rb +15 -6
- metadata +16 -16
- data/CHANGELOG +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b8f5c9787d2e3df7e77a9eb5741997396b118a
|
4
|
+
data.tar.gz: ec07e70aeae2a978f4df65336d68873ea06fc3de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa386fe08ebd407daa8a9cd2aa764e937074dd5b163a7878e802a86596510db83c4cc1d031da7299d146644a533295121cee1c0481ba6a857fcc465703d6feb4
|
7
|
+
data.tar.gz: 6ffdc31919b30fcd63d5b14163a4e614d24da438114cb7912d5782e0e0f617e0f6db4a064426848086daa241fe8abcabdd0b6ebf2e3ac3ec86e6174e4086edf5
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2009-
|
1
|
+
Copyright (c) 2009-2015 Plataformatec http://plataformatec.com.br/
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -53,7 +53,7 @@ you configured your mailer delivery method properly).
|
|
53
53
|
When you inherit from `MailForm::Base`, it pulls down a set of stuff from `ActiveModel`,
|
54
54
|
as `ActiveModel::Validation`, `ActiveModel::Translation` and `ActiveModel::Naming`.
|
55
55
|
|
56
|
-
This
|
56
|
+
This brings `I18n`, error messages, validations and attributes handling like in
|
57
57
|
`ActiveRecord` to **MailForm**, so **MailForm** can be used in your controllers and form builders without extra tweaks. This also means that instead of the following:
|
58
58
|
|
59
59
|
```ruby
|
@@ -224,4 +224,4 @@ Take a look at lib/mail_form/views/mail_form/contact.erb in this repo to see how
|
|
224
224
|
|
225
225
|
If you discover any bug, please use github issues tracker.
|
226
226
|
|
227
|
-
Copyright (c) 2009-
|
227
|
+
Copyright (c) 2009-2015 Plataformatec http://plataformatec.com.br/
|
data/lib/mail_form/delivery.rb
CHANGED
@@ -148,7 +148,12 @@ module MailForm
|
|
148
148
|
|
149
149
|
# Deliver the resource without running any validation.
|
150
150
|
def deliver!
|
151
|
-
MailForm::Notifier.contact(self)
|
151
|
+
mailer = MailForm::Notifier.contact(self)
|
152
|
+
if mailer.respond_to?(:deliver_now)
|
153
|
+
mailer.deliver_now
|
154
|
+
else
|
155
|
+
mailer.deliver
|
156
|
+
end
|
152
157
|
end
|
153
158
|
|
154
159
|
# Returns a hash of attributes, according to the attributes existent in
|
data/lib/mail_form/version.rb
CHANGED
data/test/mail_form_test.rb
CHANGED
@@ -103,12 +103,12 @@ class MailFormNotifierTest < ActiveSupport::TestCase
|
|
103
103
|
assert_match %r[Rails Testing], last_delivery.body.to_s
|
104
104
|
end
|
105
105
|
|
106
|
-
def
|
106
|
+
def test_request_info_hashes_are_print_inside_lists
|
107
107
|
@request.session = { :my => :session, :user => "data" }
|
108
108
|
@advanced.deliver
|
109
109
|
assert_match %r[<ul], last_delivery.body.to_s
|
110
110
|
assert_match %r[<li>my: :session<\/li>], last_delivery.body.to_s
|
111
|
-
assert_match %r[<li>user:
|
111
|
+
assert_match %r[<li>user: \S+data\S+<\/li>], last_delivery.body.to_s
|
112
112
|
end
|
113
113
|
|
114
114
|
def test_error_is_raised_when_append_is_given_but_no_request_is_given
|
data/test/test_helper.rb
CHANGED
@@ -1,20 +1,29 @@
|
|
1
|
-
|
2
|
-
require 'test/unit'
|
3
|
-
rescue LoadError
|
4
|
-
end
|
1
|
+
require 'minitest/autorun'
|
5
2
|
|
6
3
|
RAILS_ENV = ENV["RAILS_ENV"] = "test"
|
7
4
|
|
5
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
6
|
+
require 'mail_form'
|
7
|
+
|
8
8
|
require 'active_support'
|
9
9
|
require 'active_support/test_case'
|
10
|
+
require 'active_support/string_inquirer'
|
10
11
|
require 'action_controller'
|
11
12
|
require 'action_controller/test_case'
|
12
13
|
require 'action_mailer'
|
13
14
|
|
15
|
+
if ActiveSupport::TestCase.respond_to?(:test_order=)
|
16
|
+
ActiveSupport::TestCase.test_order = :random
|
17
|
+
end
|
18
|
+
|
14
19
|
ActionMailer::Base.delivery_method = :test
|
20
|
+
I18n.enforce_available_locales = false
|
15
21
|
|
16
|
-
|
17
|
-
|
22
|
+
module Rails
|
23
|
+
def self.env
|
24
|
+
@env ||= ActiveSupport::StringInquirer.new('test')
|
25
|
+
end
|
26
|
+
end
|
18
27
|
|
19
28
|
class ContactForm < MailForm::Base
|
20
29
|
attribute :name, :validate => true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
@@ -9,46 +9,46 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-04-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionmailer
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '3.2'
|
21
|
-
- - <
|
21
|
+
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '5'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- -
|
28
|
+
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '3.2'
|
31
|
-
- - <
|
31
|
+
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '5'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activemodel
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.2'
|
41
|
-
- - <
|
41
|
+
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '5'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '3.2'
|
51
|
-
- - <
|
51
|
+
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '5'
|
54
54
|
description: Send e-mail straight from forms in Rails with I18n, validations, attachments
|
@@ -58,25 +58,25 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
-
- CHANGELOG
|
62
61
|
- MIT-LICENSE
|
63
62
|
- README.md
|
64
63
|
- lib/generators/rails/mail_form_generator.rb
|
65
64
|
- lib/generators/rails/templates/model.rb
|
65
|
+
- lib/mail_form.rb
|
66
66
|
- lib/mail_form/base.rb
|
67
67
|
- lib/mail_form/delivery.rb
|
68
68
|
- lib/mail_form/notifier.rb
|
69
69
|
- lib/mail_form/shim.rb
|
70
70
|
- lib/mail_form/version.rb
|
71
71
|
- lib/mail_form/views/mail_form/contact.erb
|
72
|
-
- lib/mail_form.rb
|
73
72
|
- test/mail_form_test.rb
|
74
73
|
- test/resource_test.rb
|
75
74
|
- test/test_file.txt
|
76
75
|
- test/test_helper.rb
|
77
76
|
- test/views/mail_form/custom_template.erb
|
78
77
|
homepage: https://github.com/plataformatec/mail_form
|
79
|
-
licenses:
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
80
|
metadata: {}
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options: []
|
@@ -84,17 +84,17 @@ require_paths:
|
|
84
84
|
- lib
|
85
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- -
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project: mail_form
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.4.5
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Send e-mail straight from forms in Rails with I18n, validations, attachments
|
data/CHANGELOG
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# Version 1.5.0
|
2
|
-
|
3
|
-
* Support Rails 4.
|
4
|
-
* Drop support to Rails < 3.2 and Ruby 1.8.
|
5
|
-
|
6
|
-
# Version 1.4
|
7
|
-
|
8
|
-
* Fixed bug that was causing all activerecord attributes be saved as nil
|
9
|
-
* Avoid symbol injection on forms
|
10
|
-
|
11
|
-
# Version 1.3
|
12
|
-
|
13
|
-
* Removed deprecated methods in version 1.2
|
14
|
-
* Added persisted? header and a generator
|
15
|
-
|
16
|
-
# Version 1.2
|
17
|
-
|
18
|
-
* No more class attributes, just define a headers method
|
19
|
-
|
20
|
-
# Version 1.1
|
21
|
-
|
22
|
-
* Rails 3 compatibility
|
23
|
-
|
24
|
-
# Version 1.0
|
25
|
-
|
26
|
-
* Rename to mail_form and launch Rails 2.3 branch
|
27
|
-
|
28
|
-
# Version 0.4
|
29
|
-
|
30
|
-
* Added support to template
|
31
|
-
|
32
|
-
# Version 0.3
|
33
|
-
|
34
|
-
* Added support to symbols on :sender, :subject and :recipients
|
35
|
-
* Added support to symbols on :validate
|
36
|
-
|
37
|
-
# Version 0.2
|
38
|
-
|
39
|
-
* Added support to request objects and append DSL
|
40
|
-
* Added support to :attachments (thanks to @andrewtimberlake)
|
41
|
-
|
42
|
-
# Version 0.1
|
43
|
-
|
44
|
-
* First release
|