Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.ruby Subject: Re: Ruby File Auto-Run Date: Fri, 16 Jun 2017 23:47:03 +0200 Lines: 28 Message-ID: References: <2752862f-0320-4075-9dea-34f7491ec756@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net LJx2jpsgaFwJ0NvROtSGGwDiZ9BwToz4uwfMyvf2IJbhCCpBI= Cancel-Lock: sha1:kqJKHqrBX64N9rZPzyRb+1JnQYw= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 In-Reply-To: <2752862f-0320-4075-9dea-34f7491ec756@googlegroups.com> Content-Language: en-US Xref: csiph.com comp.lang.ruby:7358 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