sitepress-server 2.0.0.beta7 → 2.0.0.beta11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/rails/app/controllers/site_controller.rb +22 -0
- data/sitepress-server.gemspec +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabdd388eeb0f7c6f779495da965dcc89ea576db9674c2a792baa41268580499
|
4
|
+
data.tar.gz: 414458d02df865671b06dcac9fbd00ce249b24a936e01208a59b195fe50a6c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f861beb3b534249cae687c26e1f013eefe520afaaf8d18a6a5956906c3b4f2594e818c61b0aed386cfee3644e991ae23d58b0a407b1c9c7e225602f3fa7e911
|
7
|
+
data.tar.gz: eff80e63098a50852e24eca066e69a97d091f09341a7b00a7923af27bd19a05c7853cf6e7a03541bcdcf17dc5cb3a2cee82261983569ce94e468a6ed99e794b3
|
@@ -1,6 +1,16 @@
|
|
1
1
|
class SiteController < ApplicationController
|
2
2
|
DEFAULT_SITE_LAYOUT = "layouts/layout".freeze
|
3
3
|
|
4
|
+
# Control whether or not to display friendly error reporting messages
|
5
|
+
# in Sitepress. The development server turns this on an handles exception,
|
6
|
+
# while the compile and other environments would likely have this disabled.
|
7
|
+
class_attribute :enable_sitepress_error_reporting, default: false
|
8
|
+
|
9
|
+
# When in a development environment, we'll want to reload the site between
|
10
|
+
# requests so we can see the latest changes; otherwise, load the site once
|
11
|
+
# and we're done.
|
12
|
+
class_attribute :enable_site_reloading, default: false
|
13
|
+
|
4
14
|
# This `rescue_from` order is important; it must come before the
|
5
15
|
# `include Sitepress::SitePages` statement; otherwise exceptions
|
6
16
|
# won't be properly handled.
|
@@ -16,13 +26,25 @@ class SiteController < ApplicationController
|
|
16
26
|
end
|
17
27
|
|
18
28
|
def sitepress_error(exception)
|
29
|
+
raise exception unless has_error_reporting_enabled?
|
30
|
+
|
19
31
|
@title = "Sitepress error in #{current_page.asset.path}".html_safe
|
20
32
|
@exception = exception
|
21
33
|
render "error", layout: "sitepress", status: :internal_server_error
|
22
34
|
end
|
23
35
|
|
24
36
|
def page_not_found(exception)
|
37
|
+
raise exception unless has_error_reporting_enabled?
|
38
|
+
|
25
39
|
@title = "Sitepress page #{params[:resource_path].inspect} not found"
|
26
40
|
render "page_not_found", layout: "sitepress", status: :not_found
|
27
41
|
end
|
42
|
+
|
43
|
+
def has_error_reporting_enabled?
|
44
|
+
self.class.enable_sitepress_error_reporting
|
45
|
+
end
|
46
|
+
|
47
|
+
def reload_site?
|
48
|
+
self.class.enable_site_reloading
|
49
|
+
end
|
28
50
|
end
|
data/sitepress-server.gemspec
CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Sitepress::VERSION
|
9
9
|
spec.authors = ["Brad Gessler"]
|
10
10
|
spec.email = ["bradgessler@gmail.com"]
|
11
|
+
spec.licenses = ["MIT"]
|
11
12
|
|
12
13
|
spec.summary = %q{Sitepress rack app for stand-alone of embedded usage.}
|
13
14
|
spec.homepage = "https://github.com/sitepress/sitepress"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitepress-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-test
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0.0.
|
33
|
+
version: 2.0.0.beta11
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.0.0.
|
40
|
+
version: 2.0.0.beta11
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- bradgessler@gmail.com
|
@@ -59,7 +59,8 @@ files:
|
|
59
59
|
- rails/public/_sitepress/stylesheets/site.css
|
60
60
|
- sitepress-server.gemspec
|
61
61
|
homepage: https://github.com/sitepress/sitepress
|
62
|
-
licenses:
|
62
|
+
licenses:
|
63
|
+
- MIT
|
63
64
|
metadata: {}
|
64
65
|
post_install_message:
|
65
66
|
rdoc_options: []
|
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: 1.3.1
|
78
79
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
80
|
+
rubygems_version: 3.2.3
|
80
81
|
signing_key:
|
81
82
|
specification_version: 4
|
82
83
|
summary: Sitepress rack app for stand-alone of embedded usage.
|