nanoc-cli 4.12.6 → 4.12.8

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: 65f010327ca9770031b34396d587082db1c4934a0e7da2af29cb6597a5f5fbdf
4
- data.tar.gz: d5f6f75d0dba3b2f39aa594f1b44242171d8a3793b005fde48f388f031f0ad11
3
+ metadata.gz: 7b1cf68ac090fa2dd06e13f442217c6cccc371758ea21d07a11a21135520d94c
4
+ data.tar.gz: 95aacadb615bc66b00e11e1ee041acea4cda3c2b3f870a6c06cc6d3e498a2195
5
5
  SHA512:
6
- metadata.gz: a4ed845a9bab1a9d198667490d63f8d4c2c58c2e84012b87b26d1e4a4a8ba7b17cbdafaaa052bfcc5bfa43b96858caa3bc039f9cbce6b22e9bc0b8c50a5c55ec
7
- data.tar.gz: f66ef629652bd98e01f1f1a9e56d49b3714f5906af7685f132d0efcd213ab5b225b290f384c7444de7ce83e1804a82759ec64de629210b3da3a258281ee8bec8
6
+ metadata.gz: 18d3bf2e0818f3271296fac135710b482836838ec5eb937ff60078d97971d2d71a795d8d53f9a27608d7ecc7c78ae62d57e1479c0fd5c344ad69abfd04cc08b4
7
+ data.tar.gz: b028da04b55c9078be38662afedfe43bbe5ca35b7c128e4f7134f385d5c23f23fbcb4a854903a25ff58fe49ae3a68eb02b3b7a8e21b74ecfe02d1e84069ed1df
@@ -33,7 +33,7 @@ module Nanoc
33
33
  #
34
34
  # @return [void]
35
35
  def remove_stream_cleaner(klass)
36
- @stream_cleaners.delete_if { |c| c.class == klass }
36
+ @stream_cleaners.delete_if { |c| c.instance_of?(klass) }
37
37
  end
38
38
 
39
39
  # @group IO proxy methods
@@ -139,11 +139,9 @@ module Nanoc
139
139
  end
140
140
 
141
141
  # @see ARGF.set_encoding
142
- # rubocop:disable Naming/AccessorMethodName
143
142
  def set_encoding(*args)
144
143
  @stream.set_encoding(*args)
145
144
  end
146
- # rubocop:enable Naming/AccessorMethodName
147
145
 
148
146
  protected
149
147
 
@@ -4,11 +4,11 @@ usage 'view [options]'
4
4
  summary 'start the web server that serves static files'
5
5
  description <<~EOS
6
6
  Start the static web server. Unless specified, the web server will run on port
7
- 3000 and listen on all IP addresses. Running this static web server requires
7
+ 3000 and listen 127.0.0.1. Running this static web server requires
8
8
  `adsf` (not `asdf`!).
9
9
  EOS
10
10
 
11
- required :H, :handler, 'specify the handler to use (webrick/mongrel/...)'
11
+ required :H, :handler, 'specify the handler to use (webrick/puma/...)'
12
12
  required :o, :host, 'specify the host to listen on (default: 127.0.0.1)', default: '127.0.0.1'
13
13
  required :p, :port, 'specify the port to listen on (default: 3000)', transform: Nanoc::CLI::Transform::Port, default: 3000
14
14
  flag :L, :'live-reload', 'reload on changes'
@@ -28,17 +28,15 @@ module Nanoc::CLI::CompileListeners
28
28
  prev_hunk = hunk = nil
29
29
  file_length_difference = 0
30
30
  diffs.each do |piece|
31
- begin
32
- hunk = Diff::LCS::Hunk.new(lines_a, lines_b, piece, 3, file_length_difference)
33
- file_length_difference = hunk.file_length_difference
31
+ hunk = Diff::LCS::Hunk.new(lines_a, lines_b, piece, 3, file_length_difference)
32
+ file_length_difference = hunk.file_length_difference
34
33
 
35
- next unless prev_hunk
36
- next if hunk.merge(prev_hunk)
34
+ next unless prev_hunk
35
+ next if hunk.merge(prev_hunk)
37
36
 
38
- output << prev_hunk.diff(:unified) << "\n"
39
- ensure
40
- prev_hunk = hunk
41
- end
37
+ output << prev_hunk.diff(:unified) << "\n"
38
+ ensure
39
+ prev_hunk = hunk
42
40
  end
43
41
  last = prev_hunk.diff(:unified)
44
42
  output << last << "\n"
@@ -25,6 +25,8 @@ module Nanoc::CLI::CompileListeners
25
25
 
26
26
  # @see Listener#start
27
27
  def start
28
+ Nanoc::Core::Instrumentor.enable
29
+
28
30
  on(:stage_ran) do |duration, klass|
29
31
  @stages_summary.observe(duration, name: klass.to_s.sub(/.*::/, ''))
30
32
  end
@@ -65,6 +67,8 @@ module Nanoc::CLI::CompileListeners
65
67
 
66
68
  # @see Listener#stop
67
69
  def stop
70
+ Nanoc::Core::Instrumentor.disable
71
+
68
72
  print_profiling_feedback
69
73
  end
70
74
 
@@ -8,11 +8,11 @@ module Nanoc::CLI
8
8
  # Enables error handling in the given block.
9
9
  #
10
10
  # @return [void]
11
- def self.handle_while(exit_on_error: true)
11
+ def self.handle_while(exit_on_error: true, &block)
12
12
  if @disabled
13
13
  yield
14
14
  else
15
- new.handle_while(exit_on_error: exit_on_error) { yield }
15
+ new.handle_while(exit_on_error: exit_on_error, &block)
16
16
  end
17
17
  end
18
18
 
@@ -204,7 +204,7 @@ module Nanoc::CLI
204
204
  'sass' => 'sass',
205
205
  'slim' => 'slim',
206
206
  'typogruby' => 'typogruby',
207
- 'uglifier' => 'uglifier',
207
+ 'terser' => 'terser',
208
208
  'w3c_validators' => 'w3c_validators',
209
209
  'yuicompressor' => 'yuicompressor',
210
210
  }.freeze
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module CLI
5
- VERSION = '4.12.6'
5
+ VERSION = '4.12.8'
6
6
  end
7
7
  end
data/lib/nanoc/cli.rb CHANGED
@@ -69,7 +69,7 @@ module Nanoc
69
69
  def self.enable_utf8?(io)
70
70
  return true unless io.tty?
71
71
 
72
- %w[LC_ALL LC_CTYPE LANG].any? { |e| ENV[e] =~ /UTF/i }
72
+ %w[LC_ALL LC_CTYPE LANG].any? { |e| ENV.fetch(e, nil) =~ /UTF/i }
73
73
  end
74
74
 
75
75
  # @return [Boolean] true if color support is present, false if not
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.6
4
+ version: 4.12.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-28 00:00:00.000000000 Z
11
+ date: 2022-10-03 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.6
47
+ version: 4.12.8
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.6
54
+ version: 4.12.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: zeitwerk
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '2.6'
117
+ version: '2.7'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.3.14
124
+ rubygems_version: 3.3.22
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: CLI for Nanoc