letter_opener_web 1.3.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/brakeman-analysis.yml +46 -0
  3. data/.github/workflows/main.yml +34 -0
  4. data/.github/workflows/release-gem.yml +32 -0
  5. data/.gitignore +1 -0
  6. data/.rspec +1 -1
  7. data/.rubocop.yml +5 -16
  8. data/.rubocop_todo.yml +19 -0
  9. data/CHANGELOG.md +22 -1
  10. data/Gemfile +4 -0
  11. data/LICENSE.txt +1 -1
  12. data/README.md +33 -24
  13. data/app/controllers/letter_opener_web/application_controller.rb +1 -0
  14. data/app/controllers/letter_opener_web/letters_controller.rb +14 -7
  15. data/app/models/letter_opener_web/letter.rb +37 -5
  16. data/app/views/layouts/letter_opener_web/_javascripts.html.erb +31 -0
  17. data/app/views/layouts/letter_opener_web/_styles.html.erb +3 -0
  18. data/{vendor/assets/javascripts/letter_opener_web/favcount.js → app/views/layouts/letter_opener_web/js/_favcount.html.erb} +9 -7
  19. data/app/views/layouts/letter_opener_web/js/_jquery.html.erb +7 -0
  20. data/app/views/layouts/letter_opener_web/letters.html.erb +5 -3
  21. data/app/views/layouts/letter_opener_web/styles/_bootstrap.html.erb +9 -0
  22. data/app/views/layouts/letter_opener_web/styles/_icon.html.erb +2 -0
  23. data/app/views/layouts/letter_opener_web/styles/_letters.html.erb +70 -0
  24. data/app/views/letter_opener_web/letters/_item.html.erb +10 -0
  25. data/app/views/letter_opener_web/letters/index.html.erb +11 -46
  26. data/config/routes.rb +5 -5
  27. data/letter_opener_web.gemspec +19 -15
  28. data/lib/letter_opener_web/delivery_method.rb +1 -1
  29. data/lib/letter_opener_web/engine.rb +0 -10
  30. data/lib/letter_opener_web/version.rb +1 -1
  31. data/lib/letter_opener_web.rb +1 -0
  32. data/spec/controllers/letter_opener_web/letters_controller_spec.rb +22 -11
  33. data/spec/dummy/app/assets/config/manifest.js +0 -2
  34. data/spec/dummy/app/assets/stylesheets/application.css +0 -16
  35. data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
  36. data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
  37. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  38. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +2 -0
  39. data/spec/dummy/app/jobs/application_job.rb +9 -0
  40. data/spec/dummy/app/models/application_record.rb +5 -0
  41. data/spec/dummy/app/models/concerns/.keep +0 -0
  42. data/spec/dummy/app/views/layouts/application.html.erb +4 -7
  43. data/spec/dummy/bin/rails +2 -4
  44. data/spec/dummy/bin/rake +2 -4
  45. data/spec/dummy/bin/setup +7 -10
  46. data/spec/dummy/config/application.rb +21 -7
  47. data/spec/dummy/config/environments/development.rb +44 -6
  48. data/spec/dummy/config/environments/production.rb +51 -14
  49. data/spec/dummy/config/environments/test.rb +30 -6
  50. data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -4
  51. data/spec/dummy/config/initializers/assets.rb +5 -5
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +5 -3
  53. data/spec/dummy/config/initializers/content_security_policy.rb +29 -0
  54. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  55. data/spec/dummy/config/initializers/permissions_policy.rb +12 -0
  56. data/spec/dummy/config/locales/en.yml +11 -1
  57. data/spec/dummy/config/puma.rb +18 -22
  58. data/spec/dummy/config/routes.rb +1 -4
  59. data/spec/dummy/config.ru +1 -0
  60. data/spec/dummy/public/404.html +6 -6
  61. data/spec/dummy/public/422.html +6 -6
  62. data/spec/dummy/public/500.html +6 -6
  63. data/spec/dummy/storage/.keep +0 -0
  64. data/spec/letter_opener_web_spec.rb +2 -2
  65. data/spec/models/letter_opener_web/letter_spec.rb +62 -17
  66. data/spec/spec_helper.rb +8 -0
  67. metadata +91 -54
  68. data/.travis.yml +0 -26
  69. data/app/assets/javascripts/letter_opener_web/application.js +0 -30
  70. data/app/assets/stylesheets/letter_opener_web/application.css.erb +0 -54
  71. data/bin/rails +0 -11
  72. data/spec/dummy/app/controllers/home_controller.rb +0 -10
  73. data/spec/dummy/app/mailers/contact_mailer.rb +0 -14
  74. data/spec/dummy/app/views/contact_mailer/new_message.html.erb +0 -21
  75. data/spec/dummy/app/views/contact_mailer/new_message.text.erb +0 -3
  76. data/spec/dummy/app/views/home/index.html.erb +0 -50
  77. data/spec/dummy/bin/bundle +0 -5
  78. data/spec/dummy/bin/update +0 -31
  79. data/spec/dummy/config/initializers/new_framework_defaults.rb +0 -10
  80. data/spec/dummy/config/initializers/session_store.rb +0 -5
  81. data/spec/dummy/config/secrets.yml +0 -22
  82. data/spec/dummy/config/spring.rb +0 -8
  83. data/vendor/assets/images/letter_opener_web/blue-dot.ico +0 -0
  84. data/vendor/assets/images/letter_opener_web/glyphicons-halflings-white.png +0 -0
  85. data/vendor/assets/images/letter_opener_web/glyphicons-halflings.png +0 -0
  86. data/vendor/assets/javascripts/letter_opener_web/bootstrap.min.js +0 -6
  87. data/vendor/assets/javascripts/letter_opener_web/jquery-1.8.3.min.js +0 -2
  88. data/vendor/assets/javascripts/letter_opener_web/jquery_ujs.js +0 -429
  89. data/vendor/assets/stylesheets/letter_opener_web/bootstrap.min.css +0 -9
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_opener_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
8
+ - David Muto
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
12
+ date: 2021-11-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: actionmailer
@@ -16,86 +17,114 @@ dependencies:
16
17
  requirements:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: '3.2'
20
+ version: '5.2'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - ">="
25
26
  - !ruby/object:Gem::Version
26
- version: '3.2'
27
+ version: '5.2'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: letter_opener
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '1.0'
34
+ version: '1.7'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '1.0'
41
+ version: '1.7'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: railties
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - ">="
46
47
  - !ruby/object:Gem::Version
47
- version: '3.2'
48
+ version: '5.2'
48
49
  type: :runtime
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
53
  - - ">="
53
54
  - !ruby/object:Gem::Version
54
- version: '3.2'
55
+ version: '5.2'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rexml
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
55
70
  - !ruby/object:Gem::Dependency
56
71
  name: rails
57
72
  requirement: !ruby/object:Gem::Requirement
58
73
  requirements:
59
74
  - - "~>"
60
75
  - !ruby/object:Gem::Version
61
- version: 4.2.0
76
+ version: '6.1'
62
77
  type: :development
63
78
  prerelease: false
64
79
  version_requirements: !ruby/object:Gem::Requirement
65
80
  requirements:
66
81
  - - "~>"
67
82
  - !ruby/object:Gem::Version
68
- version: 4.2.0
83
+ version: '6.1'
69
84
  - !ruby/object:Gem::Dependency
70
85
  name: rspec-rails
71
86
  requirement: !ruby/object:Gem::Requirement
72
87
  requirements:
73
88
  - - "~>"
74
89
  - !ruby/object:Gem::Version
75
- version: '3.0'
90
+ version: '5.0'
76
91
  type: :development
77
92
  prerelease: false
78
93
  version_requirements: !ruby/object:Gem::Requirement
79
94
  requirements:
80
95
  - - "~>"
81
96
  - !ruby/object:Gem::Version
82
- version: '3.0'
97
+ version: '5.0'
83
98
  - !ruby/object:Gem::Dependency
84
99
  name: rubocop
85
100
  requirement: !ruby/object:Gem::Requirement
86
101
  requirements:
87
102
  - - "~>"
88
103
  - !ruby/object:Gem::Version
89
- version: '0.47'
104
+ version: '1.22'
90
105
  type: :development
91
106
  prerelease: false
92
107
  version_requirements: !ruby/object:Gem::Requirement
93
108
  requirements:
94
109
  - - "~>"
95
110
  - !ruby/object:Gem::Version
96
- version: '0.47'
111
+ version: '1.22'
97
112
  - !ruby/object:Gem::Dependency
98
- name: shoulda-matchers
113
+ name: rubocop-rails
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '2.12'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '2.12'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rubocop-rspec
99
128
  requirement: !ruby/object:Gem::Requirement
100
129
  requirements:
101
130
  - - "~>"
@@ -108,30 +137,53 @@ dependencies:
108
137
  - - "~>"
109
138
  - !ruby/object:Gem::Version
110
139
  version: '2.5'
140
+ - !ruby/object:Gem::Dependency
141
+ name: shoulda-matchers
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '5.0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '5.0'
111
154
  description: Gives letter_opener an interface for browsing sent emails
112
155
  email:
113
156
  - fgrehm@gmail.com
157
+ - david.muto@gmail.com
114
158
  executables: []
115
159
  extensions: []
116
160
  extra_rdoc_files: []
117
161
  files:
162
+ - ".github/workflows/brakeman-analysis.yml"
163
+ - ".github/workflows/main.yml"
164
+ - ".github/workflows/release-gem.yml"
118
165
  - ".gitignore"
119
166
  - ".rspec"
120
167
  - ".rubocop.yml"
121
- - ".travis.yml"
168
+ - ".rubocop_todo.yml"
122
169
  - CHANGELOG.md
123
170
  - Gemfile
124
171
  - LICENSE.txt
125
172
  - README.md
126
173
  - Rakefile
127
- - app/assets/javascripts/letter_opener_web/application.js
128
- - app/assets/stylesheets/letter_opener_web/application.css.erb
129
174
  - app/controllers/letter_opener_web/application_controller.rb
130
175
  - app/controllers/letter_opener_web/letters_controller.rb
131
176
  - app/models/letter_opener_web/letter.rb
177
+ - app/views/layouts/letter_opener_web/_javascripts.html.erb
178
+ - app/views/layouts/letter_opener_web/_styles.html.erb
179
+ - app/views/layouts/letter_opener_web/js/_favcount.html.erb
180
+ - app/views/layouts/letter_opener_web/js/_jquery.html.erb
132
181
  - app/views/layouts/letter_opener_web/letters.html.erb
182
+ - app/views/layouts/letter_opener_web/styles/_bootstrap.html.erb
183
+ - app/views/layouts/letter_opener_web/styles/_icon.html.erb
184
+ - app/views/layouts/letter_opener_web/styles/_letters.html.erb
185
+ - app/views/letter_opener_web/letters/_item.html.erb
133
186
  - app/views/letter_opener_web/letters/index.html.erb
134
- - bin/rails
135
187
  - bin/setup
136
188
  - config/routes.rb
137
189
  - letter_opener_web.gemspec
@@ -144,25 +196,23 @@ files:
144
196
  - spec/dummy/Rakefile
145
197
  - spec/dummy/app/assets/config/manifest.js
146
198
  - spec/dummy/app/assets/images/.keep
147
- - spec/dummy/app/assets/javascripts/application.js
148
199
  - spec/dummy/app/assets/stylesheets/application.css
200
+ - spec/dummy/app/channels/application_cable/channel.rb
201
+ - spec/dummy/app/channels/application_cable/connection.rb
149
202
  - spec/dummy/app/controllers/application_controller.rb
150
203
  - spec/dummy/app/controllers/concerns/.keep
151
- - spec/dummy/app/controllers/home_controller.rb
152
204
  - spec/dummy/app/helpers/application_helper.rb
205
+ - spec/dummy/app/javascript/packs/application.js
206
+ - spec/dummy/app/jobs/application_job.rb
153
207
  - spec/dummy/app/mailers/application_mailer.rb
154
- - spec/dummy/app/mailers/contact_mailer.rb
155
- - spec/dummy/app/views/contact_mailer/new_message.html.erb
156
- - spec/dummy/app/views/contact_mailer/new_message.text.erb
157
- - spec/dummy/app/views/home/index.html.erb
208
+ - spec/dummy/app/models/application_record.rb
209
+ - spec/dummy/app/models/concerns/.keep
158
210
  - spec/dummy/app/views/layouts/application.html.erb
159
211
  - spec/dummy/app/views/layouts/mailer.html.erb
160
212
  - spec/dummy/app/views/layouts/mailer.text.erb
161
- - spec/dummy/bin/bundle
162
213
  - spec/dummy/bin/rails
163
214
  - spec/dummy/bin/rake
164
215
  - spec/dummy/bin/setup
165
- - spec/dummy/bin/update
166
216
  - spec/dummy/config.ru
167
217
  - spec/dummy/config/application.rb
168
218
  - spec/dummy/config/boot.rb
@@ -173,18 +223,16 @@ files:
173
223
  - spec/dummy/config/initializers/application_controller_renderer.rb
174
224
  - spec/dummy/config/initializers/assets.rb
175
225
  - spec/dummy/config/initializers/backtrace_silencers.rb
226
+ - spec/dummy/config/initializers/content_security_policy.rb
176
227
  - spec/dummy/config/initializers/cookies_serializer.rb
177
228
  - spec/dummy/config/initializers/filter_parameter_logging.rb
178
229
  - spec/dummy/config/initializers/inflections.rb
179
230
  - spec/dummy/config/initializers/mime_types.rb
180
- - spec/dummy/config/initializers/new_framework_defaults.rb
181
- - spec/dummy/config/initializers/session_store.rb
231
+ - spec/dummy/config/initializers/permissions_policy.rb
182
232
  - spec/dummy/config/initializers/wrap_parameters.rb
183
233
  - spec/dummy/config/locales/en.yml
184
234
  - spec/dummy/config/puma.rb
185
235
  - spec/dummy/config/routes.rb
186
- - spec/dummy/config/secrets.yml
187
- - spec/dummy/config/spring.rb
188
236
  - spec/dummy/lib/assets/.keep
189
237
  - spec/dummy/log/.keep
190
238
  - spec/dummy/public/404.html
@@ -193,18 +241,11 @@ files:
193
241
  - spec/dummy/public/apple-touch-icon-precomposed.png
194
242
  - spec/dummy/public/apple-touch-icon.png
195
243
  - spec/dummy/public/favicon.ico
244
+ - spec/dummy/storage/.keep
196
245
  - spec/letter_opener_web_spec.rb
197
246
  - spec/models/letter_opener_web/letter_spec.rb
198
247
  - spec/rails_helper.rb
199
248
  - spec/spec_helper.rb
200
- - vendor/assets/images/letter_opener_web/blue-dot.ico
201
- - vendor/assets/images/letter_opener_web/glyphicons-halflings-white.png
202
- - vendor/assets/images/letter_opener_web/glyphicons-halflings.png
203
- - vendor/assets/javascripts/letter_opener_web/bootstrap.min.js
204
- - vendor/assets/javascripts/letter_opener_web/favcount.js
205
- - vendor/assets/javascripts/letter_opener_web/jquery-1.8.3.min.js
206
- - vendor/assets/javascripts/letter_opener_web/jquery_ujs.js
207
- - vendor/assets/stylesheets/letter_opener_web/bootstrap.min.css
208
249
  homepage: https://github.com/fgrehm/letter_opener_web
209
250
  licenses:
210
251
  - MIT
@@ -217,15 +258,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
258
  requirements:
218
259
  - - ">="
219
260
  - !ruby/object:Gem::Version
220
- version: '0'
261
+ version: '2.7'
221
262
  required_rubygems_version: !ruby/object:Gem::Requirement
222
263
  requirements:
223
264
  - - ">="
224
265
  - !ruby/object:Gem::Version
225
266
  version: '0'
226
267
  requirements: []
227
- rubyforge_project:
228
- rubygems_version: 2.7.6
268
+ rubygems_version: 3.2.22
229
269
  signing_key:
230
270
  specification_version: 4
231
271
  summary: Gives letter_opener an interface for browsing sent emails
@@ -234,25 +274,23 @@ test_files:
234
274
  - spec/dummy/Rakefile
235
275
  - spec/dummy/app/assets/config/manifest.js
236
276
  - spec/dummy/app/assets/images/.keep
237
- - spec/dummy/app/assets/javascripts/application.js
238
277
  - spec/dummy/app/assets/stylesheets/application.css
278
+ - spec/dummy/app/channels/application_cable/channel.rb
279
+ - spec/dummy/app/channels/application_cable/connection.rb
239
280
  - spec/dummy/app/controllers/application_controller.rb
240
281
  - spec/dummy/app/controllers/concerns/.keep
241
- - spec/dummy/app/controllers/home_controller.rb
242
282
  - spec/dummy/app/helpers/application_helper.rb
283
+ - spec/dummy/app/javascript/packs/application.js
284
+ - spec/dummy/app/jobs/application_job.rb
243
285
  - spec/dummy/app/mailers/application_mailer.rb
244
- - spec/dummy/app/mailers/contact_mailer.rb
245
- - spec/dummy/app/views/contact_mailer/new_message.html.erb
246
- - spec/dummy/app/views/contact_mailer/new_message.text.erb
247
- - spec/dummy/app/views/home/index.html.erb
286
+ - spec/dummy/app/models/application_record.rb
287
+ - spec/dummy/app/models/concerns/.keep
248
288
  - spec/dummy/app/views/layouts/application.html.erb
249
289
  - spec/dummy/app/views/layouts/mailer.html.erb
250
290
  - spec/dummy/app/views/layouts/mailer.text.erb
251
- - spec/dummy/bin/bundle
252
291
  - spec/dummy/bin/rails
253
292
  - spec/dummy/bin/rake
254
293
  - spec/dummy/bin/setup
255
- - spec/dummy/bin/update
256
294
  - spec/dummy/config.ru
257
295
  - spec/dummy/config/application.rb
258
296
  - spec/dummy/config/boot.rb
@@ -263,18 +301,16 @@ test_files:
263
301
  - spec/dummy/config/initializers/application_controller_renderer.rb
264
302
  - spec/dummy/config/initializers/assets.rb
265
303
  - spec/dummy/config/initializers/backtrace_silencers.rb
304
+ - spec/dummy/config/initializers/content_security_policy.rb
266
305
  - spec/dummy/config/initializers/cookies_serializer.rb
267
306
  - spec/dummy/config/initializers/filter_parameter_logging.rb
268
307
  - spec/dummy/config/initializers/inflections.rb
269
308
  - spec/dummy/config/initializers/mime_types.rb
270
- - spec/dummy/config/initializers/new_framework_defaults.rb
271
- - spec/dummy/config/initializers/session_store.rb
309
+ - spec/dummy/config/initializers/permissions_policy.rb
272
310
  - spec/dummy/config/initializers/wrap_parameters.rb
273
311
  - spec/dummy/config/locales/en.yml
274
312
  - spec/dummy/config/puma.rb
275
313
  - spec/dummy/config/routes.rb
276
- - spec/dummy/config/secrets.yml
277
- - spec/dummy/config/spring.rb
278
314
  - spec/dummy/lib/assets/.keep
279
315
  - spec/dummy/log/.keep
280
316
  - spec/dummy/public/404.html
@@ -283,6 +319,7 @@ test_files:
283
319
  - spec/dummy/public/apple-touch-icon-precomposed.png
284
320
  - spec/dummy/public/apple-touch-icon.png
285
321
  - spec/dummy/public/favicon.ico
322
+ - spec/dummy/storage/.keep
286
323
  - spec/letter_opener_web_spec.rb
287
324
  - spec/models/letter_opener_web/letter_spec.rb
288
325
  - spec/rails_helper.rb
data/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- sudo: false
2
- language: ruby
3
-
4
- rvm:
5
- - 2.5.0
6
- - 2.4.3
7
- - 2.3.6
8
- - 2.2.9
9
- - 2.1.10
10
-
11
- cache: bundler
12
-
13
- before_install:
14
- - gem update --system
15
-
16
- notifications:
17
- email: false
18
-
19
- deploy:
20
- provider: rubygems
21
- gem: letter_opener_web
22
- api_key:
23
- secure: Rv1IgeIhnfIV9NVr3iPwb2UCXe0UEtuZHfgkGruu3yvfoSGmQQ0xnc45ZhOH8ANl6tjzYNuilSDYbhz3fWOmniHsnzLGbFbccz/CWHmldUpPgVnKQ0d0Bm2EeNuVpmHwdnG7KEqMC0x1gxFYks62BGpx4C/2Kh5nWbvvPxN8X0U=
24
- on:
25
- tags: true
26
- repo: fgrehm/letter_opener_web
@@ -1,30 +0,0 @@
1
- //= require letter_opener_web/jquery-1.8.3.min
2
- //= require letter_opener_web/jquery_ujs
3
- //= require letter_opener_web/favcount
4
-
5
- function update_favicon(favicon) {
6
- favicon.set($('.letter-opener tbody tr').length);
7
- }
8
-
9
- jQuery(function($) {
10
- var favicon = new Favcount($('link[rel="icon"]').attr('href'));
11
- update_favicon(favicon);
12
-
13
- $('.letter-opener').on('click', 'tbody > tr', function() {
14
- var $this = $(this);
15
- $('iframe').attr('src', $this.find('a').attr('href'));
16
- $this.parent().find('.active').removeClass('active');
17
- $this.addClass('active');
18
- });
19
-
20
- $('.refresh').click(function(e) {
21
- e.preventDefault();
22
-
23
- var table = $('.letter-opener');
24
- table.find('tbody').empty().append('<tr><td colspan="2">Loading...</td></tr>');
25
- table.load(table.data('letters-path') + ' .letter-opener', function() {
26
- $('iframe').attr('src', $('.letter-opener tbody a:first-child()').attr('href'));
27
- update_favicon(favicon);
28
- });
29
- });
30
- });
@@ -1,54 +0,0 @@
1
- /*
2
- *= require letter_opener_web/bootstrap.min
3
- */
4
-
5
- body {
6
- margin: 0
7
- }
8
-
9
- .col {
10
- top: 0;
11
- bottom: 0;
12
- }
13
-
14
- .left {
15
- overflow-y: auto;
16
- width: 400px;
17
- position: absolute;
18
- }
19
-
20
- .right {
21
- left: 400px;
22
- right: 0;
23
- position: fixed;
24
- }
25
-
26
- iframe {
27
- width: 100%;
28
- height: 100%;
29
- position: absolute;
30
- border: solid 1px #ccc;
31
- border-top: none;
32
- }
33
-
34
- h1 {
35
- padding-right: 10px;
36
- padding-left: 5px;
37
- }
38
-
39
- .letter-opener .active,
40
- .letter-opener .active:hover td {
41
- background: #ccc;
42
- }
43
-
44
- .letter-opener tr {
45
- cursor: pointer;
46
- }
47
-
48
- [class^="icon-"], [class*=" icon-"] {
49
- background-image: url(<%=asset_path "letter_opener_web/glyphicons-halflings.png"%>);
50
- }
51
-
52
- .icon-white {
53
- background-image: url(<%=asset_path "letter_opener_web/glyphicons-halflings-white.png"%>);
54
- }
data/bin/rails DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your
5
- # application.
6
-
7
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
8
- ENGINE_PATH = File.expand_path('../../lib/letter_opener_web/engine', __FILE__)
9
-
10
- require 'rails/all'
11
- require 'rails/engine/commands'
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class HomeController < ApplicationController
4
- def index; end
5
-
6
- def create
7
- ContactMailer.new_message(params[:email], params[:message], params[:attachment]).deliver
8
- redirect_to '/', notice: "Email sent successfully, please check letter_opener_web's inbox."
9
- end
10
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ContactMailer < ApplicationMailer
4
- default to: 'admin@letter_opener_web.org', from: 'no-reply@letter_opener_web.org'
5
-
6
- def new_message(from, message, attachment)
7
- @from = from
8
- @message = message
9
-
10
- attachments[attachment.original_filename] = attachment.tempfile.read if attachment.present?
11
-
12
- mail(subject: 'Testing letter_opener_web')
13
- end
14
- end
@@ -1,21 +0,0 @@
1
- <style type="text/css">
2
- label { font-weight: bold; }
3
- .from { color: #888; font-style: italic }
4
- .message { padding-left: 10px; }
5
- .message p:first-child { margin-top: 0; }
6
- </style>
7
-
8
- <h1>New message!</h1>
9
-
10
- <p>
11
- <label>From:</label>
12
- <span class="from"><%= @from %></span>
13
- </p>
14
-
15
- <p>
16
- <label>Message:</label>
17
- </p>
18
-
19
- <div class="message">
20
- <%= simple_format @message %>
21
- </div>
@@ -1,3 +0,0 @@
1
- # New message from: <%= @from %>
2
-
3
- <%= @message %>
@@ -1,50 +0,0 @@
1
- <h1><a href="https://github.com/fgrehm/letter_opener_web">letter_opener_web</a> Demo</h1>
2
-
3
- <div class="row">
4
- <div class="span6 offset3">
5
-
6
- <div class="well">
7
- <%= form_tag root_path, multipart: true do %>
8
- <legend>Contact form</legend>
9
- <div class="control-group">
10
- <label class="control-label" for="email">Email</label>
11
- <div class="controls">
12
- <input type="text" class="input-block-level" name="email">
13
- </div>
14
- </div>
15
- <div class="control-group">
16
- <label class="control-label" for="attachment">Attachment <em>(optional)</em></label>
17
- <div class="controls">
18
- <input type='file' name='attachment' />
19
- </div>
20
- </div>
21
- <div class="control-group">
22
- <label class="control-label" for="message">Message</label>
23
- <div class="controls">
24
- <textarea class="input-block-level" name="message" rows="6"></textarea>
25
- </div>
26
- </div>
27
- <div class="control-group">
28
- <div class="controls">
29
- <button type="submit" class="btn btn-primary pull-right">
30
- <i class="icon-envelope icon-white"></i>
31
- Send mail
32
- </button>
33
- <div class="clearfix"></div>
34
- </div>
35
- </div>
36
- <% end %>
37
-
38
- <p class="footer">
39
- <a href="/letter_opener" target="_blank">Click here</a>
40
- to see sent mails
41
- </p>
42
- </div>
43
-
44
- <% if flash[:notice].present? %>
45
- <div class="alert alert-success">
46
- <%= flash[:notice] %>
47
- </div>
48
- <% end %>
49
- </div>
50
- </div>
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
- load Gem.bin_path('bundler', 'bundle')
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'pathname'
5
- require 'fileutils'
6
- include FileUtils
7
-
8
- # path to your application root.
9
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
10
-
11
- def system!(*args)
12
- system(*args) || abort("\n== Command #{args} failed ==")
13
- end
14
-
15
- chdir APP_ROOT do
16
- # This script is a way to update your development environment automatically.
17
- # Add necessary update steps to this file.
18
-
19
- puts '== Installing dependencies =='
20
- system! 'gem install bundler --conservative'
21
- system('bundle check') || system!('bundle install')
22
-
23
- puts "\n== Updating database =="
24
- system! 'bin/rails db:migrate'
25
-
26
- puts "\n== Removing old logs and tempfiles =="
27
- system! 'bin/rails log:clear tmp:clear'
28
-
29
- puts "\n== Restarting application server =="
30
- system! 'bin/rails restart'
31
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Be sure to restart your server when you modify this file.
4
- #
5
- # This file contains migration options to ease your Rails 5.0 upgrade.
6
- #
7
- # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
-
9
- # Configure SSL options to enable HSTS with subdomains. Previous versions had false.
10
- Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Be sure to restart your server when you modify this file.
4
-
5
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rails secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: a620e35d747d88c5fc8892b46a0fbb32b6b9975b2edcb4aaf1b76a8e46b70cca77d55c55ff1146a14ea9ee91eec9a6a5ebda33745cb5c05a58968d2b318af86b
15
-
16
- test:
17
- secret_key_base: a18afce29fc99e78cd2abf56c7b4bade7bba4da68ca781dbaa3cb53afe9819f6cf0a42667a6d0c9a23bfe34ce070eeaef32f14b67887d25c9333d9371df30ee6
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- %w[
4
- .ruby-version
5
- .rbenv-vars
6
- tmp/restart.txt
7
- tmp/caching-dev.txt
8
- ].each { |path| Spring.watch(path) }