static_error_pages 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00411dbb5dd859970a5b807fd5eedcc9e2b1ac32ee221e86c63f022d72ed9b0d
|
4
|
+
data.tar.gz: b21ac8fe45ae8db2921248da5935afa7687201625d10bc0c77e066c763abf706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36c1c79289e82be0ab494cf43d89a3830fe239052e75fff8b6a7267bc7d376c140e5be14335c058e0642ab29f10d21522396317f0a139522f40544f01251ad16
|
7
|
+
data.tar.gz: cb683c39e9389db84b0ab72689bc3b4e57aaba1fae7b94e88494a502636ff74e08e6ef97d4b0981a179bb094fd0541bccca6590311b063bce1a0bcb82f2fb8ad
|
data/README.md
CHANGED
@@ -28,8 +28,8 @@ Rails initializer / application.rb / environments:
|
|
28
28
|
Rails.application.config.static_error_pages.pages = ["404.html", "500.html", "503.html", "422.html"]
|
29
29
|
|
30
30
|
|
31
|
-
## default layout file = error_pages
|
32
|
-
Rails.application.config.static_error_pages = "
|
31
|
+
## default layout file = layouts/error_pages
|
32
|
+
Rails.application.config.static_error_pages = "error_pages/layout"
|
33
33
|
```
|
34
34
|
|
35
35
|
## Webpacker
|
@@ -0,0 +1,26 @@
|
|
1
|
+
doctype html
|
2
|
+
html lang='de'
|
3
|
+
head
|
4
|
+
meta(http-equiv="Content-Type" content="text/html; charset=utf-8")
|
5
|
+
meta[name="viewport" content="width=device-width, initial-scale=1.0"]
|
6
|
+
meta(name="robots" content="noindex")
|
7
|
+
== stylesheet_link_tag "application", media: 'all'
|
8
|
+
/ if you are using Webpacker maybe you can try:
|
9
|
+
/ - if Rails.env.production?
|
10
|
+
/ = inline_pack_tag 'public.css'
|
11
|
+
/ - else
|
12
|
+
/ = javascript_packs_with_chunks_tag 'public'
|
13
|
+
/ = stylesheet_packs_with_chunks_tag 'public' rescue ""
|
14
|
+
title
|
15
|
+
= @title
|
16
|
+
= ' '
|
17
|
+
|–
|
18
|
+
//link rel="shortcut icon" href=image_path('favicons/icon.ico')
|
19
|
+
body
|
20
|
+
main(style='min-height: 60vh')
|
21
|
+
.container
|
22
|
+
= yield
|
23
|
+
footer
|
24
|
+
|
25
|
+
|
26
|
+
|
@@ -5,7 +5,7 @@ module StaticErrorPages
|
|
5
5
|
# end
|
6
6
|
config.static_error_pages = ActiveSupport::OrderedOptions.new
|
7
7
|
config.static_error_pages.pages = %w(404.html 500.html 503.html 422.html)
|
8
|
-
config.static_error_pages.layout = '
|
8
|
+
config.static_error_pages.layout = 'error_pages'
|
9
9
|
config.to_prepare do
|
10
10
|
ApplicationController.helper(ErrorPagesHelper)
|
11
11
|
end
|
@@ -6,8 +6,13 @@
|
|
6
6
|
namespace :assets do
|
7
7
|
desc "Generate all configured error-pages"
|
8
8
|
task error_pages: :environment do
|
9
|
+
layout = Rails.application.config.static_error_pages.layout
|
9
10
|
Rails.application.config.static_error_pages.pages.each do |file|
|
10
|
-
|
11
|
+
if Rails.env.version >= '7.0.0'
|
12
|
+
out = ApplicationController.renderer.render("error_pages/#{file.remove('.html')}", layout: layout)
|
13
|
+
else
|
14
|
+
out = ApplicationController.renderer.render("error_pages/#{file}", layout: layout)
|
15
|
+
end
|
11
16
|
public_path = Rails.public_path.join(file)
|
12
17
|
File.write(public_path, out)
|
13
18
|
puts "Generated #{file}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_error_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Wienert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- app/views/error_pages/500.html.slim
|
42
42
|
- app/views/error_pages/503.html.slim
|
43
43
|
- app/views/error_pages/layout.html.slim
|
44
|
+
- app/views/layouts/error_pages.html.slim
|
44
45
|
- lib/generators/static_error_pages/copy_generator.rb
|
45
46
|
- lib/static_error_pages.rb
|
46
47
|
- lib/static_error_pages/railtie.rb
|