rails_email_preview 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -11
- data/lib/rails_email_preview/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29c1a27975a3c37570a310cd5fd8fab3efa66c28
|
4
|
+
data.tar.gz: 254f09df4a0fe63b6e16c6f77d30fcea0fb0cada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12ed93d3d7351dae246a430f2fd06ed69e9a6262b0d2dee452e8f2d24816ce3da2cc4f2e7057dd2feb3c08aa23712beff13107563c0325462b6d7bd79a3529c6
|
7
|
+
data.tar.gz: 65ca94712efcebb5e8200a7784831f73f6782dd15b0f0b8e2737e22c4cfbfa6a4f2b707942e0da9152d7441b089614eac2f5415734828dae1e04d1c1fd964003
|
data/README.md
CHANGED
@@ -12,20 +12,19 @@ How to
|
|
12
12
|
|
13
13
|
Add to Gemfile
|
14
14
|
|
15
|
-
gem 'rails_email_preview'
|
15
|
+
gem 'rails_email_preview', '~> 0.1.7'
|
16
16
|
|
17
|
-
|
17
|
+
REP handles setup for you:
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
# adds initializer and route:
|
20
|
+
rails g rails_email_preview:install
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
# generates preview classes and method stubs in app/mailer_previews/:
|
23
|
+
rails g rails_email_preview:update_previews
|
24
24
|
|
25
|
-
|
25
|
+
This last generator will add a stub for each of your emails, then you populate the stubs with mock data:
|
26
26
|
|
27
|
-
#
|
28
|
-
# in app/mailer_previews/user_mailer_preview.rb initialize the emails for preview:
|
27
|
+
# app/mailer_previews/user_mailer_preview.rb:
|
29
28
|
class UserMailerPreview
|
30
29
|
# preview methods should return Mail objects, e.g.:
|
31
30
|
def invitation
|
@@ -38,12 +37,13 @@ You will need to provide data for preview of each email:
|
|
38
37
|
|
39
38
|
private
|
40
39
|
# You can put all your mock helpers in a module
|
41
|
-
#
|
40
|
+
# or you can use your factories / fabricators, just make sure you are not creating anythin
|
42
41
|
def mock_user(name = 'Bill Gates')
|
43
42
|
fake_id User.new(name: name, email: "user#{rand 100}@test.com")
|
44
43
|
end
|
45
|
-
|
44
|
+
|
46
45
|
def fake_id(obj)
|
46
|
+
# overrides the method on just this object
|
47
47
|
obj.define_singleton_method(:id) { 123 + rand(100) }
|
48
48
|
obj
|
49
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_email_preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: slim-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: sass
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|