This is a tiny example on how to use Linux::Inotify2 from within a Mojolicious application to watch a file for modification. Note: this will not work with morbo, as no inotify will be delivered to the app. Update: it works with morbo if you use our $io = … instead of my $io = …. The reason for that is, my $io goes out of scope as app->start() does not block.
Run your app (again, morbo will not work): /tmp/i.pl daemon
In another shell, update the watched file: touch /tmp/foo
This is what Mojolicious should log:
Code:
#!/usr/bin/perl
use Mojolicious::Lite;
use Linux::Inotify2;
use EV;
use AnyEvent;
sub file_changed {
app->log->debug("file changed");
}
sub setup_notify {
my $inotify = new Linux::Inotify2;
$inotify->watch('/tmp/foo', IN_ALL_EVENTS,
\&file_changed);
my $io = AnyEvent->io(
fh => $inotify->{fd},
poll => 'r',
cb => sub { $inotify->poll }
);
return $io;
}
get '/' => sub { shift->render_text('index') };
our $io = setup_notify();
app->start();
This release fixes undefined constant/variable warnings, an error during checks triggerd by a missing table, the has_cap deprecation warning and a bug where the activation hook may not be run.
Turns out this error message meant, wireless radio is hard blocked by BIOS. So after enabling wireless radio in the BIOS, I now have a working access point.
Hover 0.6.13 adds support for predefined image popups and fixes a couple of bugs.
Image Popups
In the past hover could generate popups for all HTML tags (including ) from their title attribute. To have the same popup for an image you had to enter the same text every time you inserted that image. While this worked, it was tedious, error prone and hard to change later on.
Hover 0.6.13 now let’s you define a popup for an image once and every time you use that image, it will get the same popup. Popups are assigned to Images by their absolut URL.
Bugs fixed
cleanup and fixed plugin activation error detection, table creation and database checks
correctly set database schema version on first time install
HTML encode aposthrophe in popups, fixing possible javascript error