sitepress-cli 2.0.0.beta7 → 2.0.0.beta8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sitepress/cli.rb +18 -9
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c2555bfa5a3aaeb17b33521a2583aeea366082c00ee011ffd216dc7f6fb848
4
- data.tar.gz: ec9f1eddd9aebd824f17d788277c079cc01ec03eabb025fdcbe3ebcbd5595c4f
3
+ metadata.gz: 8e88075f3146145e2ab83862152fd7f47b51900845c61e33c31feb025c33ee1a
4
+ data.tar.gz: fbe88a32965034c1552815f109eed3b9220d747c63c4c597646e30ffa64b6367
5
5
  SHA512:
6
- metadata.gz: d4635e94087861bf3d20512ec9d821c284ee92a79f35d1410ee6070b1f0bfae1e246d57ec89ebd698e539ccc00d96621dbc6664ce877bacf48782af634e1842d
7
- data.tar.gz: 4fa9758a918aa4ec1f0f96e3507d9a68568030323d517104b2d26189a7209fda23c44a0dde11b3414df6f94203b82fdf328320e475124cdb656cebfa031e9d82
6
+ metadata.gz: 989aa1de0a38a52686b18c91529d2c355b5223a93c6038c26c6a31c200cdb9445355ddff13268febc0581cd31fdb57f4bf77565760a895e887e25963e74f08a6
7
+ data.tar.gz: 7c0afba920b75d42e6e1379bfb198c34a9140bbf9e88ff24bdbdf3648451ef8a4f362123d82bd311465b1f98c9a9f12a23a7ff20ab1c271cf55c211a1567e9f9
data/lib/sitepress/cli.rb CHANGED
@@ -16,8 +16,13 @@ module Sitepress
16
16
  desc "server", "Run preview server"
17
17
  def server
18
18
  initialize!
19
+ # Enable Sitepress web error reporting so users have more friendly
20
+ # error messages instead of seeing a Rails exception.
21
+ controller.enable_sitepress_error_reporting = true
22
+ # Enable reloading the site between requests so we can see changes.
23
+ controller.enable_site_reloading = true
19
24
  # This will use whatever server is found in the user's Gemfile.
20
- Rack::Server.start app: Sitepress::Server,
25
+ Rack::Server.start app: app,
21
26
  Port: options.fetch("port"),
22
27
  Host: options.fetch("bind_address")
23
28
  end
@@ -26,12 +31,12 @@ module Sitepress
26
31
  desc "compile", "Compile project into static pages"
27
32
  def compile
28
33
  initialize!
34
+ # Page compilation
35
+ logger.info "Sitepress compiling pages"
36
+ Compiler.new(site: configuration.site, root_path: options.fetch("output_path")).compile
29
37
  # Sprockets compilation
30
38
  logger.info "Sitepress compiling assets"
31
39
  sprockets_manifest(target_path: options.fetch("output_path")).compile precompile_assets
32
- # Page compilation
33
- logger.info "Sitepress compiling pages"
34
- compiler.compile target_path: options.fetch("output_path")
35
40
  end
36
41
 
37
42
  desc "console", "Interactive project shell"
@@ -63,10 +68,6 @@ module Sitepress
63
68
  Sitepress.configuration
64
69
  end
65
70
 
66
- def compiler
67
- Compiler.new(site: configuration.site)
68
- end
69
-
70
71
  def sprockets_manifest(target_path: )
71
72
  target_path = Pathname.new(target_path)
72
73
  Sprockets::Manifest.new(rails.assets, target_path.join("assets/manifest.json")).tap do |manifest|
@@ -88,7 +89,15 @@ module Sitepress
88
89
 
89
90
  def initialize!
90
91
  require_relative "boot"
91
- Sitepress::Server.initialize!
92
+ app.initialize!
93
+ end
94
+
95
+ def controller
96
+ ::SiteController
97
+ end
98
+
99
+ def app
100
+ Sitepress::Server
92
101
  end
93
102
  end
94
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitepress-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta7
4
+ version: 2.0.0.beta8
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-15 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sitepress-server
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0.beta7
19
+ version: 2.0.0.beta8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0.beta7
26
+ version: 2.0.0.beta8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement