From 08dc3dbd98785076d265bcecfcbcbfff411854b2 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 10 Jun 2023 22:54:05 -0700 Subject: [PATCH 1/4] Update README.md Fix required ns name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c34a750..175422a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Add the following requirement to your namespace: ```clojure (ns your.fine.namespace - (:require [cc.journeyman.real-name :refer [get-real-name]])) + (:require [cc.journeyman.real-name.core :refer [get-real-name]])) ``` Resolve usernames to real names by invoking `(get-real-name)`, either without From 63125d6ee5bb4cbefa2169bc53616b9e826d4868 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 10 Jun 2023 22:58:19 -0700 Subject: [PATCH 2/4] Ensure gecos string has at least two fields For a `gecos` string like `,,,`, `clojure.string/split` produces `[]` so `interleave` produces an empty result (it stops on the shortest sequence) and so the `apply assoc` fails with two few arguments. This ensures that the `gecos` string will always produce a non-empty result from the `split` so the rest works. Note that `(split "a,,," #",")` produces `["a"]` -- the empty trailing elements are ignored/dropped. --- src/cc/journeyman/real_name/core.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/journeyman/real_name/core.clj b/src/cc/journeyman/real_name/core.clj index 531f077..7f1f492 100644 --- a/src/cc/journeyman/real_name/core.clj +++ b/src/cc/journeyman/real_name/core.clj @@ -33,7 +33,7 @@ "Process this `gecos` field into a map of its sub-fields. See https://en.wikipedia.org/wiki/Gecos_field" [gecos] - (delimited-record->map gecos #"," [:real-name :address :work-phone :home-phone :other])) + (delimited-record->map (str gecos ",?") #"," [:real-name :address :work-phone :home-phone :other])) (defn process-passwd-line "Process this `line` from a passwd file" @@ -168,4 +168,4 @@ ([] (get-real-name)) ([username] - (get-real-name username))) \ No newline at end of file + (get-real-name username))) From 6d03aa4dd9ac54de7d0ccb300c7c85743ddecc71 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 11 Jun 2023 07:32:29 +0100 Subject: [PATCH 3/4] Upversioned to 1.0.2 after merging Sean Corfield's pull requests --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 17f653b..050ab30 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.clojars.simon_brooke/real-name "1.0.1" +(defproject org.clojars.simon_brooke/real-name "1.0.2" :codox {:metadata {:doc "**TODO**: write docs" :doc/format :markdown} :output-path "docs" From ab1b868f3f6ad6c41da52168085743836f8d21c4 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 11 Jun 2023 07:37:16 +0100 Subject: [PATCH 4/4] Bother! Forgot to update version in README! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 175422a..d5e2aa6 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ there did not seem to be any other ways to do it. If building from Leiningen, add to project dependencies ```clojure -[org.clojars.simon_brooke/real-name "1.0.1"] +[org.clojars.simon_brooke/real-name "1.0.2"] ``` Add the following requirement to your namespace: