maily 0.9.0 → 0.9.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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/app/assets/stylesheets/maily/application.scss +5 -0
  4. data/app/controllers/maily/emails_controller.rb +5 -2
  5. data/app/views/maily/emails/index.html.erb +5 -1
  6. data/app/views/maily/emails/show.html.erb +1 -1
  7. data/lib/maily.rb +1 -1
  8. data/lib/maily/version.rb +1 -1
  9. metadata +3 -118
  10. data/.gitignore +0 -7
  11. data/.travis.yml +0 -16
  12. data/Appraisals +0 -15
  13. data/Gemfile +0 -3
  14. data/Rakefile +0 -6
  15. data/gemfiles/rails_4.2.gemfile +0 -7
  16. data/gemfiles/rails_5.0.gemfile +0 -7
  17. data/gemfiles/rails_5.1.gemfile +0 -7
  18. data/gemfiles/rails_5.2.gemfile +0 -7
  19. data/maily.gemspec +0 -24
  20. data/screenshot.png +0 -0
  21. data/spec/controllers_spec.rb +0 -71
  22. data/spec/dummy/README.md +0 -9
  23. data/spec/dummy/Rakefile +0 -6
  24. data/spec/dummy/app/assets/images/.keep +0 -0
  25. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  26. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  27. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  28. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  29. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  30. data/spec/dummy/app/mailers/application_mailer.rb +0 -7
  31. data/spec/dummy/app/mailers/notifier.rb +0 -29
  32. data/spec/dummy/app/models/.keep +0 -0
  33. data/spec/dummy/app/models/concerns/.keep +0 -0
  34. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  35. data/spec/dummy/app/views/notifications/recommendation.html.erb +0 -1
  36. data/spec/dummy/app/views/notifier/generic_welcome.html.erb +0 -1
  37. data/spec/dummy/app/views/notifier/invitation.html.erb +0 -1
  38. data/spec/dummy/app/views/notifier/multipart.html.erb +0 -1
  39. data/spec/dummy/app/views/notifier/multipart.text.erb +0 -1
  40. data/spec/dummy/app/views/notifier/welcome.html.erb +0 -1
  41. data/spec/dummy/app/views/notifier/with_slim_template.html.slim +0 -1
  42. data/spec/dummy/bin/bundle +0 -3
  43. data/spec/dummy/bin/rails +0 -4
  44. data/spec/dummy/bin/rake +0 -4
  45. data/spec/dummy/config.ru +0 -4
  46. data/spec/dummy/config/application.rb +0 -28
  47. data/spec/dummy/config/boot.rb +0 -5
  48. data/spec/dummy/config/environment.rb +0 -5
  49. data/spec/dummy/config/environments/development.rb +0 -29
  50. data/spec/dummy/config/environments/production.rb +0 -80
  51. data/spec/dummy/config/environments/test.rb +0 -36
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  53. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  54. data/spec/dummy/config/initializers/inflections.rb +0 -16
  55. data/spec/dummy/config/initializers/maily.rb +0 -5
  56. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  57. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  58. data/spec/dummy/config/initializers/session_store.rb +0 -3
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  60. data/spec/dummy/config/locales/en.yml +0 -23
  61. data/spec/dummy/config/routes.rb +0 -56
  62. data/spec/dummy/lib/maily_hooks.rb +0 -10
  63. data/spec/dummy/log/.keep +0 -0
  64. data/spec/dummy/public/404.html +0 -58
  65. data/spec/dummy/public/422.html +0 -58
  66. data/spec/dummy/public/500.html +0 -57
  67. data/spec/dummy/public/favicon.ico +0 -0
  68. data/spec/email_spec.rb +0 -95
  69. data/spec/generator_spec.rb +0 -14
  70. data/spec/mailer_spec.rb +0 -41
  71. data/spec/maily_spec.rb +0 -42
  72. data/spec/spec_helper.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d25ed66b110f246b500c8c63d8d7648518d22949cfd76e6664a6c233310d0c6
4
- data.tar.gz: 7c32d79ef886352180368a8a9a9c8163f35f72f7494ecab37f0b53c2a43512aa
3
+ metadata.gz: b5b85962fe83f72a0c67470336abd811a3cf47bc4aba7453ab9912ff1d75778f
4
+ data.tar.gz: 3bd461e092101c518dbd4d2f9f77b720a27fa6f4fd116a1c4d8131b15708658b
5
5
  SHA512:
6
- metadata.gz: cb919cb4b0d387c7463b1ba8b9615e490c90d5ee619b2fd525d313f8ade607d0ea02f95551e76c1dc069733ffd5c962ff553da9346fbe9497cef31a266141236
7
- data.tar.gz: f3c63ae889fd4c6a125edc09ad29a003eccbd253fd5bb8146dd37e302584c609792a364f13150e5567287093c7178e9f1bdcb77c7449f34ef505eeac6712b80b
6
+ metadata.gz: f5dfbca1b005b198231e02be228051c29e38c9d2efe6a9db9e08a4643f8f17ee52d717b7f349df9ebb0929ec59db46b83276586686e25b16c2cff85b74964dc6
7
+ data.tar.gz: 369b3362d5319228514baa10b78a6ca3e1f86c83c861f2f275830357d9c294b1001979fb3ab4d6de7525e4adf87bb573cdb128326212e078b8aba559490789ab
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.9.1]
6
+
7
+ - Properly display text parts by respecting break lines
8
+ - CI: official Rails 6 support
9
+ - Reduce gem size by including only necessary files
10
+
5
11
  ## [0.9.0]
6
12
 
7
13
  - Allow to register external mailers, for example, from a gem
@@ -103,6 +109,7 @@ All notable changes to this project will be documented in this file.
103
109
 
104
110
  - First real usable release :tada:
105
111
 
112
+ [0.9.1]: https://github.com/markets/maily/compare/v0.9.0...v0.9.1
106
113
  [0.9.0]: https://github.com/markets/maily/compare/v0.8.2...v0.9.0
107
114
  [0.8.2]: https://github.com/markets/maily/compare/v0.8.1...v0.8.2
108
115
  [0.8.1]: https://github.com/markets/maily/compare/v0.8.0...v0.8.1
@@ -180,6 +180,11 @@ footer.footer {
180
180
  }
181
181
  }
182
182
 
183
+ .welcome_message {
184
+ margin-top: 3em;
185
+ max-width: 80%;
186
+ }
187
+
183
188
  .button {
184
189
  box-sizing: border-box;
185
190
  -moz-box-sizing: border-box;
@@ -17,13 +17,16 @@ module Maily
17
17
  end
18
18
 
19
19
  def raw
20
- content = if @email.parts.present?
20
+ content = if @email.multipart?
21
21
  params[:part] == 'text' ? @email.text_part.body : @email.html_part.body
22
22
  else
23
23
  @email.body
24
24
  end
25
25
 
26
- render html: content.raw_source.html_safe, layout: false
26
+ content = content.raw_source
27
+ content = view_context.simple_format(content) if @email.sub_type == 'plain' || params[:part] == 'text'
28
+
29
+ render html: content.html_safe, layout: false
27
30
  end
28
31
 
29
32
  def attachment
@@ -1,2 +1,6 @@
1
1
  <h2><%= total_emails(@mailers) %> emails found</h2>
2
- <p><%= Maily.welcome_message %></p>
2
+ <p>Use the menu on the left hand side of the screen to navigate through the different email templates.</p>
3
+
4
+ <div class="welcome_message">
5
+ <%= Maily.welcome_message.to_s.html_safe %>
6
+ </div>
@@ -52,7 +52,7 @@
52
52
  <iframe class="mail_iframe" onload='resizeIframe(this)' src="<%= raw_maily_email_path(mailer: params[:mailer], email: params[:email], locale: params[:locale], part: params[:part]) %>" frameborder="1" width="100%"></iframe>
53
53
  <% end %>
54
54
 
55
- <% if @email.attachments.present? %>
55
+ <% if @email.has_attachments? %>
56
56
  <ul class="mail_attachments">
57
57
  <li>Attachments:</li>
58
58
  <li>
@@ -17,7 +17,7 @@ module Maily
17
17
  self.base_controller = 'ActionController::Base'
18
18
  self.http_authorization = nil
19
19
  self.hooks_path = "lib/maily_hooks.rb"
20
- self.welcome_message = "Use the menu on the left hand side of the screen to navigate through the different email templates."
20
+ self.welcome_message = nil
21
21
  end
22
22
 
23
23
  def load_emails_and_hooks
@@ -1,3 +1,3 @@
1
1
  module Maily
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
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.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - markets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2019-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -88,14 +88,9 @@ executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - ".gitignore"
92
- - ".travis.yml"
93
- - Appraisals
94
91
  - CHANGELOG.md
95
- - Gemfile
96
92
  - MIT-LICENSE
97
93
  - README.md
98
- - Rakefile
99
94
  - app/assets/images/maily/icons/globe.svg
100
95
  - app/assets/images/maily/icons/paperclip.svg
101
96
  - app/assets/images/maily/logo.png
@@ -115,10 +110,6 @@ files:
115
110
  - app/views/maily/shared/_header.html.erb
116
111
  - app/views/maily/shared/_sidebar.html.erb
117
112
  - config/routes.rb
118
- - gemfiles/rails_4.2.gemfile
119
- - gemfiles/rails_5.0.gemfile
120
- - gemfiles/rails_5.1.gemfile
121
- - gemfiles/rails_5.2.gemfile
122
113
  - lib/generators/maily/install_generator.rb
123
114
  - lib/generators/templates/initializer.rb
124
115
  - lib/maily.rb
@@ -127,60 +118,6 @@ files:
127
118
  - lib/maily/generator.rb
128
119
  - lib/maily/mailer.rb
129
120
  - lib/maily/version.rb
130
- - maily.gemspec
131
- - screenshot.png
132
- - spec/controllers_spec.rb
133
- - spec/dummy/README.md
134
- - spec/dummy/Rakefile
135
- - spec/dummy/app/assets/images/.keep
136
- - spec/dummy/app/assets/javascripts/application.js
137
- - spec/dummy/app/assets/stylesheets/application.css
138
- - spec/dummy/app/controllers/application_controller.rb
139
- - spec/dummy/app/controllers/concerns/.keep
140
- - spec/dummy/app/helpers/application_helper.rb
141
- - spec/dummy/app/mailers/application_mailer.rb
142
- - spec/dummy/app/mailers/notifier.rb
143
- - spec/dummy/app/models/.keep
144
- - spec/dummy/app/models/concerns/.keep
145
- - spec/dummy/app/views/layouts/application.html.erb
146
- - spec/dummy/app/views/notifications/recommendation.html.erb
147
- - spec/dummy/app/views/notifier/generic_welcome.html.erb
148
- - spec/dummy/app/views/notifier/invitation.html.erb
149
- - spec/dummy/app/views/notifier/multipart.html.erb
150
- - spec/dummy/app/views/notifier/multipart.text.erb
151
- - spec/dummy/app/views/notifier/welcome.html.erb
152
- - spec/dummy/app/views/notifier/with_slim_template.html.slim
153
- - spec/dummy/bin/bundle
154
- - spec/dummy/bin/rails
155
- - spec/dummy/bin/rake
156
- - spec/dummy/config.ru
157
- - spec/dummy/config/application.rb
158
- - spec/dummy/config/boot.rb
159
- - spec/dummy/config/environment.rb
160
- - spec/dummy/config/environments/development.rb
161
- - spec/dummy/config/environments/production.rb
162
- - spec/dummy/config/environments/test.rb
163
- - spec/dummy/config/initializers/backtrace_silencers.rb
164
- - spec/dummy/config/initializers/filter_parameter_logging.rb
165
- - spec/dummy/config/initializers/inflections.rb
166
- - spec/dummy/config/initializers/maily.rb
167
- - spec/dummy/config/initializers/mime_types.rb
168
- - spec/dummy/config/initializers/secret_token.rb
169
- - spec/dummy/config/initializers/session_store.rb
170
- - spec/dummy/config/initializers/wrap_parameters.rb
171
- - spec/dummy/config/locales/en.yml
172
- - spec/dummy/config/routes.rb
173
- - spec/dummy/lib/maily_hooks.rb
174
- - spec/dummy/log/.keep
175
- - spec/dummy/public/404.html
176
- - spec/dummy/public/422.html
177
- - spec/dummy/public/500.html
178
- - spec/dummy/public/favicon.ico
179
- - spec/email_spec.rb
180
- - spec/generator_spec.rb
181
- - spec/mailer_spec.rb
182
- - spec/maily_spec.rb
183
- - spec/spec_helper.rb
184
121
  homepage: https://github.com/markets/maily
185
122
  licenses:
186
123
  - MIT
@@ -205,56 +142,4 @@ rubygems_version: 2.7.6
205
142
  signing_key:
206
143
  specification_version: 4
207
144
  summary: Rails Engine to preview emails in the browser.
208
- test_files:
209
- - spec/controllers_spec.rb
210
- - spec/dummy/README.md
211
- - spec/dummy/Rakefile
212
- - spec/dummy/app/assets/images/.keep
213
- - spec/dummy/app/assets/javascripts/application.js
214
- - spec/dummy/app/assets/stylesheets/application.css
215
- - spec/dummy/app/controllers/application_controller.rb
216
- - spec/dummy/app/controllers/concerns/.keep
217
- - spec/dummy/app/helpers/application_helper.rb
218
- - spec/dummy/app/mailers/application_mailer.rb
219
- - spec/dummy/app/mailers/notifier.rb
220
- - spec/dummy/app/models/.keep
221
- - spec/dummy/app/models/concerns/.keep
222
- - spec/dummy/app/views/layouts/application.html.erb
223
- - spec/dummy/app/views/notifications/recommendation.html.erb
224
- - spec/dummy/app/views/notifier/generic_welcome.html.erb
225
- - spec/dummy/app/views/notifier/invitation.html.erb
226
- - spec/dummy/app/views/notifier/multipart.html.erb
227
- - spec/dummy/app/views/notifier/multipart.text.erb
228
- - spec/dummy/app/views/notifier/welcome.html.erb
229
- - spec/dummy/app/views/notifier/with_slim_template.html.slim
230
- - spec/dummy/bin/bundle
231
- - spec/dummy/bin/rails
232
- - spec/dummy/bin/rake
233
- - spec/dummy/config.ru
234
- - spec/dummy/config/application.rb
235
- - spec/dummy/config/boot.rb
236
- - spec/dummy/config/environment.rb
237
- - spec/dummy/config/environments/development.rb
238
- - spec/dummy/config/environments/production.rb
239
- - spec/dummy/config/environments/test.rb
240
- - spec/dummy/config/initializers/backtrace_silencers.rb
241
- - spec/dummy/config/initializers/filter_parameter_logging.rb
242
- - spec/dummy/config/initializers/inflections.rb
243
- - spec/dummy/config/initializers/maily.rb
244
- - spec/dummy/config/initializers/mime_types.rb
245
- - spec/dummy/config/initializers/secret_token.rb
246
- - spec/dummy/config/initializers/session_store.rb
247
- - spec/dummy/config/initializers/wrap_parameters.rb
248
- - spec/dummy/config/locales/en.yml
249
- - spec/dummy/config/routes.rb
250
- - spec/dummy/lib/maily_hooks.rb
251
- - spec/dummy/log/.keep
252
- - spec/dummy/public/404.html
253
- - spec/dummy/public/422.html
254
- - spec/dummy/public/500.html
255
- - spec/dummy/public/favicon.ico
256
- - spec/email_spec.rb
257
- - spec/generator_spec.rb
258
- - spec/mailer_spec.rb
259
- - spec/maily_spec.rb
260
- - spec/spec_helper.rb
145
+ test_files: []
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- .bundle/
2
- pkg/
3
- Gemfile.lock
4
- *.gemfile.lock
5
- spec/dummy/log/*.log
6
- spec/dummy/tmp/
7
- .byebug_history
@@ -1,16 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - ruby-head
5
- - 2.6.0
6
- - 2.5.3
7
- - 2.4.5
8
- - 2.3.8
9
- gemfile:
10
- - gemfiles/rails_5.2.gemfile
11
- - gemfiles/rails_5.1.gemfile
12
- - gemfiles/rails_5.0.gemfile
13
- - gemfiles/rails_4.2.gemfile
14
- matrix:
15
- allow_failures:
16
- - rvm: ruby-head
data/Appraisals DELETED
@@ -1,15 +0,0 @@
1
- appraise "rails-5.2" do
2
- gem "rails", "~> 5.2.0"
3
- end
4
-
5
- appraise "rails-5.1" do
6
- gem "rails", "~> 5.1.0"
7
- end
8
-
9
- appraise "rails-5.0" do
10
- gem "rails", "~> 5.0.0"
11
- end
12
-
13
- appraise "rails-4.2" do
14
- gem "rails", github: 'rails/rails', branch: '4-2-stable'
15
- end
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- require 'rspec/core/rake_task'
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", github: "rails/rails", branch: "4-2-stable"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.1.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.2.0"
6
-
7
- gemspec path: "../"
@@ -1,24 +0,0 @@
1
- require "./lib/maily/version"
2
-
3
- Gem::Specification.new do |s|
4
- s.name = "maily"
5
- s.version = Maily::VERSION
6
- s.authors = ["markets"]
7
- s.email = ["srmarc.ai@gmail.com"]
8
- s.homepage = "https://github.com/markets/maily"
9
- s.summary = "Rails Engine to preview emails in the browser."
10
- s.description = "Maily is a Rails Engine to manage, test and navigate through all your email templates of your app, being able to preview them directly in your browser."
11
- s.license = "MIT"
12
-
13
- s.files = `git ls-files`.split($/)
14
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
- s.require_paths = ["lib"]
17
-
18
- s.add_dependency "rails", ">= 3.0.0"
19
- s.add_dependency "sass-rails"
20
-
21
- s.add_development_dependency "rspec-rails"
22
- s.add_development_dependency "appraisal"
23
- s.add_development_dependency "byebug"
24
- end
Binary file
@@ -1,71 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Maily::EmailsController, type: :controller do
4
- # Rails 4 <-> 5 compatibility
5
- def compatible_get(action, **params)
6
- if ::Rails::VERSION::STRING > '5'
7
- get action, params: params
8
- else
9
- get action, params
10
- end
11
- end
12
-
13
- routes { Maily::Engine.routes }
14
-
15
- before(:each) do
16
- Maily.init!
17
- end
18
-
19
- it 'responds ok if enabled' do
20
- expect { get :index }.not_to raise_error
21
- end
22
-
23
- it 'raises 404 if disabled' do
24
- Maily.enabled = false
25
-
26
- get :index
27
-
28
- expect(response.status).to eq(404)
29
- end
30
-
31
- it 'responds with 401 if http authorization fails' do
32
- Maily.http_authorization = { username: 'admin', password: 'admin' }
33
-
34
- get :index
35
-
36
- expect(response.status).to eq(401)
37
- end
38
-
39
- it 'responds ok with valid http authorization' do
40
- Maily.http_authorization = { username: 'admin', password: 'admin' }
41
- request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('admin', 'admin')
42
-
43
- get :index
44
-
45
- expect(response.status).to eq(200)
46
- end
47
-
48
- describe 'non-existent emails' do
49
- it 'email not in the system -> 302' do
50
- compatible_get :show, mailer: 'notifier', email: 'non_existent_email'
51
-
52
- expect(response.status).to eq(302)
53
- expect(flash.alert).to eq("Email not found!")
54
- end
55
-
56
- it 'hidden emails -> 302' do
57
- compatible_get :show, mailer: 'notifier', email: 'hidden'
58
-
59
- expect(response.status).to eq(302)
60
- expect(flash.alert).to eq("Email not found!")
61
- end
62
- end
63
-
64
- describe 'GET #raw' do
65
- it 'renders the template' do
66
- compatible_get :raw, mailer: 'notifier', email: 'invitation'
67
-
68
- expect(response.body).to match("<h1>Invitation</h1>")
69
- end
70
- end
71
- end