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

Upgrade all dependencies to the latest versions #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 15 additions & 14 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@
:url "http://www.eclipse.org/legal/epl-v10.html"
:distribution :repo
:comments "same as Clojure"}
:dependencies [[cheshire "5.8.1"]
[metosin/ring-http-response "0.9.1"]
[ring/ring-core "1.7.1"]
[metosin/schema-tools "0.11.0"]
[prismatic/schema "1.1.10"]
[prismatic/plumbing "0.5.5"]
[metosin/scjsv "0.5.0"]
[clj-time "0.15.1"]
:dependencies [[cheshire "5.10.1"]
[metosin/ring-http-response "0.9.3"]
[ring/ring-core "1.9.4"]
[metosin/schema-tools "0.12.3"]
[prismatic/schema "1.2.0"]
[prismatic/plumbing "0.6.0"]
[metosin/scjsv "0.6.2"]
[clj-time "0.15.2"]
[org.tobereplaced/lettercase "1.0.0"]
[potemkin "0.4.5"]
[frankiesardo/linked "1.3.0"]]
:profiles {:dev {:plugins [[lein-clojars "0.9.1"]
[lein-ring "0.12.5"]
[lein-midje "3.2.1"]
[funcool/codeina "0.5.0"]]
:dependencies [[org.clojure/clojure "1.8.0"]
[midje "1.9.6" :exclusions [org.clojure/clojure
commons-codec]]
:dependencies [[org.clojure/clojure "1.10.3"]
[midje "1.10.5"
:exclusions [org.clojure/clojure
commons-codec]]
[ring-mock "0.1.5"]
[metosin/ring-swagger-ui "3.20.1"]
[metosin/ring-swagger-ui "4.0.0"]
[javax.servlet/javax.servlet-api "4.0.1"]]}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}}
:codeina {:sources ["src"]
:target "gh-pages/doc"
:src-uri "http://github.com/metosin/ring-swagger/blob/master/"
:src-uri-prefix "#L"}
:deploy-repositories [["releases" :clojars]]
:aliases {"all" ["with-profile" "dev:dev,1.7:dev,1.9"]
:aliases {"all" ["with-profile" "dev:dev,1.9"]
"test-ancient" ["midje"]})
9 changes: 4 additions & 5 deletions src/ring/swagger/extension.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
`(do ~@body#))))

(defextension java-time
(every?
(fn [c] (try (resolve c) (catch Exception _)))
'[java.time.Instant
java.time.LocalDate
java.time.LocalTime]))
(every? resolve
'[java.time.Instant
java.time.LocalDate
java.time.LocalTime]))
21 changes: 11 additions & 10 deletions test/ring/swagger/extension_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
(fact "undefined vars/classes are ignored in disabled extensions"
(resolve 'a) => nil
(disabled (a)) =not=> (throws Exception)
(resolve 'dummy.Class) => (throws ClassNotFoundException)
;; https://clojure.atlassian.net/browse/CLJ-1403 fixes `resolve`
;; to return nil, which was not the behavior in Clojure 1.8.0,
;; when this test was written.
(resolve 'dummy.Class) =not=> (throws ClassNotFoundException)
(resolve 'dummy.Class) => nil
(disabled (dummy.Class)) =not=> (throws Exception)))

(fact "java-time extension"
(let [java-time (try
(resolve 'java.time.Instant)
(catch Exception _))]
(if java-time
(fact "runs the enclosed form"
(extension/java-time :a) => :a)
(fact "skips the enclosed form"
(extension/java-time :a) => nil
(resolve 'java.time.Instant) => (throws ClassNotFoundException)))))
(if-let [java-time (resolve 'java.time.Instant)]
(fact "runs the enclosed form"
(extension/java-time :a) => :a)
(fact "skips the enclosed form"
(extension/java-time :a) => nil
(resolve 'java.time.Instant) => nil)))