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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll/watcher.rb +9 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 229fbf98bb8691dbd4699c59511f5140babbbe39
4
- data.tar.gz: 10596fd70b9d72e6b238e4a4e0986f4aa2964852
3
+ metadata.gz: 311eb876e0a6ddf716fc8c8300e1cec3394034ef
4
+ data.tar.gz: 33f760375b07b353282d3c54075ae7575de2b503
5
5
  SHA512:
6
- metadata.gz: cf10fb816d2cd1bd33077f8e3c6a1bb4079b710f94d5a6e8aac756c7d72ff64abdf1f688efbf29a2db5ea7da18902f8e63ab1343bd341828056fa4b104174cf6
7
- data.tar.gz: 01ffc09e531deebbd7b50761c33ba58562eba9a628327a75e600b1d1ec339c090cab156e28e64b193425a41643c32e0e8f0c21e920dfefc7a45fa6f4307784d7
6
+ metadata.gz: 366d84486a4b3e553b69d289a331af1dd7321749dfb230a7bb331456a01c6bb20b28f70efa3beffbf61d91c9f01445302a946a529841d26e882a7bf689e2b0da
7
+ data.tar.gz: 937d8cbf5c133c2c63e51ed932f59ac5e5c3f12b650a463371f41ae1acf9381f3839de4bf7ac0b752348f19d4674774b7f5aa813c4db829bfd6ed03a5dd976fa
@@ -3,7 +3,8 @@ module Jekyll
3
3
  extend self
4
4
 
5
5
  def watch(options)
6
- listener = build_listener(options)
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(options))
31
+ &(listen_handler(site))
31
32
  )
32
33
  end
33
34
 
34
- def listen_handler(options)
35
+ def listen_handler(site)
35
36
  proc { |modified, added, removed|
36
- t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
37
+ t = Time.now
37
38
  c = modified + added + removed
38
39
  n = c.length
39
- print Jekyll.logger.message("Regenerating:", "#{n} files at #{t} ")
40
+ print Jekyll.logger.message("Regenerating:", "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")} ")
40
41
  begin
41
- Jekyll::Command.process_site(Jekyll::Site.new(options))
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.0
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: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen