nitiwiki: change some visibility to allow extensions
[nit.git] / contrib / nitiwiki / src / wiki_base.nit
index 6d7718b..70cf35f 100644 (file)
@@ -51,6 +51,10 @@ class Nitiwiki
        fun sync do
                var root = expand_path(config.root_dir, config.out_dir)
                var rsync_dir = config.rsync_dir
+               if rsync_dir == "" then
+                       message("Error: configure `wiki.rsync_dir` to use rsync.", 0)
+                       return
+               end
                sys.system "rsync -vr --delete -- {root.escape_to_sh}/ {rsync_dir.escape_to_sh}"
        end
 
@@ -147,7 +151,7 @@ class Nitiwiki
                path = path.simplify_path
                if entries.has_key(path) then return entries[path].as(WikiSection)
                var root = expand_path(config.root_dir, config.source_dir)
-               var name = path.basename("")
+               var name = path.basename
                var section = new WikiSection(self, name)
                entries[path] = section
                if path == root then return section
@@ -473,7 +477,7 @@ class WikiSection
        private fun try_load_config do
                var cfile = wiki.expand_path(wiki.config.root_dir, src_path, wiki.config_filename)
                if not cfile.file_exists then return
-               wiki.message("Custom config for section {name}", 1)
+               wiki.message("Custom config for section {name}", 2)
                config = new SectionConfig(cfile)
        end
 
@@ -611,9 +615,8 @@ class WikiConfig
        super ConfigTree
 
        # Returns the config value at `key` or return `default` if no key was found.
-       private fun value_or_default(key: String, default: String): String do
-               if not has_key(key) then return default
-               return self[key]
+       protected fun value_or_default(key: String, default: String): String do
+               return self[key] or else default
        end
 
        # Site name displayed.