maily 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +23 -2
- data/Appraisals +15 -0
- data/MIT-LICENSE +1 -1
- data/README.md +3 -3
- data/app/views/maily/emails/show.html.erb +1 -0
- data/gemfiles/rails_3.2.gemfile +7 -0
- data/gemfiles/rails_4.1.gemfile +7 -0
- data/gemfiles/rails_4.2.gemfile +7 -0
- data/gemfiles/rails_5.0.gemfile +7 -0
- data/lib/maily.rb +2 -2
- data/lib/maily/email.rb +7 -3
- data/lib/maily/engine.rb +1 -1
- data/lib/maily/mailer.rb +1 -1
- data/lib/maily/version.rb +1 -1
- data/maily.gemspec +5 -6
- data/spec/spec_helper.rb +0 -4
- metadata +52 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4eec9f6ff7965b84fade274481f733f6f943e24c
|
4
|
+
data.tar.gz: f94b2820645289fb453cdd84924bff70a1db1eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4271c5cd492c9c6c030f89a0014d3e4257b5d4b5821098863a34e0cb38f619aff346a55831c9e8eb73fb6e2970b9fe889d517fed0d2128324450a035e3824606
|
7
|
+
data.tar.gz: 25625b8e6558ae187158fe431572aad65b6ac11b5fcafc237f95280770a19bbd321ed3029e1f72f6ca36852932af36cb4504995c2965645824561d44128f39d3
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
3
|
+
cache: bundler
|
4
|
+
|
5
|
+
sudo: false
|
6
|
+
|
2
7
|
rvm:
|
8
|
+
- 2.4.0
|
9
|
+
- 2.3.3
|
10
|
+
- 2.2.6
|
3
11
|
- 2.1
|
4
|
-
|
5
|
-
|
12
|
+
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/rails_5.0.gemfile
|
15
|
+
- gemfiles/rails_4.2.gemfile
|
16
|
+
- gemfiles/rails_4.1.gemfile
|
17
|
+
- gemfiles/rails_3.2.gemfile
|
18
|
+
|
19
|
+
matrix:
|
20
|
+
exclude:
|
21
|
+
- rvm: 2.1
|
22
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
23
|
+
- rvm: 2.4.0
|
24
|
+
gemfile: gemfiles/rails_4.1.gemfile
|
25
|
+
- rvm: 2.4.0
|
26
|
+
gemfile: gemfiles/rails_3.2.gemfile
|
data/Appraisals
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
appraise "rails-5.0" do
|
2
|
+
gem "rails", "~> 5.0.0"
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "rails-4.2" do
|
6
|
+
gem "rails", github: 'rails/rails', branch: '4-2-stable'
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails-4.1" do
|
10
|
+
gem "rails", "~> 4.1.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-3.2" do
|
14
|
+
gem "rails", "~> 3.2.0"
|
15
|
+
end
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Run generator:
|
|
34
34
|
rails g maily:install
|
35
35
|
```
|
36
36
|
|
37
|
-
This
|
37
|
+
This generator runs some tasks for you:
|
38
38
|
|
39
39
|
* Mounts the engine (to `/maily` by default) in your routes
|
40
40
|
* Adds an initializer (into `config/initializers/maily.rb`) to customize some settings
|
@@ -83,7 +83,7 @@ So, templates edition is not allowed running `production` mode.
|
|
83
83
|
|
84
84
|
## Hooks
|
85
85
|
|
86
|
-
Most of emails need to populate data to consume it and do
|
86
|
+
Most of emails need to populate data to consume it and do interesting things. Hooks are used to define this data with a little DSL. Example:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
# lib/maily_hooks.rb
|
@@ -151,4 +151,4 @@ Alternatively, there are some other plugins to get a similar functionality with
|
|
151
151
|
|
152
152
|
## License
|
153
153
|
|
154
|
-
Copyright (c)
|
154
|
+
Copyright (c) Marc Anguera. Maily is released under the [MIT](MIT-LICENSE) License.
|
@@ -49,6 +49,7 @@
|
|
49
49
|
<% if @email.html_part || @email.text_part || @email.body.present? %>
|
50
50
|
<iframe class="maily_preview" onload='javascript:resizeIframe(this);' src="<%= raw_maily_email_path(mailer: params[:mailer], email: params[:email], locale: params[:locale], part: params[:part]) %>" frameborder="1" width="100%"></iframe>
|
51
51
|
<% end %>
|
52
|
+
|
52
53
|
<% if @email.attachments.present? %>
|
53
54
|
<ul class="maily_mail_attachments">
|
54
55
|
<li>Attachments:</li>
|
data/lib/maily.rb
CHANGED
@@ -27,7 +27,7 @@ module Maily
|
|
27
27
|
|
28
28
|
# Load hooks
|
29
29
|
hooks_file_path = "#{Rails.root}/lib/maily_hooks.rb"
|
30
|
-
require hooks_file_path if File.
|
30
|
+
require hooks_file_path if File.exist?(hooks_file_path)
|
31
31
|
end
|
32
32
|
|
33
33
|
def hooks_for(mailer_name)
|
@@ -51,4 +51,4 @@ module Maily
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|
data/lib/maily/email.rb
CHANGED
@@ -9,12 +9,16 @@ module Maily
|
|
9
9
|
self.template_path = mailer
|
10
10
|
end
|
11
11
|
|
12
|
+
def parameters
|
13
|
+
mailer_klass.instance_method(name).parameters
|
14
|
+
end
|
15
|
+
|
12
16
|
def require_hook?
|
13
|
-
|
17
|
+
parameters.any?
|
14
18
|
end
|
15
19
|
|
16
20
|
def required_arguments
|
17
|
-
|
21
|
+
parameters.map(&:last)
|
18
22
|
end
|
19
23
|
|
20
24
|
def register_hook(*args)
|
@@ -66,4 +70,4 @@ module Maily
|
|
66
70
|
end
|
67
71
|
end
|
68
72
|
end
|
69
|
-
end
|
73
|
+
end
|
data/lib/maily/engine.rb
CHANGED
data/lib/maily/mailer.rb
CHANGED
data/lib/maily/version.rb
CHANGED
data/maily.gemspec
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
|
1
|
+
require "./lib/maily/version"
|
2
2
|
|
3
|
-
# Maintain your gem's version:
|
4
|
-
require "maily/version"
|
5
|
-
|
6
|
-
# Describe your gem and declare its dependencies:
|
7
3
|
Gem::Specification.new do |s|
|
8
4
|
s.name = "maily"
|
9
5
|
s.version = Maily::VERSION
|
@@ -21,5 +17,8 @@ Gem::Specification.new do |s|
|
|
21
17
|
|
22
18
|
s.add_dependency "rails", ">= 3.0.0"
|
23
19
|
|
24
|
-
s.add_development_dependency "rspec-rails"
|
20
|
+
s.add_development_dependency "rspec-rails"
|
21
|
+
s.add_development_dependency "appraisal"
|
22
|
+
s.add_development_dependency 'test-unit', '~> 3.0'
|
23
|
+
s.add_development_dependency "byebug" if RUBY_VERSION.to_i >= 2
|
25
24
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -26,18 +26,60 @@ dependencies:
|
|
26
26
|
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0
|
61
|
+
version: '3.0'
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
41
83
|
description: Rails Engine to preview, follow up, test and edit the emails of your
|
42
84
|
applications in the browser
|
43
85
|
email:
|
@@ -48,6 +90,7 @@ extra_rdoc_files: []
|
|
48
90
|
files:
|
49
91
|
- ".gitignore"
|
50
92
|
- ".travis.yml"
|
93
|
+
- Appraisals
|
51
94
|
- Gemfile
|
52
95
|
- MIT-LICENSE
|
53
96
|
- README.md
|
@@ -75,6 +118,10 @@ files:
|
|
75
118
|
- app/views/maily/shared/_header.html.erb
|
76
119
|
- app/views/maily/shared/_sidebar.html.erb
|
77
120
|
- config/routes.rb
|
121
|
+
- gemfiles/rails_3.2.gemfile
|
122
|
+
- gemfiles/rails_4.1.gemfile
|
123
|
+
- gemfiles/rails_4.2.gemfile
|
124
|
+
- gemfiles/rails_5.0.gemfile
|
78
125
|
- lib/generators/maily/install_generator.rb
|
79
126
|
- lib/generators/templates/initializer.rb
|
80
127
|
- lib/maily.rb
|
@@ -152,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
199
|
version: '0'
|
153
200
|
requirements: []
|
154
201
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.5.1
|
156
203
|
signing_key:
|
157
204
|
specification_version: 4
|
158
205
|
summary: Rails Engine to preview emails in the browser.
|