Skip to content

Commit

Permalink
Use default Listen latency/wait_for_delay opts
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jan 6, 2021
1 parent fbafcc2 commit b85757e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions nanoc-live/lib/nanoc/live/live_recompiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,17 @@ def unsafe_handle_changes(site, command_runner)

def gen_lib_changes
Nanoc::Core::ChangesStream.new do |cl|
opts = {
latency: 0.1,
wait_for_delay: 0.0,
}

listener = Listen.to('lib', opts) { |*| cl.lib }
listener = Listen.to('lib') { |*| cl.lib }
listener.start
sleep
end
end

def gen_config_and_rules_changes
Nanoc::Core::ChangesStream.new do |cl|
opts = {
only: /(\/|\A)(nanoc\.yaml|config\.yaml|rules|Rules|rules\.rb|Rules\.rb)\z/,
latency: 0.1,
wait_for_delay: 0.0,
}
only = /(\/|\A)(nanoc\.yaml|config\.yaml|rules|Rules|rules\.rb|Rules\.rb)\z/

listener = Listen.to('.', opts) { |*| cl.unknown }
listener = Listen.to('.', only: only) { |*| cl.unknown }
listener.start
sleep
end
Expand Down

0 comments on commit b85757e

Please sign in to comment.