notifykit 0.2.0 → 0.3.0

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: d96baaa9ac5a0a64a5f914b4a31daa06a06e2fcc
4
- data.tar.gz: 39ac9eda71d9fe5bcfebd394d792f8d5b125b30a
3
+ metadata.gz: 94dc4739c05ee8b8d65fdaa9a3e0bcbf210e87ba
4
+ data.tar.gz: 57b5cf46b2de9009b890ce281019533441f791e1
5
5
  SHA512:
6
- metadata.gz: f3156b96771dbd2806f606571727d8ad0ae82680f3c21fc9019ca478864c4ec975b7d93cfd7db6f43ea6b5b82d711c4bd25d86143090ce5e9f73ba2172626f7b
7
- data.tar.gz: 151d51d7e9c410424d61f8f80b51ec646ebaff300b6a250854e297a14e95fb6519ea7e37e60f5e43fb12a15d50104d465c70540a2bf7874c1671c4635e5ce5fa
6
+ metadata.gz: 017745b6af35344c4ecdc614e19797fb52cfc4b82831488918eab86ead51440fcfd09639a711d67af7ee91b00cce155d3b2db1f5dc48094beaa3ac7876ffbe24
7
+ data.tar.gz: ac4ab1b66479d0a3f79b097054e5034a2c77b07e41a9e26606d10bbc187bde9c2fa1095c28b45a65826bf81aa2668dee2897a4b53855231656b282007c649926
data/README.md CHANGED
@@ -37,7 +37,7 @@ emailed it is updated with the rendered text and HTML. Any interaction with
37
37
  the notification will create additional database operations.
38
38
 
39
39
  Even with a modest amount of emails (1000/day) the database would grow
40
- by 10M.day. This can easily overwhelm a small system.
40
+ by 10Mb.day. This can easily overwhelm a small system.
41
41
 
42
42
  It is possible to change how rendered email messages are stored. For
43
43
  instance you could change to a strategy where only the needed data
@@ -62,8 +62,8 @@ module Notifykit
62
62
  route "get '/terms', to: 'terms#index', as: :terms"
63
63
  end
64
64
 
65
- # Adjust the user
66
- inject_into_class "app/models/user.rb", User, "has_many :notifications\n"
65
+ # Adjust the user, unless it doesn't exist
66
+ inject_into_class "app/models/user.rb", User, "has_many :notifications\n" rescue nil
67
67
 
68
68
  # Technically, we aren't inserting this at the end of the class, but the end of the RSpec::Configure
69
69
  insert_at_end_of_class "spec/spec_helper.rb", "spec/spec_helper.rb"
@@ -86,14 +86,14 @@ module Notifykit
86
86
  source = File.expand_path(find_in_source_paths(source.to_s))
87
87
  context = instance_eval('binding')
88
88
  content = ERB.new(::File.binread(source), nil, '-', '@output_buffer').result(context)
89
- insert_into_file filename, "#{content}\n", before: /\z/
89
+ insert_into_file filename, "#{content}\n", before: /\z/ rescue nil
90
90
  end
91
91
 
92
92
  def insert_at_end_of_class(filename, source)
93
93
  source = File.expand_path(find_in_source_paths(source.to_s))
94
94
  context = instance_eval('binding')
95
95
  content = ERB.new(::File.binread(source), nil, '-', '@output_buffer').result(context)
96
- insert_into_file filename, "#{content}\n", before: /end\n*\z/
96
+ insert_into_file filename, "#{content}\n", before: /end\n*\z/ rescue nil
97
97
  end
98
98
 
99
99
  def generate_migration(filename)
@@ -60,7 +60,7 @@ class Notification < ActiveRecord::Base
60
60
  def set_email
61
61
  return if !self.deliver_via_email?
62
62
 
63
- self.email ||= self.user.email rescue nil
63
+ self.email ||= self.user.try(:email) rescue nil
64
64
  end
65
65
 
66
66
  # The default size is 16 which is 1/64^16, this is protected by
@@ -48,9 +48,17 @@
48
48
  padding:0;
49
49
  line-height:26px;
50
50
  }
51
+ /* For targeting in Gmail */
52
+ div[title='content'] {
53
+ padding: 0 40px 0 40px;
54
+ }
51
55
  div.content {
52
56
  padding: 0 40px 0 40px;
53
57
  }
58
+ /* For targeting in Gmail */
59
+ div[title='content'] p {
60
+ font-size: 16px;
61
+ }
54
62
  div.content p {
55
63
  font-size: 16px;
56
64
  }
@@ -106,6 +114,10 @@
106
114
  zoom: 1;
107
115
  }
108
116
 
117
+ *, *:before, *:after {
118
+ -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
119
+ }
120
+
109
121
  @media only screen and (max-width: 480px) {
110
122
  body, #body_style {
111
123
  font-size: 24px !important;
@@ -114,10 +126,10 @@
114
126
  font-stretch:normal;
115
127
  line-height:32px;
116
128
  }
117
- table[class=table] {width:480px !important;}
129
+ table[class=table] {width:100% !important;}
118
130
 
119
131
  /* footer */
120
- table[class=footer_1] {width: 405px !important;}
132
+ table[class=footer_1] {width: 80% !important;}
121
133
  td[class=footer_1] {font-size: 16px !important;line-height: 22px !important;}
122
134
  td[class=footer_2] {font-size: 16px !important;line-height: 22px !important;}
123
135
  td[class=unsubscribe] {font-size: 14px !important;}
@@ -126,7 +138,7 @@
126
138
  </head>
127
139
  <body style="background:#F7F7F7; color:#7F7F7F; font-size:14px" alink="#000000" link="#000000" bgcolor="#F7F7F7" text="#7F7F7F">
128
140
  <div id="body_style">
129
- <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#F7F7F7">
141
+ <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#dfdfdf">
130
142
  <tr>
131
143
  <td style="padding:0px 20px 20px 20px;">
132
144
  <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
@@ -134,13 +146,15 @@
134
146
  <td align="center" style="border-bottom: 1px solid #FFFFFF;">
135
147
  <table width="100%" cellspacing="0" cellpadding="0" border="0">
136
148
  <tr>
137
- <td align="center" class="contains_graphics" style="border-bottom:1px solid #CCCCCC;font-size: 11px;color:#999999;text-align:center;padding:10px 0px;" valign="middle">
149
+ <td align="center" class="contains_graphics" style="border-bottom:1px solid #CCCCCC;font-size: 10px;color:#999999;text-align:center;padding:10px 0px;" valign="middle">
138
150
  <span>This email contains graphics. If you don’t see them,</span> <a href="<%= notification_view_url(notification) %>">click here</a>.
139
151
  </td>
140
152
  </tr>
141
153
  </table>
142
154
  </td>
143
155
  </tr>
156
+ </table>
157
+ <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
144
158
  <tr>
145
159
  <td>
146
160
  <table width="100%" cellspacing="0" cellpadding="0" border="0">
@@ -149,9 +163,11 @@
149
163
  <table cellspacing="0" cellpadding="0" border="0" align="center">
150
164
  <tr>
151
165
  <td align="center">
152
- <a href="<%= append_tracking(root_url) %>">
153
- <%= notification_company_logo %>
154
- </a>
166
+ <div style="padding: 16px">
167
+ <a href="<%= append_tracking(root_url) %>">
168
+ <%= notification_company_logo %>
169
+ </a>
170
+ </div>
155
171
  </td>
156
172
  </tr>
157
173
  </table>
@@ -160,21 +176,27 @@
160
176
  </table>
161
177
  </td>
162
178
  </tr>
179
+ </table>
180
+ <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
163
181
  <tr>
164
182
  <td class="bar" width="100%" height="0" style="border-bottom:4px solid #666666;">
165
183
  </td>
166
184
  </tr>
185
+ </table>
186
+ <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
167
187
  <tr>
168
188
  <td>
169
189
  <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
170
190
  <tr>
171
- <td style="border: 1px solid #CCCCCC; border-top: none; border-bottom: none; padding: 40px 0px;" class="wrapper_td">
191
+ <td style="border: 1px solid #CCCCCC; border-top: none; border-bottom: none; padding: 40px 40px;" class="wrapper_td">
172
192
  <%= render partial: notification.kind %>
173
193
  </td>
174
194
  </tr>
175
195
  </table>
176
196
  </td>
177
197
  </tr>
198
+ </table>
199
+ <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
178
200
  <tr>
179
201
  <td style="border:1px solid #CCCCCC;">
180
202
  <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF" align="center">
@@ -193,6 +215,8 @@
193
215
  </table>
194
216
  </td>
195
217
  </tr>
218
+ </table>
219
+ <table class="table" width="600" cellspacing="0" cellpadding="0" border="0" align="center">
196
220
  <tr>
197
221
  <td align="center">
198
222
  <table class="footer2" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
@@ -202,6 +226,8 @@
202
226
  <%= notification_company_address %>
203
227
  </td>
204
228
  </tr>
229
+ </table>
230
+ <table class="footer2" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
205
231
  <tr>
206
232
  <td class="unsubscribe" align="center" style="text-align:center;font-size:11px;color:#999999">
207
233
  <% unless notification.transactional? -%><a href="<%= notification_unsubscribe_url(notification) %>">Unsubscribe</a><br><% end -%>
@@ -218,4 +244,4 @@
218
244
  </table>
219
245
  </div>
220
246
  </body>
221
- </html>
247
+
@@ -1,3 +1,3 @@
1
1
  module Notifykit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Rafter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: factory_girl_rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: A notification system for your Rails app
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - CHANGELOG.md
78
78
  - FEATURES.md
79
79
  - Gemfile
@@ -113,17 +113,17 @@ require_paths:
113
113
  - lib
114
114
  required_ruby_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - '>='
121
+ - - ">="
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.0.3
126
+ rubygems_version: 2.2.2
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Notifykit is a generator that will install a notifications model, mailer,