maily 2.0.2 → 2.1.0

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
  SHA256:
3
- metadata.gz: f56b187b737b69eebc37a1d71bd792c8dde6059ed71727e038e832b73f2ec18c
4
- data.tar.gz: f5bfc85ebb1ed72c5f405a236e33ff62892e14815375f0ff1989b774a48ea90c
3
+ metadata.gz: f235ba37075df3a0f065488b094fe1578e57058dd850313292bfdc41e7af75d8
4
+ data.tar.gz: 6091d90733c60d465d170f0b8243b1cad0f74d7dc34d0091dd3a9f2dafd89653
5
5
  SHA512:
6
- metadata.gz: 618f0f112671a0c9355b25d4ef5d6912cf209e423b61ffdeb80372d15be28581864c3b041aaf1213d31de9405605596ab726ef84a55c29cfc8338deca2664bf2
7
- data.tar.gz: fb8ec2d9c389f4516e726dcfb5c0488ea4db4eca2bc8d89526180f945d77c065783e5d81439d1546a8eb3744f1d7adec2351b3aff69c6440d0fe97025b830acf
6
+ metadata.gz: 96185b6150391a907bff8a17535212ff383b0f400ddd28242802600eeec1d394418426097935bc7200d32a9b0dfaec6ab0744ea0d1da752a279772dd67236fd8
7
+ data.tar.gz: 14552df9ee81d40ea11e3997aa8bdbc9f4678699cb279116dc0eb74ad9ffdf4d730586562af6dfdf8473d8f33bf26e729819193f21dd8b265f723700c1f4f5bf
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.1.0]
6
+
7
+ - Use `ActionMailer::InlinePreviewInterceptor` to facilitate integration with other gems like premailer (#55)
8
+ - Move CI from Travis to GitHub Actions
9
+
5
10
  ## [2.0.2]
6
11
 
7
12
  - UI: Hide delivery form if `allow_delivery` is false (#54)
@@ -157,6 +162,7 @@ All notable changes to this project will be documented in this file.
157
162
 
158
163
  - First real usable release :tada:
159
164
 
165
+ [2.1.0]: https://github.com/markets/maily/compare/v2.0.2...v2.1.0
160
166
  [2.0.2]: https://github.com/markets/maily/compare/v2.0.1...v2.0.2
161
167
  [2.0.1]: https://github.com/markets/maily/compare/v2.0.0...v2.0.1
162
168
  [2.0.0]: https://github.com/markets/maily/compare/v1.0.0...v2.0.0
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </p>
5
5
  <p align="center">
6
6
  <a href="https://rubygems.org/gems/maily"><img src="https://img.shields.io/gem/v/maily.svg?style=flat-square"></a>
7
- <a href="https://travis-ci.com/markets/maily"><img src="https://travis-ci.com/markets/maily.svg?branch=master"></a>
7
+ <a href="https://github.com/markets/maily/actions"><img src="https://github.com/markets/maily/workflows/CI/badge.svg"></a>
8
8
  <a href="https://codeclimate.com/github/markets/maily/maintainability"><img src="https://api.codeclimate.com/v1/badges/fff01b2137fd73070b14/maintainability"></a>
9
9
  <a href="https://github.com/markets/maily/blob/master/MIT-LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/markets/maily.svg?style=flat-square"></a>
10
10
  </p>
@@ -233,20 +233,20 @@ Any kind of feedback, bug report, idea or enhancement are really appreciated :ta
233
233
  To contribute, just fork the repo, hack on it and send a pull request. Don't forget to add tests for behaviour changes and run the test suite:
234
234
 
235
235
  ```
236
- > bundle exec rake
236
+ > bundle exec rspec
237
237
  ```
238
238
 
239
239
  Run the test suite against all supported versions:
240
240
 
241
241
  ```
242
242
  > bundle exec appraisal install
243
- > bundle exec appraisal rake
243
+ > bundle exec appraisal rspec
244
244
  ```
245
245
 
246
246
  Run specs against specific version:
247
247
 
248
248
  ```
249
- > bundle exec appraisal rails-6.0 rake
249
+ > bundle exec appraisal rails-6.0 rspec
250
250
  ```
251
251
 
252
252
  ### Demo
@@ -25,7 +25,6 @@ module Maily
25
25
 
26
26
  content = content.raw_source
27
27
  content = view_context.simple_format(content) if @email.sub_type == 'plain' || params[:part] == 'text'
28
- content = prepare_inline_attachments(@email, content)
29
28
 
30
29
  render html: content.html_safe, layout: false
31
30
  end
@@ -80,19 +79,5 @@ module Maily
80
79
  yield
81
80
  end
82
81
  end
83
-
84
- def prepare_inline_attachments(email, content)
85
- content.gsub(/src=(?:"cid:[^"]+"|'cid:[^']+')/i) do |match|
86
- if part = find_part(email, match[9..-2])
87
- %[src="data:#{part.mime_type};base64,#{Base64.encode64(part.body.raw_source)}"]
88
- else
89
- match
90
- end
91
- end
92
- end
93
-
94
- def find_part(email, cid)
95
- email.all_parts.find { |p| p.attachment? && p.cid == cid }
96
- end
97
82
  end
98
83
  end
data/lib/maily/email.rb CHANGED
@@ -88,11 +88,17 @@ module Maily
88
88
  def call
89
89
  *args = arguments && arguments.map { |arg| arg.respond_to?(:call) ? arg.call : arg }
90
90
 
91
- if args == [nil]
91
+ message = if args == [nil]
92
92
  parameterized_mailer_klass.public_send(name)
93
93
  else
94
94
  parameterized_mailer_klass.public_send(name, *args)
95
95
  end
96
+
97
+ ActionMailer::Base.preview_interceptors.each do |interceptor|
98
+ interceptor.previewing_email(message)
99
+ end
100
+
101
+ message
96
102
  end
97
103
 
98
104
  def base_path(part)
data/lib/maily/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Maily
2
- VERSION = "2.0.2"
2
+ VERSION = "2.1.0"
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: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - markets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-29 00:00:00.000000000 Z
11
+ date: 2021-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.0.3
111
+ rubygems_version: 3.1.4
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Rails Engine to preview emails in the browser.