nanoc-cli 4.12.17 → 4.12.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84630fa2f9d314d2d20c7b1b268070250b20a8589e3135f4bfa7c059fe4ab22c
4
- data.tar.gz: d85a5fa4219daad3c3f6c9ae96b955fdc7d55eccee1c4bc24f6b55a658c736e4
3
+ metadata.gz: a837e1bc9ebbade268dd165c7fea6d551520bd26083cf777b1586c3dcf771261
4
+ data.tar.gz: 977c932db09b82c073be56727b3b1cc63b39d9f534ee93aa34682f9cc22ead9f
5
5
  SHA512:
6
- metadata.gz: 615ed3e9ba9cb7f3a2d57ae4fc3f531cc5f821244b85d8168ff81dd4fadf7a3d5e82c3e3fd7bf22f9438ba754c87e23a45ea27030f8dd04ae94bb57ed6406a6e
7
- data.tar.gz: ce24b3cfaecd54e0de73c28bed0601944d958ea4667d6383aa4effdb6165bd0ac1b8c91c0658a983c9681b2cfd4bcbab61fe3c884fdcb1dc296dea3816e338d5
6
+ metadata.gz: 125c32030a89fef60e28e918eadf4f7f8c51386737a95d26e2da05fa0fdaccd2878918754509cad4bbe21f2c5bdb11c8a708f437ec6382b8362985b7988533c7
7
+ data.tar.gz: ba043a3e44e9bafa329e74ccd17cb6683e04e02f73daa310cf12e52d1b7f18280033e3b838b36585bf8e5289de65661d6a903c12508c9fab54d86fa045e0077b
@@ -18,6 +18,14 @@ module Nanoc::CLI::Commands
18
18
  end
19
19
  end
20
20
 
21
+ DEFAULT_GEMFILE = <<~EOS unless defined? DEFAULT_GEMFILE
22
+ # frozen_string_literal: true
23
+
24
+ source 'https://rubygems.org'
25
+
26
+ gem 'nanoc', '~> #{Nanoc::CLI::VERSION.split('.').take(2).join('.')}'
27
+ EOS
28
+
21
29
  DEFAULT_CONFIG = <<~EOS unless defined? DEFAULT_CONFIG
22
30
  # A list of file extensions that Nanoc will consider to be textual rather than
23
31
  # binary. If an item with an extension not in this list is found, the file
@@ -54,15 +62,13 @@ module Nanoc::CLI::Commands
54
62
  # layout '/default.*'
55
63
  #
56
64
  # if item.identifier =~ '**/index.*'
57
- # write item.identifier.to_s
65
+ # write item.identifier.without_ext + '.html'
58
66
  # else
59
67
  # write item.identifier.without_ext + '/index.html'
60
68
  # end
61
69
  #end
62
70
 
63
- compile '/**/*' do
64
- write item.identifier.to_s
65
- end
71
+ passthrough '/**/*'
66
72
 
67
73
  layout '/**/*', :erb
68
74
  EOS
@@ -240,6 +246,7 @@ module Nanoc::CLI::Commands
240
246
  FileUtils.mkdir_p('lib')
241
247
  FileUtils.mkdir_p('output')
242
248
 
249
+ write('Gemfile', DEFAULT_GEMFILE)
243
250
  write('nanoc.yaml', DEFAULT_CONFIG)
244
251
  write('Rules', DEFAULT_RULES)
245
252
  write('content/index.html', DEFAULT_ITEM)
@@ -38,7 +38,7 @@ module Nanoc::CLI
38
38
  %w[INT TERM].each do |signal|
39
39
  Signal.trap(signal) do
40
40
  puts
41
- exit!(0)
41
+ exit(0)
42
42
  end
43
43
  end
44
44
 
@@ -55,10 +55,21 @@ module Nanoc::CLI
55
55
 
56
56
  # Run
57
57
  yield
58
- rescue Interrupt
59
- exit(1)
60
- rescue StandardError, ScriptError => e
61
- handle_error(e, exit_on_error: exit_on_error)
58
+ rescue Exception => e # rubocop:disable Lint/RescueException
59
+ # The exception could be wrapped in a
60
+ # Nanoc::Core::Errors::CompilationError, so find the
61
+ # underlying exception and handle that one instead.
62
+ e = unwrap_error(e)
63
+
64
+ case e
65
+ when Interrupt
66
+ puts
67
+ exit(1)
68
+ when StandardError, ScriptError
69
+ handle_error(e, exit_on_error: exit_on_error)
70
+ else
71
+ raise e
72
+ end
62
73
  end
63
74
 
64
75
  def handle_error(error, exit_on_error:)
@@ -131,7 +142,7 @@ module Nanoc::CLI
131
142
  #
132
143
  # @return [void]
133
144
  def write_verbose_error(error, stream)
134
- stream.puts "Crashlog created at #{Time.now}"
145
+ stream.puts "Crash log created at #{Time.now}"
135
146
 
136
147
  write_error_message(stream, error, verbose: true)
137
148
  write_error_detail(stream, error)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module CLI
5
- VERSION = '4.12.17'
5
+ VERSION = '4.12.19'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.17
4
+ version: 4.12.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-30 00:00:00.000000000 Z
11
+ date: 2023-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.12.17
47
+ version: 4.12.19
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: 4.12.17
54
+ version: 4.12.19
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: zeitwerk
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +106,7 @@ licenses:
106
106
  - MIT
107
107
  metadata:
108
108
  rubygems_mfa_required: 'true'
109
+ source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-cli-v4.12.19/nanoc-cli
109
110
  post_install_message:
110
111
  rdoc_options: []
111
112
  require_paths:
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.4.20
125
+ rubygems_version: 3.4.22
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: CLI for Nanoc