guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.93k stars 247 forks source link

Raise argument error when passing a file path #563

Closed janko closed 1 year ago

janko commented 2 years ago

The Listen gem doesn't appear to support listening on changes of individual files, but currently if we pass a file path to Listen.on, the listener is successfully initialized, but it won't actually be listening on given files.

Listen.on(
  "app", # will listen
  "db/schema.sql" # won't listen
) { ... }

To improve clarity, we notify the user they need to pass a directory by raising an argument error if a path to file is passed in.