Upgrade the Listen gem
This commit is contained in:
parent
ef093b1610
commit
22214f5e5c
2
Gemfile
2
Gemfile
|
@ -122,7 +122,7 @@ end
|
||||||
group :test, :development do
|
group :test, :development do
|
||||||
gem 'rspec'
|
gem 'rspec'
|
||||||
gem 'mock_redis'
|
gem 'mock_redis'
|
||||||
gem 'listen', '0.7.3', require: false
|
gem 'listen', require: false
|
||||||
gem 'certified', require: false
|
gem 'certified', require: false
|
||||||
# later appears to break Fabricate(:topic, category: category)
|
# later appears to break Fabricate(:topic, category: category)
|
||||||
gem 'fabrication', '2.9.8', require: false
|
gem 'fabrication', '2.9.8', require: false
|
||||||
|
|
|
@ -137,7 +137,10 @@ GEM
|
||||||
jwt (1.5.6)
|
jwt (1.5.6)
|
||||||
kgio (2.10.0)
|
kgio (2.10.0)
|
||||||
libv8 (5.3.332.38.5)
|
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)
|
logster (1.2.7)
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
|
@ -312,6 +315,7 @@ GEM
|
||||||
ruby-readability (0.7.0)
|
ruby-readability (0.7.0)
|
||||||
guess_html_encoding (>= 0.0.4)
|
guess_html_encoding (>= 0.0.4)
|
||||||
nokogiri (>= 1.6.0)
|
nokogiri (>= 1.6.0)
|
||||||
|
ruby_dep (1.5.0)
|
||||||
sanitize (4.4.0)
|
sanitize (4.4.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.4.4)
|
nokogiri (>= 1.4.4)
|
||||||
|
@ -409,7 +413,7 @@ DEPENDENCIES
|
||||||
htmlentities
|
htmlentities
|
||||||
http_accept_language (~> 2.0.5)
|
http_accept_language (~> 2.0.5)
|
||||||
image_optim
|
image_optim
|
||||||
listen (= 0.7.3)
|
listen
|
||||||
logster
|
logster
|
||||||
lru_redux
|
lru_redux
|
||||||
mail
|
mail
|
||||||
|
|
|
@ -179,12 +179,14 @@ class Autospec::Manager
|
||||||
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
|
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
|
||||||
Thread.new do
|
Thread.new do
|
||||||
begin
|
begin
|
||||||
Listen.to("#{path}/#{watch}", options) do |modified, added, _|
|
listener = Listen.to("#{path}/#{watch}", options) do |modified, added, _|
|
||||||
paths = [modified, added].flatten
|
paths = [modified, added].flatten
|
||||||
paths.compact!
|
paths.compact!
|
||||||
paths.map!{|long| long[(path.length+1)..-1]}
|
paths.map!{|long| long[(path.length+1)..-1]}
|
||||||
process_change(paths)
|
process_change(paths)
|
||||||
end
|
end
|
||||||
|
listener.start
|
||||||
|
sleep
|
||||||
rescue => e
|
rescue => e
|
||||||
puts "FAILED to listen on changes to #{path}/#{watch}"
|
puts "FAILED to listen on changes to #{path}/#{watch}"
|
||||||
puts e
|
puts e
|
||||||
|
|
|
@ -31,7 +31,7 @@ module Stylesheet
|
||||||
@paths.each do |watch|
|
@paths.each do |watch|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
begin
|
begin
|
||||||
Listen.to("#{root}/#{watch}") do |modified, added, _|
|
listener = Listen.to("#{root}/#{watch}", ignore: /xxxx/) do |modified, added, _|
|
||||||
paths = [modified, added].flatten
|
paths = [modified, added].flatten
|
||||||
paths.compact!
|
paths.compact!
|
||||||
paths.map!{|long| long[(root.length+1)..-1]}
|
paths.map!{|long| long[(root.length+1)..-1]}
|
||||||
|
@ -40,6 +40,8 @@ module Stylesheet
|
||||||
rescue => e
|
rescue => e
|
||||||
STDERR.puts "Failed to listen for CSS changes at: #{watch}\n#{e}"
|
STDERR.puts "Failed to listen for CSS changes at: #{watch}\n#{e}"
|
||||||
end
|
end
|
||||||
|
listener.start
|
||||||
|
sleep
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue