From 6b505f3e6d5548bd4d8cc72fcdd4ff2210915c67 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 18 Dec 2023 05:05:48 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=F0=9F=A9=B9=20=E2=80=94=20Update=20te?= =?UTF-8?q?sts=20and=20code=20after=20dependencies=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++----- lib/Lufi.pm | 2 +- lib/Lufi/DB/Slice.pm | 2 +- t/test.t | 8 ++++---- themes/default/templates/files.html.ep | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 0b91ffb..967491a 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ XGETTEXT ?= carton exec local/bin/xgettext.pl -u CARTON ?= carton exec REAL_LUFI ?= script/application LUFI ?= script/lufi -LDAP_CONTAINER_IMAGE ?= rroemhild/test-openldap:latest +LDAP_CONTAINER_IMAGE ?= docker.io/rroemhild/test-openldap:latest LOCAL_LDAP_PORT ?= 10389 LOCAL_SWIFT_PORT ?= 8080 -SWIFT_CONTAINER_IMAGE ?= swiftstack/picoswiftstack:latest +SWIFT_CONTAINER_IMAGE ?= docker.io/openstackswift/saio:latest MORBO_HOST ?= 0.0.0.0 MORBO_PORT ?= 3000 @@ -33,15 +33,15 @@ dev: clean $(CARTON) morbo $(LUFI) --listen http://$(MORBO_HOST):$(MORBO_PORT) --watch lib/ --watch script/ --watch themes/ --watch lufi.conf ldap: - sudo docker run -d -p $(LOCAL_LDAP_PORT):10389 $(LDAP_CONTAINER_IMAGE); exit 0 + podman run -d -p $(LOCAL_LDAP_PORT):10389 $(LDAP_CONTAINER_IMAGE); exit 0 ldapdev: ldap dev swift: - sudo docker run -d --rm -p $(LOCAL_SWIFT_PORT):8080 --hostname="picoswiftstack" --name="picoswiftstack" $(SWIFT_CONTAINER_IMAGE); exit 0 + podman run -d --rm -p $(LOCAL_SWIFT_PORT):8080 --hostname="picoswiftstack" --name="picoswiftstack" $(SWIFT_CONTAINER_IMAGE); exit 0 @echo "Sleeping 20 seconds to let picoswiftstack start" @sleep 20 - sudo docker exec picoswiftstack get_auth + podman exec picoswiftstack get_auth swiftdev: swift dev diff --git a/lib/Lufi.pm b/lib/Lufi.pm index b8d3c8e..e68c9fd 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -191,7 +191,7 @@ sub startup { ->name('config'); # Generated js files - $r->get('/partial/:file') + $r->get('/partial/<:file>.<:ext>') ->to('Misc#js_files') ->name('partial'); diff --git a/lib/Lufi/DB/Slice.pm b/lib/Lufi/DB/Slice.pm index e877953..d49f1d5 100644 --- a/lib/Lufi/DB/Slice.pm +++ b/lib/Lufi/DB/Slice.pm @@ -140,7 +140,7 @@ sub store { # Write file my $file = catfile($c->app->config('upload_dir'), $c->get_path()); - Mojo::File->new($file)->spurt($text); + Mojo::File->new($file)->spew($text); } return $c; diff --git a/t/test.t b/t/test.t index 024e6bd..936132a 100644 --- a/t/test.t +++ b/t/test.t @@ -269,13 +269,13 @@ sub test_login { } sub restore_config { - $config_file->spurt($config_orig); + $config_file->spew($config_orig); } sub switch_to_htpasswd { $config_content = $config_orig; $config_content =~ s/#?htpasswd.*/htpasswd => 't\/lufi.passwd',/gm; - $config_file->spurt($config_content); + $config_file->spew($config_content); Lufi::DB::Slice->new(app => $m)->delete_all; Lufi::DB::File->new(app => $m)->delete_all; @@ -289,7 +289,7 @@ sub switch_to_htpasswd { sub switch_to_ldap { $config_content = $config_orig; $config_content =~ s/^( +)#?ldap => \{ uri/$1ldap => { uri/gm; - $config_file->spurt($config_content); + $config_file->spew($config_content); Lufi::DB::Slice->new(app => $m)->delete_all; Lufi::DB::File->new(app => $m)->delete_all; @@ -303,7 +303,7 @@ sub switch_to_ldap { sub switch_to_swift { $config_content = $config_orig; $config_content =~ s/^( +)#?swift => \{ auth_url/$1swift => { auth_url/gm; - $config_file->spurt($config_content); + $config_file->spew($config_content); Lufi::DB::Slice->new(app => $m)->delete_all; Lufi::DB::File->new(app => $m)->delete_all; diff --git a/themes/default/templates/files.html.ep b/themes/default/templates/files.html.ep index 954ed9d..9e48c00 100644 --- a/themes/default/templates/files.html.ep +++ b/themes/default/templates/files.html.ep @@ -39,6 +39,6 @@ -%= javascript '/partial/files.js.ep' +%= javascript '/partial/files.js' %= javascript '/js/lufi-files.js' %= javascript '/js/moment-with-locales.min.js'