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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02bcd4fe9bb7401449acd3b44245c93f8d5ab360
4
- data.tar.gz: 5b7c64b281650e047e113cb020f83c4050156e20
3
+ metadata.gz: a9c4c8ac537b524b4a53466fecd5f9c549283e48
4
+ data.tar.gz: 5cfcd565ccd05776285f49bdd124a72b80163d7a
5
5
  SHA512:
6
- metadata.gz: 081630f21830afb463670897d4517670bc890a9ff47b927e0a035dbec1f0baf5866bec0ac4ef99d7d27527996a79d9cbf744c476f7ccd76fa82a19acc18c642f
7
- data.tar.gz: 26f7398c358fa2b9041ba6a9bb0af737b87397c5ed2ce81f769d0d63bd6ccbe73fe922476e81464e4bf395b789a447ed64992290916366e0830fed3e0b1131f6
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.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 = Dir[Rails.root.join 'app/mailer_previews/*_preview.rb'].map { |p|
36
- File.basename(p, '.rb').camelize
37
- }
35
+ RailsEmailPreview.preview_classes = RailsEmailPreview.find_preview_classes('app/mailer_previews')
38
36
  end
@@ -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/)
@@ -1,3 +1,3 @@
1
1
  module RailsEmailPreview
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
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.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-04 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails