jekyll-watch 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/commands/watch.rb +1 -1
- data/lib/jekyll/watcher.rb +19 -17
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2559d546529d452fbfc4387f7bb56679aa4956a
|
4
|
+
data.tar.gz: 40fe28683feefb432429a66868dce80aa65ce5f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552c2c19ee03cb3747c0a05d12f183878471972b7cde73bcb141964d8bca3eeeda8b14b42a786e8069362208e71740e77bd144605793e8c5e3c955df6b12aa99
|
7
|
+
data.tar.gz: 1868ad224d5e2618f247bbc8ad31013188c4a6122f4cdc073d3c8f8ac5406d91ed28606d30d61b05d4d2646ab3420dc143e67db1f098b7e349c82b00bb61e677
|
data/lib/jekyll/watcher.rb
CHANGED
@@ -5,11 +5,13 @@ module Jekyll
|
|
5
5
|
extend self
|
6
6
|
|
7
7
|
def watch(options)
|
8
|
+
ENV["LISTEN_GEM_DEBUGGING"] ||= "1" if options['verbose']
|
9
|
+
|
8
10
|
site = Jekyll::Site.new(options)
|
9
11
|
listener = build_listener(site, options)
|
10
12
|
listener.start
|
11
13
|
|
12
|
-
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options[
|
14
|
+
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options["source"]}'"
|
13
15
|
|
14
16
|
unless options['serving']
|
15
17
|
trap("INT") do
|
@@ -20,7 +22,7 @@ module Jekyll
|
|
20
22
|
|
21
23
|
sleep_forever
|
22
24
|
end
|
23
|
-
rescue ThreadError
|
25
|
+
rescue ThreadError
|
24
26
|
# You pressed Ctrl-C, oh my!
|
25
27
|
end
|
26
28
|
|
@@ -35,20 +37,21 @@ module Jekyll
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def listen_handler(site)
|
38
|
-
proc
|
40
|
+
proc do |modified, added, removed|
|
39
41
|
t = Time.now
|
40
42
|
c = modified + added + removed
|
41
43
|
n = c.length
|
42
|
-
print Jekyll.logger.message("Regenerating:",
|
44
|
+
print Jekyll.logger.message("Regenerating:",
|
45
|
+
"#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")} ")
|
43
46
|
begin
|
44
47
|
site.process
|
45
|
-
puts
|
48
|
+
puts "...done in #{Time.now - t} seconds."
|
46
49
|
rescue => e
|
47
50
|
puts "...error:"
|
48
51
|
Jekyll.logger.warn "Error:", e.message
|
49
52
|
Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
|
50
53
|
end
|
51
|
-
|
54
|
+
end
|
52
55
|
end
|
53
56
|
|
54
57
|
def custom_excludes(options)
|
@@ -56,7 +59,7 @@ module Jekyll
|
|
56
59
|
end
|
57
60
|
|
58
61
|
def config_files(options)
|
59
|
-
%w
|
62
|
+
%w(yml yaml toml).map do |ext|
|
60
63
|
Jekyll.sanitized_path(options['source'], "_config.#{ext}")
|
61
64
|
end
|
62
65
|
end
|
@@ -80,17 +83,16 @@ module Jekyll
|
|
80
83
|
|
81
84
|
paths.map do |p|
|
82
85
|
absolute_path = Pathname.new(p).expand_path
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
91
|
-
rescue ArgumentError
|
92
|
-
# Could not find a relative path
|
86
|
+
next unless absolute_path.exist?
|
87
|
+
begin
|
88
|
+
relative_path = absolute_path.relative_path_from(source).to_s
|
89
|
+
unless relative_path.start_with?('../')
|
90
|
+
path_to_ignore = Regexp.new(Regexp.escape(relative_path))
|
91
|
+
Jekyll.logger.debug "Watcher:", "Ignoring #{path_to_ignore}"
|
92
|
+
path_to_ignore
|
93
93
|
end
|
94
|
+
rescue ArgumentError
|
95
|
+
# Could not find a relative path
|
94
96
|
end
|
95
97
|
end.compact + [/\.jekyll\-metadata/]
|
96
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-watch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.35.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.35.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
124
|
version: '0'
|
111
125
|
requirements: []
|
112
126
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.5.1
|
114
128
|
signing_key:
|
115
129
|
specification_version: 4
|
116
130
|
summary: Rebuild your Jekyll site when a file changes with the `--watch` switch.
|