refactoring by skill
This commit is contained in:
+53
-11
@@ -43,35 +43,77 @@
|
||||
#:site-title [site-title "Racket Wiki"]
|
||||
#:session-seconds [session-seconds (* 12 60 60)]
|
||||
#:language [language "en"])
|
||||
(define normalized-listen-ip
|
||||
(if (equal? listen-ip "*")
|
||||
#f
|
||||
listen-ip))
|
||||
(wiki-config (path->complete-path data-dir)
|
||||
port
|
||||
normalized-listen-ip
|
||||
secure-cookie?
|
||||
site-title
|
||||
session-seconds
|
||||
language))
|
||||
(let ((normalized-listen-ip
|
||||
(if (equal? listen-ip "*")
|
||||
#f
|
||||
listen-ip)))
|
||||
(wiki-config (path->complete-path data-dir)
|
||||
port
|
||||
normalized-listen-ip
|
||||
secure-cookie?
|
||||
site-title
|
||||
session-seconds
|
||||
language)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Create the default wiki configuration.
|
||||
; pre : none.
|
||||
; post : No files or settings have been changed.
|
||||
; result : A wiki-config using the documented default values.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (default-wiki-config)
|
||||
(make-wiki-config))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the directory containing uploaded files.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No directory is created.
|
||||
; result : The uploads path below the configured data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (uploads-directory config)
|
||||
(build-path (wiki-config-data-dir config) "uploads"))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the directory reserved for deleted data.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No directory is created.
|
||||
; result : The deleted-data path below the configured data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (deleted-directory config)
|
||||
(build-path (wiki-config-data-dir config) "deleted"))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the writable static-data directory.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No directory is created.
|
||||
; result : The static path below the configured data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (data-static-directory config)
|
||||
(build-path (wiki-config-data-dir config) "static"))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the downloaded browser-library directory.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No directory is created.
|
||||
; result : The vendor path below the writable static-data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (vendor-directory config)
|
||||
(build-path (data-static-directory config) "vendor"))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the PostgreSQL settings file.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No file is created or read.
|
||||
; result : The database.rktd path below the configured data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (database-config-path config)
|
||||
(build-path (wiki-config-data-dir config) "database.rktd"))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Resolve the selected-language settings file.
|
||||
; pre : config is a wiki-config value.
|
||||
; post : No file is created or read.
|
||||
; result : The language.rktd path below the configured data directory.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(define (language-config-path config)
|
||||
(build-path (wiki-config-data-dir config) "language.rktd"))
|
||||
|
||||
Reference in New Issue
Block a user