jekyll-watch 1.2.0 → 1.2.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/watcher.rb +9 -8
- 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: 311eb876e0a6ddf716fc8c8300e1cec3394034ef
|
4
|
+
data.tar.gz: 33f760375b07b353282d3c54075ae7575de2b503
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366d84486a4b3e553b69d289a331af1dd7321749dfb230a7bb331456a01c6bb20b28f70efa3beffbf61d91c9f01445302a946a529841d26e882a7bf689e2b0da
|
7
|
+
data.tar.gz: 937d8cbf5c133c2c63e51ed932f59ac5e5c3f12b650a463371f41ae1acf9381f3839de4bf7ac0b752348f19d4674774b7f5aa813c4db829bfd6ed03a5dd976fa
|
data/lib/jekyll/watcher.rb
CHANGED
@@ -3,7 +3,8 @@ module Jekyll
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
def watch(options)
|
6
|
-
|
6
|
+
site = Jekyll::Site.new(options)
|
7
|
+
listener = build_listener(site, options)
|
7
8
|
listener.start
|
8
9
|
|
9
10
|
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options['source']}'"
|
@@ -21,25 +22,25 @@ module Jekyll
|
|
21
22
|
# You pressed Ctrl-C, oh my!
|
22
23
|
end
|
23
24
|
|
24
|
-
def build_listener(options)
|
25
|
+
def build_listener(site, options)
|
25
26
|
require 'listen'
|
26
27
|
Listen.to(
|
27
28
|
options['source'],
|
28
29
|
:ignore => listen_ignore_paths(options),
|
29
30
|
:force_polling => options['force_polling'],
|
30
|
-
&(listen_handler(
|
31
|
+
&(listen_handler(site))
|
31
32
|
)
|
32
33
|
end
|
33
34
|
|
34
|
-
def listen_handler(
|
35
|
+
def listen_handler(site)
|
35
36
|
proc { |modified, added, removed|
|
36
|
-
t = Time.now
|
37
|
+
t = Time.now
|
37
38
|
c = modified + added + removed
|
38
39
|
n = c.length
|
39
|
-
print Jekyll.logger.message("Regenerating:", "#{n}
|
40
|
+
print Jekyll.logger.message("Regenerating:", "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")} ")
|
40
41
|
begin
|
41
|
-
|
42
|
-
puts "...done."
|
42
|
+
site.process
|
43
|
+
puts "...done in #{Time.now - t} seconds."
|
43
44
|
rescue => e
|
44
45
|
puts "...error:"
|
45
46
|
Jekyll.logger.warn "Error:", e.message
|
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.2.
|
4
|
+
version: 1.2.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: 2015-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|