rails_email_preview 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/initializers/rails_email_preview.rb +1 -3
- data/lib/rails_email_preview.rb +6 -0
- data/lib/rails_email_preview/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c4c8ac537b524b4a53466fecd5f9c549283e48
|
4
|
+
data.tar.gz: 5cfcd565ccd05776285f49bdd124a72b80163d7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a1cf0a14e907fb7dd974bd4de20f104df50a5656b6c4845f982fa1a45e38dd842f0e28c3b4a546f5ae3711fc85ef4306f78b48c7addc0c897197caf2ecfffbf
|
7
|
+
data.tar.gz: 381f880a57c8fac960acb71cbfe1c4f0501afaeb32cab69835764652356a03b17062d3f2b71bc1e87cbace85ba403bc66b94bf6ae0fc35b633139a63bbff376a
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ REP comes with two themes: a simple standalone theme, and a theme that uses [Boo
|
|
17
17
|
Add [![Gem Version][gem-badge]][gem] to Gemfile:
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem 'rails_email_preview', '~> 1.0.
|
20
|
+
gem 'rails_email_preview', '~> 1.0.1'
|
21
21
|
```
|
22
22
|
|
23
23
|
Add an initializer and the routes:
|
@@ -32,7 +32,5 @@ Rails.application.config.to_prepare do
|
|
32
32
|
# RailsEmailPreview.locale = :de
|
33
33
|
|
34
34
|
# Auto-load preview classes from:
|
35
|
-
RailsEmailPreview.preview_classes =
|
36
|
-
File.basename(p, '.rb').camelize
|
37
|
-
}
|
35
|
+
RailsEmailPreview.preview_classes = RailsEmailPreview.find_preview_classes('app/mailer_previews')
|
38
36
|
end
|
data/lib/rails_email_preview.rb
CHANGED
@@ -9,6 +9,7 @@ require 'sass'
|
|
9
9
|
require 'sass-rails'
|
10
10
|
require 'request_store'
|
11
11
|
require 'turbolinks'
|
12
|
+
require 'pathname'
|
12
13
|
|
13
14
|
module RailsEmailPreview
|
14
15
|
|
@@ -52,6 +53,11 @@ module RailsEmailPreview
|
|
52
53
|
RailsEmailPreview::Preview.load_all(classes)
|
53
54
|
end
|
54
55
|
|
56
|
+
def find_preview_classes(dir)
|
57
|
+
return [] unless File.directory?(dir)
|
58
|
+
Dir.chdir(dir) { Dir['**/*_preview.rb'].map { |p| p.sub(/\.rb$/, '').camelize } }
|
59
|
+
end
|
60
|
+
|
55
61
|
def layout=(layout)
|
56
62
|
[::RailsEmailPreview::ApplicationController, ::RailsEmailPreview::EmailsController].each { |ctrl| ctrl.layout layout }
|
57
63
|
if layout && layout !~ %r(^rails_email_preview/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_email_preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|