Upgrade the Listen gem

This commit is contained in:
Sam 2017-04-13 10:26:07 -04:00
parent ef093b1610
commit 22214f5e5c
4 changed files with 13 additions and 5 deletions

View File

@ -122,7 +122,7 @@ end
group :test, :development do
gem 'rspec'
gem 'mock_redis'
gem 'listen', '0.7.3', require: false
gem 'listen', require: false
gem 'certified', require: false
# later appears to break Fabricate(:topic, category: category)
gem 'fabrication', '2.9.8', require: false

View File

@ -137,7 +137,10 @@ GEM
jwt (1.5.6)
kgio (2.10.0)
libv8 (5.3.332.38.5)
listen (0.7.3)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
logster (1.2.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
@ -312,6 +315,7 @@ GEM
ruby-readability (0.7.0)
guess_html_encoding (>= 0.0.4)
nokogiri (>= 1.6.0)
ruby_dep (1.5.0)
sanitize (4.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.4.4)
@ -409,7 +413,7 @@ DEPENDENCIES
htmlentities
http_accept_language (~> 2.0.5)
image_optim
listen (= 0.7.3)
listen
logster
lru_redux
mail

View File

@ -179,12 +179,14 @@ class Autospec::Manager
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
Thread.new do
begin
Listen.to("#{path}/#{watch}", options) do |modified, added, _|
listener = Listen.to("#{path}/#{watch}", options) do |modified, added, _|
paths = [modified, added].flatten
paths.compact!
paths.map!{|long| long[(path.length+1)..-1]}
process_change(paths)
end
listener.start
sleep
rescue => e
puts "FAILED to listen on changes to #{path}/#{watch}"
puts e

View File

@ -31,7 +31,7 @@ module Stylesheet
@paths.each do |watch|
Thread.new do
begin
Listen.to("#{root}/#{watch}") do |modified, added, _|
listener = Listen.to("#{root}/#{watch}", ignore: /xxxx/) do |modified, added, _|
paths = [modified, added].flatten
paths.compact!
paths.map!{|long| long[(root.length+1)..-1]}
@ -40,6 +40,8 @@ module Stylesheet
rescue => e
STDERR.puts "Failed to listen for CSS changes at: #{watch}\n#{e}"
end
listener.start
sleep
end
end
end