Fix 1.8.7 syntax errors.

This commit is contained in:
Parker Moore 2013-10-28 14:03:34 -04:00
parent 1eb55119a3
commit 3ab9841272
1 changed files with 3 additions and 4 deletions

View File

@ -37,9 +37,8 @@ module Jekyll
destination = options['destination'] destination = options['destination']
begin begin
ignored = Regexp.new(Regexp.escape(Pathname.new(destination) dest = Pathname.new(destination).relative_path_from(Pathname.new(source)).to_path
.relative_path_from(Pathname.new(source)) ignored = Regexp.new(Regexp.escape(dest))
.to_path))
rescue ArgumentError rescue ArgumentError
# Destination is outside the source, no need to ignore it. # Destination is outside the source, no need to ignore it.
ignored = nil ignored = nil
@ -47,7 +46,7 @@ module Jekyll
Jekyll.logger.info "Auto-regeneration:", "enabled" Jekyll.logger.info "Auto-regeneration:", "enabled"
listener = Listen.to(source, ignore: ignored) do |modified, added, removed| listener = Listen.to(source, :ignore => ignored) do |modified, added, removed|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S") t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
n = modified.length + added.length + removed.length n = modified.length + added.length + removed.length
print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} " print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} "