guard / listen

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

Raise argument error when passing a file path #563

Closed janko closed 1 year ago

janko commented 1 year 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.