Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps #250

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .wallbrew/sealog/changes/2-6-0.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{:version {:major 2
:minor 6
:patch 0}
:version-type :semver3
:changes {:added []
:changed ["Removed dependency on `nnichols/nnichols` and added an explicit dependency on `org.clojure/test.check`"]
:deprecated []
:removed []
:fixed []
:security []}
:timestamp "2024-10-21T14:23:47.927779058Z"}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Table of Contents

* [2.6.0 - 2024-10-21](#260---2024-10-21)
* [2.5.0 - 2024-10-21](#250---2024-10-21)
* [2.4.1 - 2024-10-13](#241---2024-10-13)
* [2.4.0 - 2024-09-21](#240---2024-09-21)
Expand All @@ -23,6 +24,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* [1.0.0 - 2020-05-05](#100---2020-05-05)
* [0.0.0 - 2020-03-17](#000---2020-03-17)

## 2.6.0 - 2024-10-21

* Changed
* Removed dependency on `nnichols/nnichols` and added an explicit dependency on `org.clojure/test.check`

## 2.5.0 - 2024-10-21

* Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common-beer-format",
"version": "2.5.0",
"version": "2.6.0",
"description": "An implementation of the BeerXML spec in multiple formats",
"main": "index.js",
"directories": {
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.wallbrew</groupId>
<artifactId>common-beer-format</artifactId>
<packaging>jar</packaging>
<version>2.5.0</version>
<version>2.6.0</version>
<name>common-beer-format</name>
<description>An implementation of the BeerXML spec in multiple formats.</description>
<url>https://github.com/Wall-Brew-Co/common-beer-format</url>
Expand All @@ -20,7 +20,7 @@
<url>https://github.com/Wall-Brew-Co/common-beer-format</url>
<connection>scm:git:git://github.com/Wall-Brew-Co/common-beer-format.git</connection>
<developerConnection>scm:git:ssh://[email protected]/Wall-Brew-Co/common-beer-format.git</developerConnection>
<tag>fe7eeddfc8d84ab7eba600f6016f50032285e907</tag>
<tag>befa885062067f01243c4330cf7127de72c86f74</tag>
</scm>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down Expand Up @@ -70,11 +70,6 @@
<artifactId>spec-tools</artifactId>
<version>0.10.7</version>
</dependency>
<dependency>
<groupId>nnichols</groupId>
<artifactId>nnichols</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
Expand All @@ -86,6 +81,11 @@
<version>1.11.132</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>test.check</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.wallbrew</groupId>
<artifactId>clj-xml</artifactId>
Expand Down
7 changes: 4 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject com.wallbrew/common-beer-format "2.5.0"
(defproject com.wallbrew/common-beer-format "2.6.0"
:description "An implementation of the BeerXML spec in multiple formats."
:url "https://github.com/Wall-Brew-Co/common-beer-format"
:license {:name "MIT"
Expand All @@ -10,10 +10,11 @@
:pom-addition [:organization
[:name "Wall Brew Co."]
[:url "https://wallbrew.com"]]
:pedantic? true
:dependencies [[metosin/spec-tools "0.10.7"]
[nnichols/nnichols "1.1.0"]
[org.clojure/clojure "1.12.0"]
[org.clojure/clojurescript "1.11.132" :scope "provided"]]
[org.clojure/clojurescript "1.11.132" :scope "provided"]
[org.clojure/test.check "1.1.1"]]
:plugins [[com.github.clj-kondo/lein-clj-kondo "2024.09.27"]
[com.wallbrew/bouncer "1.1.1"]
[com.wallbrew/lein-sealog "1.8.0"]
Expand Down
16 changes: 14 additions & 2 deletions src/common_beer_format/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
:no-doc true}
(:require [clojure.string :as str]
[clojure.test.check.generators :as gen]
[nnichols.parse :as n-parse]
[spec-tools.core :as st]))


Expand All @@ -15,13 +14,26 @@
(st/type-transformer st/strip-extra-keys-transformer st/strip-extra-values-transformer st/string-transformer))


(defn is-boolean?
"Returns true iff `x` is a boolean.
Compatibility extension for older versions of Clojure."
{:added "2.6"
:no-doc true}
[x]
#?(:clj (instance? Boolean x)
:cljs (or (true? x)
(false? x))))


(defn decode-boolean
"Decode an XML-like Boolean string to an actual boolean."
{:added "1.0"
:no-doc true
:see-also ["encode-boolean"]}
[_spec value]
(-> value str n-parse/parse-boolean))
(if (boolean? value)
value
(-> value str str/lower-case parse-boolean)))


(defn encode-boolean
Expand Down
3 changes: 1 addition & 2 deletions src/common_beer_format/primitives.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
(:require [clojure.spec.alpha :as spec]
[clojure.string :as str]
[common-beer-format.impl :as impl]
[nnichols.predicate :as np]
[spec-tools.core :as st]))


Expand Down Expand Up @@ -96,7 +95,7 @@

(spec/def ::boolean
(st/spec
{:spec np/boolean?
{:spec impl/is-boolean?
:description "A boolean logic value of true or false."
impl/beer-xml-type-key impl/beer-xml-boolean
:json-schema/example false
Expand Down
4 changes: 3 additions & 1 deletion test/common_beer_format/impl_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
(deftest decode-boolean-test
(testing "Can decode strings into booleans"
(is (true? (sut/decode-boolean :somearg "true")))
(is (false? (sut/decode-boolean :somearg "false")))))
(is (false? (sut/decode-boolean :somearg "false")))
(is (true? (sut/decode-boolean :somearg true)))
(is (false? (sut/decode-boolean :somearg false)))))


(deftest encode-boolean-test
Expand Down
Loading