sitepress-server 2.0.0.beta6 → 2.0.0.beta10

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: c8f502dabde995c936e371e21b6465827e15eca2ca6a149d18b7fc8b233e6780
4
- data.tar.gz: 229492f6240a8e7f14028ff5c13c7446156ec4c41f125c4ed3e6e6c0a24cb5ea
3
+ metadata.gz: 745fe817bb47d178b9346c2448c1ac9444e1372a53e1d13d7309b1d3d7023d47
4
+ data.tar.gz: 2d5e03cb231faf1c40b7dc47e5de3a56cd04e6ab35155233d9ef37b8c6162f4d
5
5
  SHA512:
6
- metadata.gz: aba2f5f93122baa8a568634c44d92f878a41340447376ffd33af861730a00fa061d0533a4085f82b1847c1cb3b1e5b17ca182a9337f0b1fd70aed1059809904a
7
- data.tar.gz: dbb4ad4907f72e2deb82416d0533e3eb1e64787b370acc86031e3a0f23b9f7821b7f506a37d4cea78760ce8eaa912ffff1d798f7a77dbd447f47e126c249a404
6
+ metadata.gz: 97ffaba70f6e897bbcf0946255ee240cd952f3b55223164cd445f850d82791b53e6fd72f306d37aaee3c10055e5bdcd956ba89c5ee6102e820aa335b985ba71c
7
+ data.tar.gz: 2a84e307d94d257d7a2d95a0a9ccacae23854e08d1772c499ab9d06db325b545cc6408a906d7a6fec2c3631b1c66810584a94b36da78661662c6180340dd148a
@@ -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.beta6
4
+ version: 2.0.0.beta10
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-03-05 00:00:00.000000000 Z
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.beta6
33
+ version: 2.0.0.beta10
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.beta6
40
+ version: 2.0.0.beta10
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: []