guard-nanoc 2.1.3 → 2.1.4
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 +4 -0
- data/README.md +2 -0
- data/Rakefile +13 -3
- data/guard-nanoc.gemspec +3 -3
- data/lib/guard-nanoc.rb +2 -0
- data/lib/guard/nanoc.rb +16 -16
- data/lib/guard/nanoc/templates/Guardfile +2 -0
- data/lib/guard/nanoc/version.rb +2 -2
- data/lib/nanoc/cli/commands/live.rb +8 -6
- metadata +2 -4
- data/Gemfile +0 -10
- data/Gemfile.lock +0 -104
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c321c9e9cc34ed667d509ac02ecdce2b9fdc28312a8cf67cad862f94cec8bc2
|
4
|
+
data.tar.gz: 4798536e319a6f9d0f13366a08f6866011e49f6af5782adda8171c2fe9163fc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68396146a2cf597e93b548063d8240381b2be3709e3609bd8b34a88593d8dd5e09175b26b2f3660d25b9b7dc17e9145871a1606009b6aee38628256063fd9a29
|
7
|
+
data.tar.gz: df08ab3f62c348f5935453d1569413dd63348f5d111e5265d00d4bdf8c098a0c4b652f256beaa28478f7683249cf861218dab32f87d2c9f1d43c571527dd8e26
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Guard::Nanoc
|
2
2
|
|
3
|
+
:warning: Experimental; please use [the guard-nanoc repository](https://github.com/guard/guard-nanoc) for the time being.
|
4
|
+
|
3
5
|
This is a guard for [nanoc](http://nanoc.ws/).
|
4
6
|
|
5
7
|
`Guard` is a framework for listening to filesystem changes and acting upon them. `Guard::Nanoc` is a plugin for Guard that recompiles Nanoc sites on changes.
|
data/Rakefile
CHANGED
@@ -1,8 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
|
+
require 'rubocop/rake_task'
|
5
|
+
|
6
|
+
RuboCop::RakeTask.new(:rubocop)
|
7
|
+
|
4
8
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
5
|
-
t.verbose = false
|
9
|
+
t.verbose = false
|
10
|
+
end
|
11
|
+
|
12
|
+
task test: :spec
|
13
|
+
|
14
|
+
task :gem do
|
15
|
+
sh('gem build *.gemspec')
|
6
16
|
end
|
7
17
|
|
8
|
-
task default:
|
18
|
+
task default: %i[test rubocop]
|
data/guard-nanoc.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative './lib/guard/nanoc/version'
|
4
4
|
|
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency 'guard-compat', '~> 1.0'
|
18
18
|
s.add_dependency 'nanoc', '>= 4.3.8', '< 5.0'
|
19
19
|
|
20
|
-
s.files = Dir['[A-Z]*'] + Dir['lib/**/*'] + [
|
21
|
-
s.require_paths = [
|
20
|
+
s.files = Dir['[A-Z]*'] + Dir['lib/**/*'] + ['guard-nanoc.gemspec']
|
21
|
+
s.require_paths = ['lib']
|
22
22
|
end
|
data/lib/guard-nanoc.rb
CHANGED
data/lib/guard/nanoc.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'guard/compat/plugin'
|
4
4
|
|
@@ -14,29 +14,29 @@ module Guard
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def initialize(options={})
|
17
|
+
def initialize(options = {})
|
18
18
|
@dir = options[:dir] || '.'
|
19
19
|
super
|
20
20
|
end
|
21
21
|
|
22
22
|
def start
|
23
|
-
|
24
|
-
|
23
|
+
setup_listeners
|
24
|
+
recompile_in_subprocess
|
25
25
|
end
|
26
26
|
|
27
27
|
def run_all
|
28
|
-
|
28
|
+
recompile_in_subprocess
|
29
29
|
end
|
30
30
|
|
31
|
-
def run_on_changes(
|
32
|
-
|
31
|
+
def run_on_changes(_paths)
|
32
|
+
recompile_in_subprocess
|
33
33
|
end
|
34
34
|
|
35
|
-
def run_on_removals(
|
36
|
-
|
35
|
+
def run_on_removals(_paths)
|
36
|
+
recompile_in_subprocess
|
37
37
|
end
|
38
38
|
|
39
|
-
|
39
|
+
protected
|
40
40
|
|
41
41
|
def setup_listeners
|
42
42
|
::Nanoc::CLI.setup
|
@@ -48,10 +48,10 @@ module Guard
|
|
48
48
|
|
49
49
|
def recompile_in_subprocess
|
50
50
|
if Process.respond_to?(:fork)
|
51
|
-
pid = Process.fork {
|
51
|
+
pid = Process.fork { recompile }
|
52
52
|
Process.waitpid(pid)
|
53
53
|
else
|
54
|
-
|
54
|
+
recompile
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -60,19 +60,19 @@ module Guard
|
|
60
60
|
site = ::Nanoc::Int::SiteLoader.new.new_from_cwd
|
61
61
|
site.compile
|
62
62
|
end
|
63
|
-
|
63
|
+
notify_success
|
64
64
|
rescue => e
|
65
|
-
|
65
|
+
notify_failure
|
66
66
|
::Nanoc::CLI::ErrorHandler.print_error(e)
|
67
67
|
end
|
68
68
|
|
69
69
|
def notify_success
|
70
|
-
Compat::UI.notify('Compilation succeeded', :
|
70
|
+
Compat::UI.notify('Compilation succeeded', title: 'nanoc', image: :success)
|
71
71
|
Compat::UI.info 'Compilation succeeded.'
|
72
72
|
end
|
73
73
|
|
74
74
|
def notify_failure
|
75
|
-
Compat::UI.notify('Compilation FAILED', :
|
75
|
+
Compat::UI.notify('Compilation FAILED', title: 'nanoc', image: :failed)
|
76
76
|
Compat::UI.error 'Compilation failed!'
|
77
77
|
end
|
78
78
|
end
|
data/lib/guard/nanoc/version.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
usage 'live [options]'
|
2
4
|
summary 'start the web server, and recompile the site when changed'
|
3
|
-
description
|
4
|
-
Start the static web server (like `nanoc view` would), and watch for changes
|
5
|
-
in the background (like `guard start` would). See the documentation of those
|
6
|
-
two commands for details. The options are forwarded to `nanoc view` only.
|
5
|
+
description <<~EOS
|
6
|
+
Start the static web server (like `nanoc view` would), and watch for changes
|
7
|
+
in the background (like `guard start` would). See the documentation of those
|
8
|
+
two commands for details. The options are forwarded to `nanoc view` only.
|
7
9
|
EOS
|
8
10
|
|
9
11
|
required :H, :handler, 'specify the handler to use (webrick/mongrel/...)'
|
10
|
-
required :o, :host, 'specify the host to listen on (default: 0.0.0.0)'
|
11
|
-
required :p, :port, 'specify the port to listen on (default: 3000)'
|
12
|
+
required :o, :host, 'specify the host to listen on (default: 0.0.0.0)', default: '127.0.0.1'
|
13
|
+
required :p, :port, 'specify the port to listen on (default: 3000)', transform: Nanoc::CLI::Transform::Port, default: 3000
|
12
14
|
flag :L, :'live-reload', 'reload on changes'
|
13
15
|
|
14
16
|
module Nanoc::CLI::Commands
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-nanoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -64,8 +64,6 @@ executables: []
|
|
64
64
|
extensions: []
|
65
65
|
extra_rdoc_files: []
|
66
66
|
files:
|
67
|
-
- Gemfile
|
68
|
-
- Gemfile.lock
|
69
67
|
- LICENSE
|
70
68
|
- NEWS.md
|
71
69
|
- README.md
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/nanoc/nanoc.git
|
3
|
-
revision: b122d9d7e21bb48af1ea91354717c01d6c45445a
|
4
|
-
specs:
|
5
|
-
nanoc (4.9.3)
|
6
|
-
addressable (~> 2.5)
|
7
|
-
cri (~> 2.8)
|
8
|
-
ddmemoize (~> 1.0)
|
9
|
-
ddmetrics (~> 1.0)
|
10
|
-
ddplugin (~> 1.0)
|
11
|
-
hamster (~> 3.0)
|
12
|
-
parallel (~> 1.12)
|
13
|
-
ref (~> 2.0)
|
14
|
-
slow_enumerator_tools (~> 1.0)
|
15
|
-
tomlrb (~> 1.2)
|
16
|
-
|
17
|
-
PATH
|
18
|
-
remote: .
|
19
|
-
specs:
|
20
|
-
guard-nanoc (2.1.2)
|
21
|
-
guard (~> 2.8)
|
22
|
-
guard-compat (~> 1.0)
|
23
|
-
nanoc (>= 4.3.8, < 5.0)
|
24
|
-
|
25
|
-
GEM
|
26
|
-
remote: https://rubygems.org/
|
27
|
-
specs:
|
28
|
-
addressable (2.5.2)
|
29
|
-
public_suffix (>= 2.0.2, < 4.0)
|
30
|
-
coderay (1.1.2)
|
31
|
-
colored (1.2)
|
32
|
-
concurrent-ruby (1.0.5)
|
33
|
-
cri (2.10.1)
|
34
|
-
colored (~> 1.2)
|
35
|
-
ddmemoize (1.0.0)
|
36
|
-
ddmetrics (~> 1.0)
|
37
|
-
ref (~> 2.0)
|
38
|
-
ddmetrics (1.0.1)
|
39
|
-
ddplugin (1.0.2)
|
40
|
-
diff-lcs (1.3)
|
41
|
-
ffi (1.9.25)
|
42
|
-
formatador (0.2.5)
|
43
|
-
guard (2.14.2)
|
44
|
-
formatador (>= 0.2.4)
|
45
|
-
listen (>= 2.7, < 4.0)
|
46
|
-
lumberjack (>= 1.0.12, < 2.0)
|
47
|
-
nenv (~> 0.1)
|
48
|
-
notiffany (~> 0.0)
|
49
|
-
pry (>= 0.9.12)
|
50
|
-
shellany (~> 0.0)
|
51
|
-
thor (>= 0.18.1)
|
52
|
-
guard-compat (1.2.1)
|
53
|
-
hamster (3.0.0)
|
54
|
-
concurrent-ruby (~> 1.0)
|
55
|
-
listen (3.1.5)
|
56
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
57
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
58
|
-
ruby_dep (~> 1.2)
|
59
|
-
lumberjack (1.0.13)
|
60
|
-
method_source (0.9.0)
|
61
|
-
nenv (0.3.0)
|
62
|
-
notiffany (0.1.1)
|
63
|
-
nenv (~> 0.1)
|
64
|
-
shellany (~> 0.0)
|
65
|
-
parallel (1.12.1)
|
66
|
-
pry (0.11.3)
|
67
|
-
coderay (~> 1.1.0)
|
68
|
-
method_source (~> 0.9.0)
|
69
|
-
public_suffix (3.0.2)
|
70
|
-
rake (12.3.1)
|
71
|
-
rb-fsevent (0.10.3)
|
72
|
-
rb-inotify (0.9.10)
|
73
|
-
ffi (>= 0.5.0, < 2)
|
74
|
-
ref (2.0.0)
|
75
|
-
rspec (3.7.0)
|
76
|
-
rspec-core (~> 3.7.0)
|
77
|
-
rspec-expectations (~> 3.7.0)
|
78
|
-
rspec-mocks (~> 3.7.0)
|
79
|
-
rspec-core (3.7.1)
|
80
|
-
rspec-support (~> 3.7.0)
|
81
|
-
rspec-expectations (3.7.0)
|
82
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
83
|
-
rspec-support (~> 3.7.0)
|
84
|
-
rspec-mocks (3.7.0)
|
85
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
86
|
-
rspec-support (~> 3.7.0)
|
87
|
-
rspec-support (3.7.1)
|
88
|
-
ruby_dep (1.5.0)
|
89
|
-
shellany (0.0.1)
|
90
|
-
slow_enumerator_tools (1.1.0)
|
91
|
-
thor (0.20.0)
|
92
|
-
tomlrb (1.2.7)
|
93
|
-
|
94
|
-
PLATFORMS
|
95
|
-
ruby
|
96
|
-
|
97
|
-
DEPENDENCIES
|
98
|
-
guard-nanoc!
|
99
|
-
nanoc!
|
100
|
-
rake
|
101
|
-
rspec (~> 3.1)
|
102
|
-
|
103
|
-
BUNDLED WITH
|
104
|
-
1.16.3
|