sitepress-cli 2.0.0.beta2 → 2.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sitepress/cli.rb +9 -5
- data/templates/default/Rakefile +3 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 972c4c266631419fef552bcdef48c3c9f40d4f513f735be2b0199027a21bc95c
|
4
|
+
data.tar.gz: 2cd102dd839bfc154cfc64a51171eed8b1fc6268e5ea4ba939f835757ef43680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6cb15e1b7e6c61eb0732106bbdacbd5f25b6a4a07c0b70120796b9583d65d7432458dc654afda5467f2214dda1ce999f058a700d3d793cd197390a9f663cc14
|
7
|
+
data.tar.gz: 177a3dc4388e84fb45da2bbd5f53f2c48d592941698d27e0ceef7a60705c4bd899f27318c7e2c48f5fc24fd3e63ebaabf7bd5e4c4653dd4fc3e029167e2e625e
|
data/lib/sitepress/cli.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "thor"
|
2
|
-
require_relative "boot"
|
3
2
|
|
4
3
|
module Sitepress
|
5
4
|
# Command line interface for compiling Sitepress sites.
|
@@ -16,7 +15,7 @@ module Sitepress
|
|
16
15
|
option :port, default: SERVER_DEFAULT_PORT, aliases: :p, type: :numeric
|
17
16
|
desc "server", "Run preview server"
|
18
17
|
def server
|
19
|
-
|
18
|
+
initialize!
|
20
19
|
# This will use whatever server is found in the user's Gemfile.
|
21
20
|
Rack::Server.start app: Sitepress::Server,
|
22
21
|
Port: options.fetch("port"),
|
@@ -26,7 +25,7 @@ module Sitepress
|
|
26
25
|
option :output_path, default: COMPILE_DEFAULT_TARGET_PATH, type: :string
|
27
26
|
desc "compile", "Compile project into static pages"
|
28
27
|
def compile
|
29
|
-
|
28
|
+
initialize!
|
30
29
|
# Sprockets compilation
|
31
30
|
logger.info "Sitepress compiling assets"
|
32
31
|
sprockets_manifest(target_path: options.fetch("output_path")).compile precompile_assets
|
@@ -37,7 +36,7 @@ module Sitepress
|
|
37
36
|
|
38
37
|
desc "console", "Interactive project shell"
|
39
38
|
def console
|
40
|
-
|
39
|
+
initialize!
|
41
40
|
# Start's an interactive console.
|
42
41
|
REPL.new(context: configuration).start
|
43
42
|
end
|
@@ -52,7 +51,7 @@ module Sitepress
|
|
52
51
|
|
53
52
|
desc "version", "Show version"
|
54
53
|
def version
|
55
|
-
say
|
54
|
+
say Sitepress::VERSION
|
56
55
|
end
|
57
56
|
|
58
57
|
private
|
@@ -82,5 +81,10 @@ module Sitepress
|
|
82
81
|
def precompile_assets
|
83
82
|
rails.config.assets.precompile
|
84
83
|
end
|
84
|
+
|
85
|
+
def initialize!
|
86
|
+
require_relative "boot"
|
87
|
+
Sitepress::Server.initialize!
|
88
|
+
end
|
85
89
|
end
|
86
90
|
end
|
data/templates/default/Rakefile
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
## Example deployment script to an Amazon Web Servie S3 bucket.
|
2
|
-
|
3
|
-
# Change the s3_url to whatever bucket you'd like to deploy to.
|
4
|
-
s3_url = "s3://<insert-your-s3-bucket-here>/"
|
2
|
+
s3_bucket_name = "<replace-with-your-bucket-name>"
|
5
3
|
|
6
4
|
desc "Remove all files from the build directory"
|
7
5
|
task :clean do
|
@@ -16,12 +14,12 @@ end
|
|
16
14
|
namespace :publish do
|
17
15
|
desc "Upload ./build/assets to S3 with cache-control headers optimized for assets"
|
18
16
|
task :assets do
|
19
|
-
sh "aws s3 sync ./build/assets
|
17
|
+
sh "aws s3 sync ./build/assets s3://#{s3_bucket_name}/assets --cache-control max-age=31536000"
|
20
18
|
end
|
21
19
|
|
22
20
|
desc "Upload ./build to S3"
|
23
21
|
task :pages do
|
24
|
-
sh "aws s3 sync ./build
|
22
|
+
sh "aws s3 sync ./build s3://#{s3_bucket_name} --exclude 'assets/**' --cache-control max-age=60"
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
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.
|
4
|
+
version: 2.0.0.beta3
|
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-
|
11
|
+
date: 2021-02-24 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.
|
19
|
+
version: 2.0.0.beta3
|
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.
|
26
|
+
version: 2.0.0.beta3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|