Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7358

Re: Ruby File Auto-Run

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: Ruby File Auto-Run
Date Fri, 16 Jun 2017 23:47:03 +0200
Lines 28
Message-ID <eqj1uoFsmsiU1@mid.individual.net> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar


Thread

Ruby File Auto-Run BeeRich33 <beerich@gmail.com> - 2017-06-16 12:54 -0700
  Re: Ruby File Auto-Run Robert Klemme <shortcutter@googlemail.com> - 2017-06-16 23:47 +0200

csiph-web