sitepress-server 2.0.0.beta4 → 2.0.0.beta9

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: 8567b8d08ac01b6d0dcb4799d7f5c8435ed3b59cf9a697202e9d100ee5c8a0f0
4
- data.tar.gz: 61d75485b6231a41e90bf20ead90446c11b513f9f800a58b4f6cfaf8a9d734a2
3
+ metadata.gz: d9a860d8250bc0e84dcd58fbf28eb1c675466351ee0b76f79c608155966223eb
4
+ data.tar.gz: 6ead09663617b77ebd85fdeb324c409b539a2a4044d68384d9df62656372cbb0
5
5
  SHA512:
6
- metadata.gz: ada9c60cae152932c9084cea25d9daa66fa575b6b96f893560c7a5e7f40f91d38a42455eebf5987d75e21431139369f96af90b4c3a04a286c88ea73ebde11568
7
- data.tar.gz: 194f72f6fa16658903d72f2184a2c1bc2cbd7e58a3bbfdfbdc4b040edad3061e2c7de9716947f54409c8309bbf98d0c8db0c6e758dac6cf7ed10a8796288a1a8
6
+ metadata.gz: d61d2ca79a1bd962d7304e6597e244615771b807163381d3cfbc11e2ca34ceb2700380178c92c9ca4aaf9fcecee531b7504e370943855dda2609e5d042436fed
7
+ data.tar.gz: bc678cf7eafc9ca4a8595ab9c46dee49620ddeab3209d61c8a1b0429e9d0d46dd9686114e89303c52ab8e0818ca74469ef606589ee0ceeb8c8b9671d07905b9b
@@ -41,6 +41,9 @@ module Sitepress
41
41
  # Allow any host to connect to the development server. The actual binding is
42
42
  # controlled by server in the `sitepress-cli`; not by Rails.
43
43
  config.hosts << proc { true } if config.respond_to? :hosts
44
+
45
+ # Stand-alone boot locations
46
+ paths["config/initializers"] << File.expand_path("./config/initializers")
44
47
  end
45
48
  end
46
49
 
@@ -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
@@ -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.beta4
4
+ version: 2.0.0.beta9
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-02-24 00:00:00.000000000 Z
11
+ date: 2021-06-01 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.beta4
33
+ version: 2.0.0.beta9
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.beta4
40
+ version: 2.0.0.beta9
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.2.3
80
+ rubygems_version: 3.1.4
80
81
  signing_key:
81
82
  specification_version: 4
82
83
  summary: Sitepress rack app for stand-alone of embedded usage.