sitepress-cli 3.2.2 → 4.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sitepress/cli.rb +27 -5
  3. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e0ed6494edcbfb46658a184d592c0a049e99b5a4766b8e70a16e27ec972a489
4
- data.tar.gz: 28f35d68e83f97b45972803b1388ddd051aa8ebec70101097a0a2bcd9a239934
3
+ metadata.gz: 997080538674d3f5d49b5e48e1696123d2045120824f3f0715f524720f8a0fad
4
+ data.tar.gz: 7dc51220785129d6809fbf8d404538b9474ccf63a2ed6315e4fb3082bc92293b
5
5
  SHA512:
6
- metadata.gz: 3e89ed29be553ff75ae81dd1dc022b5dd58d98a297acb978c4d85d973a03f4ee500aa62864c6985f1cec3126fb705731ff9a2a792e397a3dd56fbd70154b1c6f
7
- data.tar.gz: b8693e2d4af7d9d4e1f51fe62c797f5a7ba481744c214010c1e7ef3abf8db32245a2a1450d327f4056bf78f370d57f0cdd171421752c21b6dc612daf9bf4f607
6
+ metadata.gz: a2022a514e0b1e18da249e39db415e0cf0d8bda50d0412d4bed3c5fb1b93d0026c29d8ca2a2850c45eb1870aee0be76aae77c079334462dc10d6bd5f16826bef
7
+ data.tar.gz: '08ee98dd20c0f9ff26f1f3361ec74f15ad137f13850496861d7d4240cf6422bc42dc979e2717fc94823850439b29c379774495b4e4573c865809461f827b05f5'
data/lib/sitepress/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Sitepress
7
7
  SERVER_PORT = 8080
8
8
 
9
9
  # Default address is public to all IPs.
10
- SERVER_BIND_ADDRESS = "0.0.0.0".freeze
10
+ SERVER_BIND_ADDRESS = "127.0.0.1".freeze
11
11
 
12
12
  # Default build path for compiler.
13
13
  COMPILE_TARGET_PATH = "./build".freeze
@@ -48,15 +48,37 @@ module Sitepress
48
48
  end
49
49
 
50
50
  option :output_path, default: COMPILE_TARGET_PATH, type: :string
51
+ option :fail_on_error, default: false, type: :boolean
51
52
  desc "compile", "Compile project into static pages"
52
53
  def compile
53
54
  initialize!
54
- # Page compilation
55
- logger.info "Sitepress compiling pages"
56
- Compiler.new(site: configuration.site, root_path: options.fetch("output_path")).compile
57
- # Sprockets compilation
55
+
58
56
  logger.info "Sitepress compiling assets"
59
57
  sprockets_manifest(target_path: options.fetch("output_path")).compile precompile_assets
58
+
59
+ logger.info "Sitepress compiling pages"
60
+ compiler = Compiler::Files.new \
61
+ site: configuration.site,
62
+ root_path: options.fetch("output_path"),
63
+ fail_on_error: options.fetch("fail_on_error")
64
+
65
+ begin
66
+ compiler.compile
67
+ ensure
68
+ logger.info ""
69
+ logger.info "Compilation Summary"
70
+ logger.info " Build path: #{compiler.root_path.expand_path}"
71
+ logger.info " Succeeded: #{compiler.succeeded.count}"
72
+ logger.info " Failed: #{compiler.failed.count}"
73
+ if compiler.failed.any?
74
+ logger.info ""
75
+ logger.info "Failed Resources"
76
+ compiler.failed.each do |resource|
77
+ logger.info " #{resource.request_path} #{resource.asset.path}"
78
+ end
79
+ abort # We want a non-zero exit code so we can fail CI pipelines, etc.
80
+ end
81
+ end
60
82
  end
61
83
 
62
84
  desc "console", "Interactive project shell"
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: 3.2.2
4
+ version: 4.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-11 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.2.2
47
+ version: 4.0.0.beta1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.2.2
54
+ version: 4.0.0.beta1
55
55
  description:
56
56
  email:
57
57
  - bradgessler@gmail.com
@@ -98,11 +98,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ">"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.1
104
104
  requirements: []
105
- rubygems_version: 3.4.1
105
+ rubygems_version: 3.4.6
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Sitepress command line interface and compilation tools for static site.