jekyll-watch 1.1.1 → 1.1.2
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/lib/jekyll/watcher.rb +29 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9855455db8909487179a72ecb00a1f4fe815e37d
|
4
|
+
data.tar.gz: 78c2b869b915f9f4d4f82938eb595a782fc77884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1229d13b045a137e5b7576ad5e691d0ed343ba4dc96555a62f53541ca72250f616812940b78a80e3b3bb030cc6eef5b8443e58605aabb29eb7ad32fcb421f94
|
7
|
+
data.tar.gz: 86d75902d758067629d35e0427fef1872176c745f4ff7a5577391f712cbfaea021e569ecf324fab524340e5e77e10a0b2be46598f24be502f64debbd81555d7b
|
data/lib/jekyll/watcher.rb
CHANGED
@@ -48,35 +48,43 @@ module Jekyll
|
|
48
48
|
}
|
49
49
|
end
|
50
50
|
|
51
|
+
def custom_excludes(options)
|
52
|
+
Array(options['exclude']).map { |e| Jekyll.sanitized_path(options['source'], e) }
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_exclude(options)
|
56
|
+
config_files = [
|
57
|
+
"_config.yml",
|
58
|
+
"_config.yaml",
|
59
|
+
"_config.toml"
|
60
|
+
].map { |config_file| Jekyll.sanitized_path(options['source'], config_file) }
|
61
|
+
[config_files, options['destination'], custom_excludes(options)].flatten
|
62
|
+
end
|
63
|
+
|
51
64
|
# Paths to ignore for the watch option
|
52
65
|
#
|
53
66
|
# options - A Hash of options passed to the command
|
54
67
|
#
|
55
68
|
# Returns a list of relative paths from source that should be ignored
|
56
69
|
def listen_ignore_paths(options)
|
57
|
-
source = options['source']
|
58
|
-
|
59
|
-
config_files = Jekyll.sanitized_path(source, "_config.yml")
|
60
|
-
paths = (
|
61
|
-
Array(config_files) \
|
62
|
-
+ Array(destination) \
|
63
|
-
+ Array(options['exclude']).map { |e| Jekyll.sanitized_path(source, e) }
|
64
|
-
)
|
65
|
-
ignored = []
|
70
|
+
source = Pathname.new(options['source']).expand_path
|
71
|
+
paths = to_exclude(options)
|
66
72
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
paths.map do |p|
|
74
|
+
absolute_path = Pathname.new(p).expand_path
|
75
|
+
if absolute_path.exist?
|
76
|
+
begin
|
77
|
+
relative_path = absolute_path.relative_path_from(source).to_s
|
78
|
+
unless relative_path.start_with?('../')
|
79
|
+
path_to_ignore = Regexp.new(Regexp.escape(relative_path))
|
80
|
+
Jekyll.logger.debug "Watcher:", "Ignoring #{path_to_ignore}"
|
81
|
+
path_to_ignore
|
82
|
+
end
|
83
|
+
rescue ArgumentError
|
84
|
+
# Could not find a relative path
|
85
|
+
end
|
75
86
|
end
|
76
|
-
end
|
77
|
-
|
78
|
-
Jekyll.logger.debug "Watcher:", "Ignoring #{ignored.map(&:inspect).join(', ')}"
|
79
|
-
ignored
|
87
|
+
end.compact
|
80
88
|
end
|
81
89
|
|
82
90
|
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.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|