Skip to content

Commit f838334

Browse files
author
R. S. Doiel
committed
prep for v1.2.12 release
1 parent 1128bff commit f838334

File tree

104 files changed

+185
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+185
-150
lines changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ maintainers:
1515
orcid: "https://orcid.org/0000-0003-0900-6903"
1616

1717
repository-code: "https://github.com/caltechlibrary/datatools"
18-
version: 1.2.11
18+
version: 1.2.12
1919
license-url: "https://data.caltech.edu/license"
2020
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ RELEASE_DATE=$(shell date +'%Y-%m-%d')
99

1010
RELEASE_HASH=$(shell git log --pretty=format:'%h' -n 1)
1111

12-
1312
PROGRAMS = codemeta2cff csv2json csv2mdtable csv2tab csv2xlsx csvcleaner csvcols csvfind csvjoin csvrows finddir findfile json2toml json2yaml jsoncols jsonjoin jsonmunge jsonrange mergepath range reldate reltime sql2csv string tab2csv timefmt toml2json urlparse xlsx2csv xlsx2json yaml2json jsonobjects2csv
1413

1514
MAN_PAGES = codemeta2cff.1 csv2json.1 csv2mdtable.1 csv2tab.1 csv2xlsx.1 csvcleaner.1 csvcols.1 csvfind.1 csvjoin.1 csvrows.1 finddir.1 findfile.1 json2toml.1 json2yaml.1 jsoncols.1 jsonjoin.1 jsonmunge.1 jsonrange.1 mergepath.1 range.1 reldate.1 reltime.1 sql2csv.1 string.1 tab2csv.1 timefmt.1 toml2json.1 urlparse.1 xlsx2csv.1 xlsx2json.1 yaml2json.1 jsonobjects2csv.1
@@ -48,9 +47,6 @@ version.go: .FORCE
4847
--template codemeta-version-go.tmpl \
4948
LICENSE >version.go
5049

51-
52-
53-
5450
about.md: codemeta.json .FORCE
5551
cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
5652
if [ -f $(PANDOC) ]; then echo "" | $(PANDOC) --metadata title="About $(PROJECT)" --metadata-file=_codemeta.json --template=codemeta-md.tmpl >about.md; fi
@@ -218,7 +214,7 @@ gen_batfiles: .FORCE
218214

219215
snap: dist/datatools_$(VERSION)_amd64.snap
220216

221-
release: .FORCE installer.sh clean build man gen_batfiles distribute_docs dist/Linux-x86_64 dist/macOS-x86_64 dist/macOS-arm64 dist/Windows-x86_64 dist/Windows-arm64 dist/Linux-armv7l dist/Linux-aarch64
217+
release: .FORCE clean build man gen_batfiles distribute_docs dist/Linux-armv7l dist/Linux-aarch64 dist/Linux-x86_64 dist/macOS-x86_64 dist/macOS-arm64 dist/Windows-x86_64 dist/Windows-arm64
222218

223219

224220
.FORCE:

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<section>
2727
<h1 id="about-this-software">About this software</h1>
28-
<h2 id="datatools-1.2.11">datatools 1.2.11</h2>
28+
<h2 id="datatools-1.2.12">datatools 1.2.12</h2>
2929
<h3 id="authors">Authors</h3>
3030
<ul>
3131
<li>R. S. Doiel</li>

about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors:
1111
orcid: "https://orcid.org/0000-0003-0900-6903"
1212

1313
repository-code: "https://github.com/caltechlibrary/datatools"
14-
version: 1.2.11
14+
version: 1.2.12
1515
license-url: "https://data.caltech.edu/license"
1616
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
1717

@@ -20,7 +20,7 @@ keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
2020
About this software
2121
===================
2222

23-
## datatools 1.2.11
23+
## datatools 1.2.12
2424

2525
### Authors
2626

codemeta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"license": "https://data.caltech.edu/license",
55
"codeRepository": "https://github.com/caltechlibrary/datatools",
66
"dateCreated": "2017-02-06",
7-
"dateRelease": "2024-10-24",
8-
"dateModified": "2024-10-24",
7+
"dateRelease": "2024-11-07",
8+
"dateModified": "2024-11-07",
99
"downloadUrl": "https://github.com/caltechlibrary/datatools/releases/",
1010
"issueTracker": "https://github.com/caltechlibrary/datatools/issues",
1111
"name": "datatools",
12-
"version": "1.2.11",
12+
"version": "1.2.12",
1313
"description": "A set of command line tools for working with CSV, Excel Workbooks, JSON and structured text documents.",
14-
"releaseNotes": "fix isssue#21, CopyrightYear is an int",
14+
"releaseNotes": "fix issue #22, identifying DOI without http prefix",
1515
"applicationCategory": "computer programming",
1616
"developmentStatus": "active",
1717
"funder": {

codemeta/codemeta.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import (
77

88
// Caltech Library package
99
"github.com/caltechlibrary/doitools"
10+
11+
// 3rd Party Package
12+
"github.com/hscells/doi"
1013
)
1114

1215
type PersonOrOrganization struct {
@@ -53,6 +56,7 @@ type Codemeta struct {
5356
// Additional codemeta Terms are defined at https://codemeta.github.io/terms/
5457
}
5558

59+
5660
func (person *PersonOrOrganization) ToJSON() ([]byte, error) {
5761
return JSONMarshalIndent(person, "", "\t")
5862
}
@@ -71,6 +75,15 @@ func (person *PersonOrOrganization) ToCFF() ([]byte, error) {
7175
orcid: %s`, person.FamilyName, person.GivenName, person.Id)), nil
7276
}
7377

78+
// Check if identifier is a DOI
79+
func isDOI(identifier string) bool {
80+
doi, err := doi.Parse(identifier)
81+
if err != nil {
82+
return false
83+
}
84+
return doi.IsValid()
85+
}
86+
7487
// ToCff crosswalks a Codemeta data structure rendering
7588
// CITATION.cff document as an array of byte.
7689
// Based on documentation at https://citation-file-format.github.io/
@@ -96,7 +109,7 @@ repository-code: %q`, cm.CodeRepository))...)
96109
src = append(src, []byte(`
97110
type: software`)...)
98111
}
99-
if strings.HasPrefix(cm.Identifier, "https://doi.org/") {
112+
if isDOI(cm.Identifier) {
100113
if doi, err := doitools.NormalizeDOI(cm.Identifier); err == nil {
101114
src = append(src, []byte(fmt.Sprintf(`
102115
doi: %s`, doi))...)

codemeta/codemeta_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ import (
44
"testing"
55
)
66

7+
func TestIsDOI(t *testing.T) {
8+
identifier := "10.22002/5rbqw-9cc91"
9+
expected := true
10+
got := isDOI(identifier)
11+
if expected != got {
12+
t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
13+
}
14+
identifier = "0000-1111-2222-3333"
15+
expected = false
16+
got = isDOI(identifier)
17+
if expected != got {
18+
t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
19+
}
20+
21+
22+
}
23+
724
func TestCodemeta(t *testing.T) {
825
t.Errorf("TestCodemeta() not implemented.")
926
}

codemeta2cff.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%codemeta2cff(1) user manual | version 1.2.11 ff4493f
1+
%codemeta2cff(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

csv2json.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2json(1) user manual | version 1.2.11 ff4493f
1+
%csv2json(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

csv2mdtable.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h1 id="examples">EXAMPLES</h1>
7979
<pre><code> cat data1.csv | csv2mdtable &gt; data1.md</code></pre>
8080
<p>Convert data1.csv to data1.md using options.</p>
8181
<pre><code> csv2mdtable -i data1.csv -o data1.md</code></pre>
82-
<p>csv2mdtable 1.2.11</p>
82+
<p>csv2mdtable 1.2.12</p>
8383
</section>
8484

8585
<footer>

0 commit comments

Comments
 (0)