lib: move assets_dir
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 7 Oct 2015 15:38:34 +0000 (11:38 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 16 Dec 2015 13:44:46 +0000 (08:44 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/linux/linux.nit
lib/mnit/linux/linux_assets.nit

index 04a0c5d..a861593 100644 (file)
@@ -20,6 +20,12 @@ module linux
 import app
 
 redef class App
+       # Path to the expected location of the asset folder of this program
+       #
+       # The asset folder should be located relative to the executable at `../assets/`.
+       # This value can be redefined to change the expected location.
+       var assets_dir: String = sys.program_name.dirname / "../assets/" is lazy
+
        redef fun setup
        do
                super
index 393b77d..b61d234 100644 (file)
@@ -20,15 +20,6 @@ import mnit
 import linux_app
 
 redef class App
-       var assets_dir: String
-
-       redef fun setup
-       do
-               assets_dir = sys.program_name.dirname + "/../assets/"
-
-               super
-       end
-
        redef fun try_loading_asset( id )
        do
                var path = "{assets_dir}/{id}"