nanoc-live 1.0.0 → 1.1.1
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/NEWS.md +20 -0
- data/lib/nanoc/live/command_runners/live.rb +9 -4
- data/lib/nanoc/live/commands/live.rb +10 -5
- data/lib/nanoc/live/live_recompiler.rb +18 -14
- data/lib/nanoc/live/version.rb +1 -1
- metadata +16 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f5de786d66999b72134ebccff74e83a9775dc2a13e3dd043dc8cae4be2881ec
|
|
4
|
+
data.tar.gz: 25e34ffa03d7a85cfcd9fbc24ad37c73195e658b577cfab4142a816c72f45d1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 06b0e8ba05af9e161bccaa6984fc74c2a1ef09c1fcbb9afa3955b35fe2ecf0fcebed2b62818b1fdda4cf4ee502f7741e5153df25993fe9ff0cc41fd2842cbd83
|
|
7
|
+
data.tar.gz: bb84c90b4afc18f160ad141ddf78d28d67e1fc18b96ab05fea7042bf269d35ad7e446c5d3a5b34faf4d32e5bd8350697140afd9da6fbc758acee401c0f0cd19b
|
data/NEWS.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Release notes for nanoc-live
|
|
2
2
|
|
|
3
|
+
## 1.1.1 (2026-03-08)
|
|
4
|
+
|
|
5
|
+
Fixes:
|
|
6
|
+
|
|
7
|
+
- Restored compatibility with Nanoc 4.14.7
|
|
8
|
+
|
|
9
|
+
## 1.1.0 (2024-06-26)
|
|
10
|
+
|
|
11
|
+
Enhancements:
|
|
12
|
+
|
|
13
|
+
- Added `--focus` option to the `compile` and `live` commands (#1707)
|
|
14
|
+
|
|
15
|
+
Fixes:
|
|
16
|
+
|
|
17
|
+
- Fixed wrong documentation regarding listening IP addresses (#1584) [Jan M. Faber]
|
|
18
|
+
|
|
19
|
+
Changes:
|
|
20
|
+
|
|
21
|
+
- Dropped support for Ruby 3.0 (EOL) (#1704)
|
|
22
|
+
|
|
3
23
|
## 1.0.0 (2021-02-20)
|
|
4
24
|
|
|
5
25
|
Idential to 1.0.0b8.
|
|
@@ -8,11 +8,16 @@ module Nanoc
|
|
|
8
8
|
if defined?(Guard::Nanoc)
|
|
9
9
|
$stderr.puts '-' * 40
|
|
10
10
|
$stderr.puts 'NOTE:'
|
|
11
|
-
$stderr.puts 'You are using the `nanoc live` command provided by
|
|
11
|
+
$stderr.puts 'You are using the `nanoc live` command provided by ' \
|
|
12
|
+
'`nanoc-live`, but the `guard-nanoc` gem is also ' \
|
|
13
|
+
'installed, which also provides a `nanoc live` command.'
|
|
12
14
|
if defined?(Bundler)
|
|
13
|
-
$stderr.puts 'Recommendation: Remove `guard-nanoc` from your
|
|
15
|
+
$stderr.puts 'Recommendation: Remove `guard-nanoc` from your ' \
|
|
16
|
+
'Gemfile, either manually or by running the ' \
|
|
17
|
+
'`bundle remove guard-nanoc` command.'
|
|
14
18
|
else
|
|
15
|
-
$stderr.puts 'Recommendation: Uninstall `guard-nanoc
|
|
19
|
+
$stderr.puts 'Recommendation: Uninstall `guard-nanoc` (run ' \
|
|
20
|
+
'the `gem uninstall guard-nanoc` command).'
|
|
16
21
|
end
|
|
17
22
|
$stderr.puts '-' * 40
|
|
18
23
|
end
|
|
@@ -29,7 +34,7 @@ module Nanoc
|
|
|
29
34
|
Nanoc::CLI::Commands::View.new(view_options, [], self).run
|
|
30
35
|
end
|
|
31
36
|
|
|
32
|
-
Nanoc::Live::LiveRecompiler.new(command_runner: self).run
|
|
37
|
+
Nanoc::Live::LiveRecompiler.new(command_runner: self, focus: options[:focus]).run
|
|
33
38
|
end
|
|
34
39
|
end
|
|
35
40
|
end
|
|
@@ -4,13 +4,18 @@ usage 'live'
|
|
|
4
4
|
summary 'auto-recompile and serve'
|
|
5
5
|
description <<~EOS
|
|
6
6
|
Starts the live recompiler along with the static web server. Unless specified,
|
|
7
|
-
the web server will run on port 3000 and listen on
|
|
8
|
-
|
|
7
|
+
the web server will run on port 3000 and listen on 127.0.0.1. Running this
|
|
8
|
+
static web server requires `adsf` (not `asdf`!).
|
|
9
9
|
EOS
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
option :H, :handler, 'specify the handler to use (webrick/puma/...)',
|
|
12
|
+
argument: :required
|
|
13
|
+
option :o, :host, 'specify the host to listen on',
|
|
14
|
+
default: '127.0.0.1', argument: :required
|
|
15
|
+
option :p, :port, 'specify the port to listen on',
|
|
16
|
+
transform: Nanoc::CLI::Transform::Port, default: 3000, argument: :required
|
|
17
|
+
option nil, :focus, 'compile only items matching the given pattern',
|
|
18
|
+
argument: :required, multiple: true
|
|
14
19
|
no_params
|
|
15
20
|
|
|
16
21
|
runner Nanoc::Live::CommandRunners::Live
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
module Nanoc
|
|
4
4
|
module Live
|
|
5
5
|
class LiveRecompiler
|
|
6
|
-
def initialize(command_runner:)
|
|
6
|
+
def initialize(command_runner:, focus:)
|
|
7
7
|
@command_runner = command_runner
|
|
8
|
+
@focus = focus
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
def run
|
|
11
12
|
run_parent do |site|
|
|
12
|
-
handle_changes(site, @command_runner)
|
|
13
|
+
handle_changes(site, @command_runner, focus: @focus)
|
|
13
14
|
end
|
|
14
15
|
end
|
|
15
16
|
|
|
@@ -60,10 +61,10 @@ module Nanoc
|
|
|
60
61
|
exit 0
|
|
61
62
|
end
|
|
62
63
|
|
|
63
|
-
def run_parent
|
|
64
|
+
def run_parent(&block)
|
|
64
65
|
# create initial child
|
|
65
66
|
pipe_read, pipe_write = IO.pipe
|
|
66
|
-
fork { run_child(pipe_write, pipe_read
|
|
67
|
+
fork { run_child(pipe_write, pipe_read, &block) }
|
|
67
68
|
pipe_read.close
|
|
68
69
|
|
|
69
70
|
changes = gen_lib_changes
|
|
@@ -76,27 +77,26 @@ module Nanoc
|
|
|
76
77
|
|
|
77
78
|
# create new child
|
|
78
79
|
pipe_read, pipe_write = IO.pipe
|
|
79
|
-
fork { run_child(pipe_write, pipe_read
|
|
80
|
+
fork { run_child(pipe_write, pipe_read, &block) }
|
|
80
81
|
pipe_read.close
|
|
81
82
|
end
|
|
82
83
|
rescue Interrupt
|
|
83
84
|
end
|
|
84
85
|
|
|
85
|
-
def handle_changes(site, command_runner)
|
|
86
|
+
def handle_changes(site, command_runner, focus:)
|
|
86
87
|
Nanoc::CLI::ErrorHandler.handle_while(exit_on_error: false) do
|
|
87
|
-
unsafe_handle_changes(site, command_runner)
|
|
88
|
+
unsafe_handle_changes(site, command_runner, focus:)
|
|
88
89
|
end
|
|
89
90
|
end
|
|
90
91
|
|
|
91
|
-
def unsafe_handle_changes(site, command_runner)
|
|
92
|
+
def unsafe_handle_changes(site, command_runner, focus:)
|
|
92
93
|
time_before = Time.now
|
|
93
94
|
|
|
94
95
|
puts 'Compiling site…'
|
|
95
|
-
compiler = Nanoc::Core::Compiler.new_for(site)
|
|
96
|
+
compiler = Nanoc::Core::Compiler.new_for(site, focus:)
|
|
96
97
|
listener = Nanoc::CLI::CompileListeners::Aggregate.new(
|
|
97
|
-
command_runner
|
|
98
|
-
|
|
99
|
-
compiler: compiler,
|
|
98
|
+
command_runner:,
|
|
99
|
+
config: site.config,
|
|
100
100
|
)
|
|
101
101
|
listener.run_while do
|
|
102
102
|
compiler.run_until_end
|
|
@@ -104,6 +104,10 @@ module Nanoc
|
|
|
104
104
|
|
|
105
105
|
time_after = Time.now
|
|
106
106
|
puts "Site compiled in #{format('%.2f', time_after - time_before)}s."
|
|
107
|
+
if focus
|
|
108
|
+
warn 'CAUTION: A --focus option is specified. Not the entire site has been compiled.'
|
|
109
|
+
warn 'Re-run without --focus to compile the entire site.'
|
|
110
|
+
end
|
|
107
111
|
puts
|
|
108
112
|
end
|
|
109
113
|
|
|
@@ -117,9 +121,9 @@ module Nanoc
|
|
|
117
121
|
|
|
118
122
|
def gen_config_and_rules_changes
|
|
119
123
|
Nanoc::Core::ChangesStream.new do |cl|
|
|
120
|
-
only =
|
|
124
|
+
only = %r{(/|\A)(nanoc\.yaml|config\.yaml|rules|Rules|rules\.rb|Rules\.rb)\z}
|
|
121
125
|
|
|
122
|
-
listener = Listen.to('.', only:
|
|
126
|
+
listener = Listen.to('.', only:) { |*| cl.unknown }
|
|
123
127
|
listener.start
|
|
124
128
|
sleep
|
|
125
129
|
end
|
data/lib/nanoc/live/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nanoc-live
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Denis Defreyne
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: adsf-live
|
|
@@ -44,40 +43,40 @@ dependencies:
|
|
|
44
43
|
requirements:
|
|
45
44
|
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '4.
|
|
46
|
+
version: '4.14'
|
|
48
47
|
- - ">="
|
|
49
48
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: 4.
|
|
49
|
+
version: 4.14.7
|
|
51
50
|
type: :runtime
|
|
52
51
|
prerelease: false
|
|
53
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
53
|
requirements:
|
|
55
54
|
- - "~>"
|
|
56
55
|
- !ruby/object:Gem::Version
|
|
57
|
-
version: '4.
|
|
56
|
+
version: '4.14'
|
|
58
57
|
- - ">="
|
|
59
58
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 4.
|
|
59
|
+
version: 4.14.7
|
|
61
60
|
- !ruby/object:Gem::Dependency
|
|
62
61
|
name: nanoc-core
|
|
63
62
|
requirement: !ruby/object:Gem::Requirement
|
|
64
63
|
requirements:
|
|
65
64
|
- - "~>"
|
|
66
65
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '4.
|
|
66
|
+
version: '4.14'
|
|
68
67
|
- - ">="
|
|
69
68
|
- !ruby/object:Gem::Version
|
|
70
|
-
version: 4.
|
|
69
|
+
version: 4.14.7
|
|
71
70
|
type: :runtime
|
|
72
71
|
prerelease: false
|
|
73
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
74
73
|
requirements:
|
|
75
74
|
- - "~>"
|
|
76
75
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: '4.
|
|
76
|
+
version: '4.14'
|
|
78
77
|
- - ">="
|
|
79
78
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: 4.
|
|
79
|
+
version: 4.14.7
|
|
81
80
|
description: Provides support for auto-recompiling Nanoc sites.
|
|
82
81
|
email: denis+rubygems@denis.ws
|
|
83
82
|
executables: []
|
|
@@ -91,11 +90,12 @@ files:
|
|
|
91
90
|
- lib/nanoc/live/commands/live.rb
|
|
92
91
|
- lib/nanoc/live/live_recompiler.rb
|
|
93
92
|
- lib/nanoc/live/version.rb
|
|
94
|
-
homepage: https://nanoc.
|
|
93
|
+
homepage: https://nanoc.app/
|
|
95
94
|
licenses:
|
|
96
95
|
- MIT
|
|
97
|
-
metadata:
|
|
98
|
-
|
|
96
|
+
metadata:
|
|
97
|
+
rubygems_mfa_required: 'true'
|
|
98
|
+
source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-live-v1.1.1/nanoc-live
|
|
99
99
|
rdoc_options: []
|
|
100
100
|
require_paths:
|
|
101
101
|
- lib
|
|
@@ -103,15 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
103
103
|
requirements:
|
|
104
104
|
- - ">="
|
|
105
105
|
- !ruby/object:Gem::Version
|
|
106
|
-
version: '2
|
|
106
|
+
version: '3.2'
|
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
|
109
109
|
- - ">="
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
111
|
version: '0'
|
|
112
112
|
requirements: []
|
|
113
|
-
rubygems_version:
|
|
114
|
-
signing_key:
|
|
113
|
+
rubygems_version: 4.0.3
|
|
115
114
|
specification_version: 4
|
|
116
115
|
summary: Live recompilation support for Nanoc
|
|
117
116
|
test_files: []
|