Merge: mongodb: Fixed failing test for `aggregate` method.
[nit.git] / contrib / sort_downloads / README.md
index 00cb3e1..f366b8c 100644 (file)
@@ -1,4 +1,4 @@
-# sort_downloads
+Script to sort content of a folder in many folders according to their names.
 
 This scripts sorts files from a given directory to subfolders in the destination directory. It uses directory names as patterns to sort the files and thus moves each file to a directory with a similar name. Multiple directories may be used to specify the patterns to look for, but the files will only be copied to subfolders in the target directory. This features ensures a clean support for a multi-disk system.
 
@@ -46,18 +46,20 @@ Your old hard drive is full and you bought a new one. You now want to copy your
 
 If you need more than one configuration, let's say to sort videos, you can use Nit class refinement. Create a separate Nit module next to `src/sort_downloads.nit` named `sort_videos.nit` and use something like:
 
-    #!/usr/bin/env nit
+~~~nitish
+#!/usr/bin/env nit
 
-    import sort_downloads
+import sort_downloads
 
-    redef class Config
-           redef fun source_dir do return "/media/new-drive/video-downloads"
-           redef fun dest_dir do return "/media/new-drive/Videos"
-           redef fun regex_source_dirs do return ["~/Videos", dest_dir]
-           redef fun elapsed_days do return 0
-    end
+redef class Config
+       redef fun source_dir do return "/media/new-drive/video-downloads"
+       redef fun dest_dir do return "/media/new-drive/Videos"
+       redef fun regex_source_dirs do return ["~/Videos", dest_dir]
+       redef fun elapsed_days do return 0
+end
 
-    super # this executes the program
+super # this executes the program
+~~~
 
 ## Sort only older files