• Ruby File Auto-Run

    From BeeRich33@21:1/5 to All on Fri Jun 16 12:54:55 2017
    Hi folks.

    Looking for a reliable ruby file reloader. I've tried `kicker` and `filewatcher` with the latter being mostly reliable, but it too has issues loading newly installed gems.

    /users/rich/app.rb:76:in `require': cannot load such file -- pdf-reader (LoadError)

    For those not familiar with this sort of approach, I have a file `~/app.rb` that gets watched by one of these gems. When it gets saved, an instruction gets sent so that the terminal display re-runs the file.

    filewatcher "/users/rich/app.rb" "clear; ruby /users/rich/app.rb"

    Essentially, "Filewatcher, when this file is changed, run this bash script". For the most part, works like a charm. For some reason it trips on a `require`.

    Any other gems out there that qualify?

    Cheers

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Klemme@21:1/5 to All on Fri Jun 16 23:47:03 2017
    On 16.06.2017 21:54, BeeRich33 wrote:

    Looking for a reliable ruby file reloader. I've tried `kicker` and `filewatcher` with the latter being mostly reliable, but it too has issues loading newly installed gems.

    /users/rich/app.rb:76:in `require': cannot load such file -- pdf-reader (LoadError)

    Could be an environment issue. Does filewatcher modify the environment?

    For those not familiar with this sort of approach, I have a file `~/app.rb` that gets watched by one of these gems. When it gets saved, an instruction gets sent so that the terminal display re-runs the file.

    filewatcher "/users/rich/app.rb" "clear; ruby /users/rich/app.rb"

    Essentially, "Filewatcher, when this file is changed, run this bash script". For the most part, works like a charm. For some reason it trips on a `require`.

    Any other gems out there that qualify?

    Why use a gem? Why not use inotifywatch directly?

    http://manpages.ubuntu.com/manpages/xenial/en/man1/inotifywatch.1.html

    You can explicitly watch for "close_write" which should be the time when
    you want to reexecute the program.

    Cheers

    robert

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)