rails_email_preview 0.2.16 → 0.2.17

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cbc20433f6d48e1eb79476298c34e38678c8d07
4
- data.tar.gz: 75d8dbd730a5250e7128769c24107eefa1805ed4
3
+ metadata.gz: 4c8913f959f468e0419fc73fe498f3b627435911
4
+ data.tar.gz: 7312f5fc2cdeb1ed911ba7b363391464d2982adc
5
5
  SHA512:
6
- metadata.gz: ef7e7d84c070662c75fc2fbd63c71ee388e019d579c59be6f1cb9c07be677a0998e3cfd85d700ef814b1d8c71d19b3b34b6ae5a845c3e7c1caebbf6dbb012ecc
7
- data.tar.gz: 3eb009c31ae6773d0d8e588186b6ec4ac26f7ef58f06a4945f50bdcd3a9d597d0f0c1c568f4b57941794d2dead8bbbdf46b7ceeec34833412e5ed156635be36b
6
+ metadata.gz: 2fd1760ef205d77998d7f97b5556a99ab038fb87d77d7b72aef4ef5e3bc065cbb19251ff7b68db65690ac586f03e7bd334c4f82f40116c4e092b788afd2e6b0c
7
+ data.tar.gz: ac603d9e154558b28c731b9dfe31b245babe83d6cd4b0c18cebf869ca7d910f78a5d479a4fb7850daa65de2c8418e7392185786ca8b43c8be8f11de4d1950912
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ platform :rbx do
9
9
  end
10
10
 
11
11
  group :development, :test do
12
- gem 'i18n-tasks'
12
+ gem 'i18n-tasks', '>= 0.3.3'
13
13
  gem 'capybara', '>= 0.4.0'
14
14
  gem 'rspec', '2.12.0' #, git: 'https://github.com/rspec/rspec'
15
15
  gem 'rspec-rails' #, git: 'https://github.com/rspec/rspec-rails'
data/README.md CHANGED
@@ -18,7 +18,7 @@ How to
18
18
  Add to Gemfile
19
19
 
20
20
  ```ruby
21
- gem 'rails_email_preview', '~> 0.2.12'
21
+ gem 'rails_email_preview', '~> 0.2.16'
22
22
  ```
23
23
 
24
24
  REP handles setup for you:
data/Rakefile CHANGED
@@ -16,6 +16,4 @@ Bundler::GemHelper.install_tasks
16
16
  require 'rspec/core/rake_task'
17
17
  RSpec::Core::RakeTask.new(:spec)
18
18
 
19
- load 'tasks/i18n-tasks.rake'
20
-
21
19
  task default: :spec
@@ -30,7 +30,7 @@ class RailsEmailPreview::EmailsController < ::RailsEmailPreview::ApplicationCont
30
30
  end
31
31
 
32
32
  def test_deliver
33
- redirect_url = rails_email_preview.rep_email_url(params.slice(:mail_class, :mail_action, :email_locale))
33
+ redirect_url = rails_email_preview.rep_email_url(params.slice(:preview_id, :email_locale))
34
34
  if (address = params[:recipient_email]).blank? || address !~ /@/
35
35
  redirect_to redirect_url, alert: t('rep.test_deliver.provide_email')
36
36
  return
@@ -2,8 +2,9 @@ javascript:
2
2
  (function(doc){
3
3
  var rep = window.rep = window['rep'] || {
4
4
  resizeIframe: function(id) {
5
- var el = doc.getElementById(id),
6
- w = el.parentNode.clientWidth,
5
+ var el = doc.getElementById(id);
6
+ if (!el) return;
7
+ var w = el.parentNode.clientWidth,
7
8
  h = el.contentWindow.document.body.scrollHeight;
8
9
  el.height = (h) + "px";
9
10
  el.width = (w) + "px";
@@ -26,5 +27,5 @@ javascript:
26
27
  pre#loading-el.lead
27
28
  i.icon-spinner.icon-spin
28
29
  | #{t 'rep.base.loading'}
29
- iframe#src-iframe[src=rails_email_preview.rep_raw_email_url(params.slice(:mail_class, :mail_action, :part_type).merge(email_locale: @email_locale))
30
+ iframe#src-iframe[src=rails_email_preview.rep_raw_email_url(params.slice(:preview_id, :part_type).merge(email_locale: @email_locale))
30
31
  width="100%" height=1 onLoad="rep.iframeLoad('src-iframe')" style="border:none;padding:0;margin:0"]
@@ -25,13 +25,14 @@ module RailsEmailPreview
25
25
  def mailer_class_body(mailer_class_name)
26
26
  <<-RUBY
27
27
  class #{mailer_class_name}Preview
28
- #{mailer_methods(mailer_class_name) * "\n\n"}
28
+ #{(mailer_methods(mailer_class_name) * "\n\n").chomp}
29
29
  end
30
30
  RUBY
31
31
  end
32
32
 
33
33
  def mailer_methods(mailer_class_name)
34
- ::RailsEmailPreview::Preview.mail_methods(mailer_class_name.constantize).map do |m|
34
+ mailer_class = mailer_class_name.constantize
35
+ ::RailsEmailPreview::Preview.mail_methods(mailer_class).map do |m|
35
36
  <<-RUBY
36
37
  def #{m}
37
38
  #{mailer_class_name}.#{m.to_s} #{mailer_class.instance_method(m).parameters.map(&:second) * ', '}
@@ -39,6 +40,7 @@ RUBY
39
40
  RUBY
40
41
  end
41
42
  end
43
+
42
44
  end
43
45
  end
44
46
  end
@@ -1,3 +1,3 @@
1
1
  module RailsEmailPreview
2
- VERSION = '0.2.16'
2
+ VERSION = '0.2.17'
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: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,8 +80,8 @@ dependencies:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: Rails engine to preview, test send, and edit application email in browser.
84
- i18n support, premailer integration, and more.
83
+ description: A Rails Engine to preview plain text and html email in your browser.
84
+ Compatible with Rails 3 and 4.
85
85
  email: glex.spb@gmail.com
86
86
  executables: []
87
87
  extensions: []