simply_notify 0.2.0 → 0.2.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 +4 -26
- data/lib/generators/notifier_generator.rb +19 -3
- data/lib/simply_notify.rb +1 -1
- data/lib/simply_notify/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: c364f5e1904b988610dfbb5988ce6c646ca5b689
|
4
|
+
data.tar.gz: 3c7b495b7f63910b965bcf60c956cb18c9d00ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d405c06dd02f4b1dcd4dab65a4c4794310a42fa5e85a41f25dca1411eba9d75ff33fe9c8000287da5c6723b894a1f0d51aa50243e093f499cdb75ed1af66ba
|
7
|
+
data.tar.gz: 60bbf29a5e8535422df72f0e41d24d311c51f761c9b855bd77db9612b2e1581e9261864b531bf576b8f3ba3a17bb2e366e8a8e40534d0f9a1e198ea705dd4035
|
data/README.md
CHANGED
@@ -26,32 +26,10 @@ Create the model and views using the generator:
|
|
26
26
|
|
27
27
|
rails generate notifier
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Thanks.
|
34
|
-
|
35
|
-
AND
|
36
|
-
|
37
|
-
<!DOCTYPE html>
|
38
|
-
<html>
|
39
|
-
<head>
|
40
|
-
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
|
41
|
-
</head>
|
42
|
-
<body>
|
43
|
-
<h1>Hello <%= @user.name %></h1>
|
44
|
-
<p>
|
45
|
-
You have a new notification! Please visit the course website.<br>
|
46
|
-
Thanks.<br>
|
47
|
-
</p>
|
48
|
-
</body>
|
49
|
-
</html>
|
50
|
-
|
51
|
-
|
52
|
-
Finally, call a variation of this from the controller where notifications are created, right after the notifcation is saved:
|
53
|
-
|
54
|
-
Notifier.new_notification(@recipient).deliver_now
|
29
|
+
|
30
|
+
Place a call in the controller where notifications are created, after the notifcation is saved:
|
31
|
+
|
32
|
+
Notifier.new_notification(@user).deliver_now
|
55
33
|
|
56
34
|
|
57
35
|
## Contributing
|
@@ -5,14 +5,30 @@ class NotifierGenerator < Rails::Generators::Base
|
|
5
5
|
desc "This generator creates the Model and Views"
|
6
6
|
|
7
7
|
def create_model_file
|
8
|
-
create_file "models/notifier.rb", "require 'simply_notify'"
|
8
|
+
create_file "app/models/notifier.rb", "require 'simply_notify'"
|
9
9
|
end
|
10
10
|
|
11
11
|
def create_html_view_file
|
12
|
-
create_file "views/notifier/
|
12
|
+
create_file "app/views/notifier/new_notification.html.erb",
|
13
|
+
"<!DOCTYPE html>
|
14
|
+
<html>
|
15
|
+
<head>
|
16
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<h1>Hello <%= @recipient %></h1>
|
20
|
+
<p>
|
21
|
+
You have a new notification! Please visit the course website.<br>
|
22
|
+
Thanks.<br>
|
23
|
+
</p>
|
24
|
+
</body>
|
25
|
+
</html>"
|
13
26
|
end
|
14
27
|
|
15
28
|
def create_text_view_file
|
16
|
-
create_file "views/notifier/text.
|
29
|
+
create_file "app/views/notifier/new_notification.text.erb",
|
30
|
+
"Hello <%= @recipient %>,
|
31
|
+
You have a new notification! Please visit the course website.
|
32
|
+
Thanks."
|
17
33
|
end
|
18
34
|
end
|
data/lib/simply_notify.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simply_notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Lichten
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|