nanoc-cli 4.12.0 → 4.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b235b7ea0a271b804d4e7a074af5acacec702cb48d06a4fc8ece9616c9a348dc
4
- data.tar.gz: 2a30027b40d53a02853f458f56eb8397eaeaa264f372997eef1d1017d2daf389
3
+ metadata.gz: 9d5a799c008340791d94c5e37eb15d38f6ed571a13fd9e341e8ac8fc47ba2d76
4
+ data.tar.gz: ce4f61ba1095823cd9f9257ad73842055abb3e908745fc8840fe983f463081bc
5
5
  SHA512:
6
- metadata.gz: 5256002ad3a90cffd6d56956ab8f62424e7ff86d07991e357289748919cd1a7f527f6569f1a7a9298de0ae1b6188c230a014ceec6c140599cd67493ad4853602
7
- data.tar.gz: 199c28de12ebb0d778f78e021d37168ae377d388c2664347f3af3af87056268beae119b4a0ddcef78386d0f9685c9e8571ee3e8dd7d823e4c212da631d77249c
6
+ metadata.gz: 2bd59730dd8d63734eb850c31eacbba8d49bbba0f1f4c78b7b3ff987003c45d492529d5620695d08f33cb856bcd5decedc50042027e6933aa878e9561a27c6b7
7
+ data.tar.gz: 6f2f6a7253fa17e608d82e90f12a257c494bb3d7445bb87daa3633baf659f53704cc944606bb085d394bdde317211a55b1b8c1f69bc386d9c188772110cdf971
@@ -114,15 +114,9 @@ module Nanoc::CLI
114
114
  stream.puts
115
115
  stream.puts 'Captain! We’ve been hit!'
116
116
 
117
- if forwards_stack_trace?
118
- write_stack_trace(stream, error)
119
- write_error_message(stream, error)
120
- write_item_rep(stream, error)
121
- else
122
- write_error_message(stream, error)
123
- write_item_rep(stream, error)
124
- write_stack_trace(stream, error)
125
- end
117
+ write_error_message(stream, error)
118
+ write_item_rep(stream, error)
119
+ write_stack_trace(stream, error)
126
120
 
127
121
  stream.puts
128
122
  stream.puts 'A detailed crash log has been written to ./crash.log.'
@@ -148,11 +142,6 @@ module Nanoc::CLI
148
142
  write_load_paths(stream, verbose: true)
149
143
  end
150
144
 
151
- # @api private
152
- def forwards_stack_trace?
153
- ruby_version.start_with?('2.5')
154
- end
155
-
156
145
  # @api private
157
146
  def trivial?(error)
158
147
  case error
@@ -316,7 +305,7 @@ module Nanoc::CLI
316
305
  def write_stack_trace(stream, error, verbose: false)
317
306
  write_section_header(stream, 'Stack trace', verbose: verbose)
318
307
 
319
- writer = Nanoc::CLI::StackTraceWriter.new(stream, forwards: forwards_stack_trace?)
308
+ writer = Nanoc::CLI::StackTraceWriter.new(stream)
320
309
  writer.write(unwrap_error(error), verbose: verbose)
321
310
  end
322
311
 
@@ -3,22 +3,11 @@
3
3
  module Nanoc
4
4
  module CLI
5
5
  class StackTraceWriter
6
- def initialize(stream, forwards:)
6
+ def initialize(stream)
7
7
  @stream = stream
8
- @forwards = forwards
9
8
  end
10
9
 
11
10
  def write(error, verbose:)
12
- if @forwards
13
- write_forwards(error, verbose: verbose)
14
- else
15
- write_backwards(error, verbose: verbose)
16
- end
17
- end
18
-
19
- private
20
-
21
- def write_backwards(error, verbose:)
22
11
  count = verbose ? -1 : 10
23
12
 
24
13
  error.backtrace[0...count].each_with_index do |item, index|
@@ -29,23 +18,6 @@ module Nanoc
29
18
  @stream.puts " ... #{error.backtrace.size - count} lines omitted (see crash.log for details)"
30
19
  end
31
20
  end
32
-
33
- def write_forwards(error, verbose:)
34
- count = 10
35
- backtrace = verbose ? error.backtrace : error.backtrace.take(count)
36
-
37
- if !verbose && error.backtrace.size > count
38
- @stream.puts " ... #{error.backtrace.size - count} lines omitted (see crash.log for details)"
39
- end
40
-
41
- backtrace.each_with_index.to_a.reverse_each do |(item, index)|
42
- if index.zero?
43
- @stream.puts " #{item}"
44
- else
45
- @stream.puts " #{index}. from #{item}"
46
- end
47
- end
48
- end
49
21
  end
50
22
  end
51
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module CLI
5
- VERSION = '4.12.0'
5
+ VERSION = '4.12.1'
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.0
4
+ version: 4.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-20 00:00:00.000000000 Z
11
+ date: 2021-04-05 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.0
47
+ version: 4.12.1
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.0
54
+ version: 4.12.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: zeitwerk
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.2.11
123
+ rubygems_version: 3.2.15
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: CLI for Nanoc