mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix guard bug
This commit is contained in:
parent
24131bcc0e
commit
1e7279f0ea
14
Guardfile
14
Guardfile
@ -58,6 +58,15 @@ unless ENV["USING_AUTOSPEC"]
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def message_bus
|
||||||
|
MessageBus::Instance.new.tap do |bus|
|
||||||
|
bus.site_id_lookup do
|
||||||
|
# this is going to be dev the majority of the time, if you have multisite configured in dev stuff may be different
|
||||||
|
"default"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module ::Guard
|
module ::Guard
|
||||||
class AutoReload < ::Guard::Guard
|
class AutoReload < ::Guard::Guard
|
||||||
|
|
||||||
@ -73,8 +82,7 @@ module ::Guard
|
|||||||
p = p.sub /^app\/assets\/stylesheets/, "assets"
|
p = p.sub /^app\/assets\/stylesheets/, "assets"
|
||||||
{name: p, hash: hash}
|
{name: p, hash: hash}
|
||||||
end
|
end
|
||||||
# target dev
|
message_bus.publish "/file-change", paths
|
||||||
MessageBus::Instance.new.publish "/file-change", paths
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_all
|
def run_all
|
||||||
@ -85,7 +93,7 @@ end
|
|||||||
Thread.new do
|
Thread.new do
|
||||||
Listen.to('tmp/') do |modified,added,removed|
|
Listen.to('tmp/') do |modified,added,removed|
|
||||||
modified.each do |m|
|
modified.each do |m|
|
||||||
MessageBus::Instance.new.publish "/file-change", ["refresh"] if m =~ /refresh_browser/
|
message_bus.publish "/file-change", ["refresh"] if m =~ /refresh_browser/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user