lib/posthaven_theme/cli.rb in posthaven_theme-0.1.2 vs lib/posthaven_theme/cli.rb in posthaven_theme-0.1.3
- old
+ new
@@ -128,13 +128,13 @@
puts "Watching current folder: #{Dir.pwd}"
watcher do |filename, event|
filename = filename.gsub("#{Dir.pwd}/", '')
next unless local_assets_list.include?(filename)
- action = if [:changed, :new].include?(event)
+ action = if [:updated, :created].include?(event)
:send_asset
- elsif event == :delete
+ elsif event == :deleted
:delete_asset
else
raise NotImplementedError, "Unknown event -- #{event} -- #{filename}"
end
@@ -173,10 +173,10 @@
end
private
def watcher
- Filewatcher.new(Dir.pwd).watch() do |filename, event|
+ Filewatcher.new(Dir.pwd, every: true).watch() do |filename, event|
yield(filename, event)
end
end
def local_assets_list