Change to git.journeyman.cc as canonical repository
This commit is contained in:
parent
f1b6379934
commit
05c2ef93d8
|
@ -1,6 +1,6 @@
|
||||||
# adl-support
|
# adl-support
|
||||||
|
|
||||||
A Clojure library designed to support auto-generated [ADL](https://github.com/simon-brooke/adl) code. This library should normally be included into projects generated by ADL, and consequently is licenced under the MIT license, which is less restrictive than the GNU General Public License which I normally use.
|
A Clojure library designed to support auto-generated [ADL](https://git.journeyman.cc/simon/adl) code. This library should normally be included into projects generated by ADL, and consequently is licenced under the MIT license, which is less restrictive than the GNU General Public License which I normally use.
|
||||||
|
|
||||||
[](https://clojars.org/adl-support)
|
[](https://clojars.org/adl-support)
|
||||||
|
|
||||||
|
@ -8,6 +8,10 @@ A Clojure library designed to support auto-generated [ADL](https://github.com/si
|
||||||
|
|
||||||
You don't really use this; code auto-generated by ADL does. Some functions which may be more generally useful are in `adl-support.core`, q.v.
|
You don't really use this; code auto-generated by ADL does. Some functions which may be more generally useful are in `adl-support.core`, q.v.
|
||||||
|
|
||||||
|
## Note: GitHub
|
||||||
|
|
||||||
|
This project was hosted on GitHub at https://github.com/simon-brooke/adl-support. In accordance with journeyman policy the canonical repository is now [https://git.journeyman.cc/simon/adl-support](https://git.journeyman.cc/simon/adl-support). While the GitHub repository still exists it is no longer maintained and will in due course be colled.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright © 2018 Simon Brooke
|
Copyright © 2018 Simon Brooke
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
`k` in map `m`, as read by read."
|
`k` in map `m`, as read by read."
|
||||||
[k m]
|
[k m]
|
||||||
(let [v (m k)
|
(let [v (m k)
|
||||||
vr (if
|
vr (when
|
||||||
(string? v)
|
(string? v)
|
||||||
(try
|
(try
|
||||||
(json/read-str v)
|
(json/read-str v)
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
(number? vr)
|
(number? vr)
|
||||||
;; there's a problem that json/read-str will read "07777 888999" as 7777
|
;; there's a problem that json/read-str will read "07777 888999" as 7777
|
||||||
(re-matches #"^[0-9.]+$" v)) {(keyword k) vr}
|
(re-matches #"^[0-9.]+$" v)) {(keyword k) vr}
|
||||||
true
|
:else
|
||||||
{(keyword k) v})))
|
{(keyword k) v})))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,7 @@
|
||||||
(defn safe-name
|
(defn safe-name
|
||||||
"Return a safe name for the object `o`, given the specified `convention`.
|
"Return a safe name for the object `o`, given the specified `convention`.
|
||||||
`o` is expected to be either a string or an element. Recognised values for
|
`o` is expected to be either a string or an element. Recognised values for
|
||||||
`convention` are: #{:c :c-sharp :java :sql}"
|
`convention` are: #{:c :c-sharp :clojure :java :sql}"
|
||||||
([o]
|
([o]
|
||||||
(cond
|
(cond
|
||||||
(element? o)
|
(element? o)
|
||||||
|
@ -300,6 +300,7 @@
|
||||||
capitalised (capitalise string)]
|
capitalised (capitalise string)]
|
||||||
(case convention
|
(case convention
|
||||||
(:sql :c) (s/replace string #"[^a-zA-Z0-9_]" "_")
|
(:sql :c) (s/replace string #"[^a-zA-Z0-9_]" "_")
|
||||||
|
:clojure (s/replace string #"[^a-zA-Z0-9-]" "-")
|
||||||
:c-sharp (s/replace capitalised #"[^a-zA-Z0-9]" "")
|
:c-sharp (s/replace capitalised #"[^a-zA-Z0-9]" "")
|
||||||
:java (let
|
:java (let
|
||||||
[camel (s/replace capitalised #"[^a-zA-Z0-9]" "")]
|
[camel (s/replace capitalised #"[^a-zA-Z0-9]" "")]
|
||||||
|
@ -611,7 +612,12 @@
|
||||||
(symbol (str "db/" n))
|
(symbol (str "db/" n))
|
||||||
n)
|
n)
|
||||||
(do
|
(do
|
||||||
(*warn* "Argument passed to `list-related-query-name` was a non-entity")
|
(*warn*
|
||||||
|
(str "Argument "
|
||||||
|
(cond
|
||||||
|
(not (entity? nearside)) (or (-> nearside :attrs :name) nearside "nearside")
|
||||||
|
(not (entity? farside)) (or (-> farside :attrs :name) farside "farside"))
|
||||||
|
" passed to `list-related-query-name` was a non-entity"))
|
||||||
nil))))
|
nil))))
|
||||||
([property nearside farside]
|
([property nearside farside]
|
||||||
(list-related-query-name property nearside farside false)))
|
(list-related-query-name property nearside farside false)))
|
||||||
|
|
Loading…
Reference in a new issue