sitepress-cli 5.0.0.beta → 5.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sitepress/cli.rb +26 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf31d9c87fc8a37a6ab14dbf9257c9d46214dd3cdd9e65851de260f83678d2d3
|
|
4
|
+
data.tar.gz: 1275820f4e4a076d38bd75677e16622f6c5403245fe18890705079cc9b796ecb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 579099d5acb5bd058993d54cfefca63d754cf87677bef40da7eac9774cc143ed073b0ed5b321cd263f35b7811c240760d1123c4fd07a96db4d18d1ea67b0ed03
|
|
7
|
+
data.tar.gz: c4ef3651327b8244460a679ab1781d3429cfb7d0d412fa219139a4c4889c5e6b7d25ae304341b018f4cea687e8c72239372fbff8d3a9024d1753452ab1fc4ffa
|
data/lib/sitepress/cli.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "thor"
|
|
2
2
|
require "rackup/server"
|
|
3
|
+
require "fileutils"
|
|
3
4
|
|
|
4
5
|
module Sitepress
|
|
5
6
|
# Command line interface for compiling Sitepress sites.
|
|
@@ -55,7 +56,7 @@ module Sitepress
|
|
|
55
56
|
initialize!
|
|
56
57
|
|
|
57
58
|
logger.info "Sitepress compiling assets"
|
|
58
|
-
|
|
59
|
+
compile_assets(Pathname.new(options.fetch("output_path")).join("assets"))
|
|
59
60
|
|
|
60
61
|
logger.info "Sitepress compiling pages"
|
|
61
62
|
compiler = Compiler::Files.new \
|
|
@@ -107,6 +108,30 @@ module Sitepress
|
|
|
107
108
|
end
|
|
108
109
|
|
|
109
110
|
private
|
|
111
|
+
def compile_assets(output_path)
|
|
112
|
+
assets = rails.assets
|
|
113
|
+
|
|
114
|
+
if defined?(Propshaft) && assets.is_a?(Propshaft::Assembly)
|
|
115
|
+
# Propshaft - create processor with our output path
|
|
116
|
+
FileUtils.mkdir_p(output_path)
|
|
117
|
+
processor = Propshaft::Processor.new(
|
|
118
|
+
load_path: assets.load_path,
|
|
119
|
+
output_path: output_path,
|
|
120
|
+
compilers: assets.compilers,
|
|
121
|
+
manifest_path: output_path.join(".manifest.json")
|
|
122
|
+
)
|
|
123
|
+
processor.process
|
|
124
|
+
elsif defined?(Sprockets) && assets.class.name.start_with?("Sprockets::")
|
|
125
|
+
# Sprockets - compile assets from precompile list
|
|
126
|
+
FileUtils.mkdir_p(output_path)
|
|
127
|
+
manifest = Sprockets::Manifest.new(assets, output_path)
|
|
128
|
+
precompile = rails.config.assets.precompile
|
|
129
|
+
manifest.compile(precompile)
|
|
130
|
+
else
|
|
131
|
+
logger.warn "Unknown asset pipeline, skipping asset compilation"
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
110
135
|
def configuration
|
|
111
136
|
Sitepress.configuration
|
|
112
137
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sitepress-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0.0.
|
|
4
|
+
version: 5.0.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brad Gessler
|
|
@@ -43,14 +43,14 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - '='
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 5.0.0.
|
|
46
|
+
version: 5.0.0.beta1
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - '='
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 5.0.0.
|
|
53
|
+
version: 5.0.0.beta1
|
|
54
54
|
email:
|
|
55
55
|
- bradgessler@gmail.com
|
|
56
56
|
executables: []
|