Browse files

Clojure 1.4.0

  • Loading branch information...
1 parent 8be2ad6 commit 710f41eb6752cce244e1bf201ced2566f2c8dfa6 @xeqi xeqi committed Apr 28, 2012
View
5 dev-resources/config.clj
@@ -1,4 +1,7 @@
-{:db {:classname "org.sqlite.JDBC"
+{:port 8080
+ :bind "0.0.0.0"
+ :nailgun-bind "127.0.0.1"
+ :db {:classname "org.sqlite.JDBC"
:subprotocol "sqlite"
:subname "data/dev_db"}
:key-file "data/dev_authorized_keys"
View
2 project.clj
@@ -1,5 +1,5 @@
(defproject clojars-web "0.7.2-SNAPSHOT"
- :dependencies [[org.clojure/clojure "1.3.0"]
+ :dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/tools.cli "0.2.1"]
[org.apache.maven/maven-model "3.0.4"
:exclusions
View
4 src/clojars/config.clj
@@ -1,6 +1,6 @@
(ns clojars.config
- (:use [clojure.tools.cli :only [cli]])
- (:require [clojure.java.io :as io]
+ (:require [clojure.tools.cli :refer [cli]]
+ [clojure.java.io :as io]
[clojure.string :as str]
[ring.util.codec :as codec]))
View
12 src/clojars/db.clj
@@ -1,10 +1,12 @@
(ns clojars.db
- (:use [clojars.config :only [config]]
- korma.db
- korma.core)
(:require [clojure.string :as str]
[clojure.java.io :as io]
- [clojure.java.jdbc :as sql])
+ [clojure.java.jdbc :as sql]
+ [clojars.config :refer [config]]
+ [korma.db :refer [defdb transaction]]
+ [korma.core :refer [defentity select group fields order
+ modifier exec-raw where limit values
+ raw insert update set-fields]])
(:import java.security.MessageDigest
java.util.Date
java.io.File
@@ -259,4 +261,4 @@
(or offset 0)]]
:results)]
;; TODO: do something less stupidly slow
- (vec (map #(find-jar (:group_name %) (:jar_name %)) r))))
+ (vec (map #(find-jar (:group_name %) (:jar_name %)) r))))
View
8 src/clojars/main.clj
@@ -1,8 +1,8 @@
(ns clojars.main
- (:use [ring.adapter.jetty :only [run-jetty]]
- [clojars.web :only [clojars-app]]
- [clojars.config :only [config configure]])
- (:require [clojars.scp])
+ (:require [clojars.scp]
+ [ring.adapter.jetty :refer [run-jetty]]
+ [clojars.web :refer [clojars-app]]
+ [clojars.config :refer [config configure]])
(:import com.martiansoftware.nailgun.NGServer
java.net.InetAddress)
(:gen-class))
View
4 src/clojars/scp.clj
@@ -2,8 +2,8 @@
(:import (java.io InputStream IOException File OutputStream
FileOutputStream)
com.martiansoftware.nailgun.NGContext)
- (:use [clojars.config :only [config]])
- (:require [clojars.maven :as maven]
+ (:require [clojars.config :refer [config]]
+ [clojars.maven :as maven]
[clojars.db :as db]
[cemerick.pomegranate.aether :as aether])
(:gen-class
View
36 src/clojars/web.clj
@@ -1,22 +1,22 @@
(ns clojars.web
- (:use [clojars.db :only [group-membernames find-user add-member
- find-jar recent-versions count-versions]]
- [clojars.web.dashboard :only [dashboard index-page]]
- [clojars.web.search :only [search]]
- [clojars.web.user :only [profile-form update-profile show-user
- register register-form
- forgot-password forgot-password-form]]
- [clojars.web.group :only [show-group]]
- [clojars.web.jar :only [show-jar show-versions]]
- [clojars.web.common :only [html-doc]]
- [clojars.web.login :only [login login-form]]
- [hiccup.core :only [html h]]
- [ring.middleware.file-info :only [wrap-file-info]]
- [ring.middleware.resource :only [wrap-resource]]
- [ring.util.response :only [redirect status response]]
- [compojure.core :only [defroutes GET POST ANY]]
- [compojure.handler :only [site]]
- [compojure.route :only [not-found]]))
+ (:require [clojars.db :refer [group-membernames find-user add-member
+ find-jar recent-versions count-versions]]
+ [clojars.web.dashboard :refer [dashboard index-page]]
+ [clojars.web.search :refer [search]]
+ [clojars.web.user :refer [profile-form update-profile show-user
+ register register-form
+ forgot-password forgot-password-form]]
+ [clojars.web.group :refer [show-group]]
+ [clojars.web.jar :refer [show-jar show-versions]]
+ [clojars.web.common :refer [html-doc]]
+ [clojars.web.login :refer [login login-form]]
+ [hiccup.core :refer [html h]]
+ [ring.middleware.file-info :refer [wrap-file-info]]
+ [ring.middleware.resource :refer [wrap-resource]]
+ [ring.util.response :refer [redirect status response]]
+ [compojure.core :refer [defroutes GET POST ANY]]
+ [compojure.handler :refer [site]]
+ [compojure.route :refer [not-found]]))
(defn not-found-doc []
(html [:h1 "Page not found"]
View
7 src/clojars/web/common.clj
@@ -1,7 +1,8 @@
(ns clojars.web.common
- (:use hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers))
+ (:require [hiccup.core :refer [html h]]
+ [hiccup.page-helpers :refer [html5 include-css include-js
+ link-to unordered-list]]
+ [hiccup.form-helpers :refer [form-to]]))
(defn when-ie [& contents]
(str
View
9 src/clojars/web/dashboard.clj
@@ -1,9 +1,8 @@
(ns clojars.web.dashboard
- (:use clojars.web.common
- clojars.db
- hiccup.page-helpers
- hiccup.form-helpers
- hiccup.core))
+ (:require [clojars.web.common :refer [html-doc jar-link group-link tag]]
+ [clojars.db :refer [jars-by-username find-groupnames recent-jars]]
+ [hiccup.core :refer [h]]
+ [hiccup.page-helpers :refer [unordered-list link-to]]))
(defn index-page [account]
(html-doc account nil
View
9 src/clojars/web/group.clj
@@ -1,9 +1,8 @@
(ns clojars.web.group
- (:use clojars.web.common
- clojars.db
- hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers))
+ (:require [clojars.web.common :refer [html-doc jar-link user-link error-list]]
+ [clojars.db :refer [jars-by-groupname]]
+ [hiccup.page-helpers :refer [unordered-list]]
+ [hiccup.form-helpers :refer [form-to text-field submit-button]]))
(defn show-group [account groupname membernames & errors]
(html-doc account (str groupname " group")
View
8 src/clojars/web/jar.clj
@@ -1,8 +1,8 @@
(ns clojars.web.jar
- (:use clojars.web.common
- hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers))
+ (:require [clojars.web.common :refer [html-doc jar-link group-link
+ tag jar-url jar-name user-link]]
+ [hiccup.core :refer [h]]
+ [hiccup.page-helpers :refer [link-to]]))
(defn url-for [jar]
(str (jar-url jar) "/versions/" (:version jar)))
View
13 src/clojars/web/login.clj
@@ -1,11 +1,10 @@
(ns clojars.web.login
- (:use clojars.web.common
- clojars.db
- hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers
- ring.middleware.session.store
- ring.util.response))
+ (:require [clojars.web.common :refer [html-doc]]
+ [clojars.db :refer [auth-user update-user]]
+ [hiccup.page-helpers :refer [link-to]]
+ [hiccup.form-helpers :refer [form-to label text-field
+ password-field submit-button]]
+ [ring.util.response :refer [redirect]]))
(defn login-form [ & [error]]
(html-doc nil "Login"
View
10 src/clojars/web/search.clj
@@ -1,10 +1,8 @@
(ns clojars.web.search
- (:use clojars.web.common
- clojars.db
- hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers)
- (:require [cheshire.core :as json]))
+ (:require [clojars.web.common :refer [html-doc jar-link user-link]]
+ [clojars.db :refer [search-jars]]
+ [hiccup.core :refer [h]]
+ [cheshire.core :as json]))
(defn format-date [s]
(.format (java.text.SimpleDateFormat. "yyyy-MM-dd") s))
View
23 src/clojars/web/user.clj
@@ -1,13 +1,18 @@
(ns clojars.web.user
- (:use [clojure.string :only [blank?]]
- clojars.db
- clojars.web.common
- hiccup.core
- hiccup.page-helpers
- hiccup.form-helpers
- ring.middleware.session.store
- ring.util.response)
- (:require [clojars.config :as config])
+ (:require [clojars.config :as config]
+ [clojars.db :refer [find-user group-membernames add-user
+ reserved-names update-user jars-by-username
+ find-groupnames find-user-by-user-or-email
+ rand-string]]
+ [clojars.web.common :refer [html-doc error-list jar-link
+ group-link]]
+ [clojure.string :refer [blank?]]
+ [hiccup.core :refer [h]]
+ [hiccup.page-helpers :refer [link-to unordered-list]]
+ [hiccup.form-helpers :refer [form-to label text-field
+ password-field text-area
+ submit-button]]
+ [ring.util.response :refer [redirect]])
(:import [org.apache.commons.mail SimpleEmail]))
(defn register-form [ & [errors email username ssh-key]]
View
10 test/clojars/test/integration/jars.clj
@@ -1,9 +1,9 @@
(ns clojars.test.integration.jars
- (:use clojure.test
- kerodon.core
- kerodon.test
- clojars.test.integration.steps)
- (:require [clojars.web :as web]
+ (:require [clojure.test :refer :all]
+ [kerodon.core :refer :all]
+ [kerodon.test :refer :all]
+ [clojars.test.integration.steps :refer :all]
+ [clojars.web :as web]
[clojars.test.test-helper :as help]))
(help/use-fixtures)
View
10 test/clojars/test/integration/responses.clj
@@ -1,9 +1,9 @@
(ns clojars.test.integration.responses
- (:use clojure.test
- kerodon.core
- kerodon.test
- clojars.test.integration.steps)
- (:require [clojars.web :as web]
+ (:require [clojure.test :refer :all]
+ [kerodon.core :refer :all]
+ [kerodon.test :refer :all]
+ [clojars.test.integration.steps :refer :all]
+ [clojars.web :as web]
[clojars.test.test-helper :as help]
[net.cgrand.enlive-html :as enlive]))
View
10 test/clojars/test/integration/sessions.clj
@@ -1,9 +1,9 @@
(ns clojars.test.integration.sessions
- (:use clojure.test
- kerodon.core
- kerodon.test
- clojars.test.integration.steps)
- (:require [clojars.web :as web]
+ (:require [clojure.test :refer :all]
+ [kerodon.core :refer :all]
+ [kerodon.test :refer :all]
+ [clojars.test.integration.steps :refer :all]
+ [clojars.web :as web]
[clojars.test.test-helper :as help]
[net.cgrand.enlive-html :as enlive]
[net.cgrand.xml :as x]))
View
4 test/clojars/test/integration/steps.clj
@@ -1,6 +1,6 @@
(ns clojars.test.integration.steps
- (:use kerodon.core)
- (:require [clojure.test :as test]
+ (:require [kerodon.core :refer :all]
+ [clojure.test :as test]
[clojure.java.io :as io]
[clojars.scp :as scp]
[clojars.config :as config]))
View
11 test/clojars/test/integration/users.clj
@@ -1,9 +1,9 @@
(ns clojars.test.integration.users
- (:use clojure.test
- kerodon.core
- kerodon.test
- clojars.test.integration.steps)
- (:require [clojars.web :as web]
+ (:require [clojure.test :refer :all]
+ [kerodon.core :refer :all]
+ [kerodon.test :refer :all]
+ [clojars.test.integration.steps :refer :all]
+ [clojars.web :as web]
[clojars.test.test-helper :as help]
[net.cgrand.enlive-html :as enlive]
[clojure.java.io :as io]
@@ -252,7 +252,6 @@
(is (= "Welcome to Clojars, fixture!\n\nDeploying fake/test 0.0.1\nError: You don't have access to the fake group.\n"
(scp ssh-key "test.jar" "test-0.0.1/test.pom")))))
-
(deftest member-can-add-user-to-group
(-> (session web/clojars-app)
(register-as "fixture" "fixture@example.org" "password" ""))
View
4 test/clojars/test/unit/config.clj
@@ -1,6 +1,6 @@
(ns clojars.test.unit.config
- (:use clojure.test)
- (:require [clojars.config :as config]))
+ (:require [clojars.config :as config]
+ [clojure.test :refer :all]))
(deftest parse-query
(is (= (config/parse-query "foo=bar&baz=12")
View
4 test/clojars/test/unit/db.clj
@@ -1,8 +1,8 @@
(ns clojars.test.unit.db
- (:use clojure.test)
(:require [clojars.db :as db]
[clojure.java.jdbc :as jdbc]
- [clojars.test.test-helper :as help]))
+ [clojars.test.test-helper :as help]
+ [clojure.test :refer :all]))
(help/use-fixtures)
View
4 test/clojars/test/unit/stats.clj
@@ -1,7 +1,7 @@
(ns clojars.test.unit.stats
- (:use clojure.test)
(:require [clojars.stats :as stats]
- [clj-time.core :as time]))
+ [clj-time.core :as time]
+ [clojure.test :refer :all]))
(deftest parse-path
(is (= {:name "haddock"
View
4 test/clojars/test/unit/web/common.clj
@@ -1,6 +1,6 @@
(ns clojars.test.unit.web.common
- (:use clojure.test)
- (:require [clojars.web.common :as common]))
+ (:require [clojars.web.common :as common]
+ [clojure.test :refer :all]))
;;TODO: more helper tests

0 comments on commit 710f41e

Please sign in to comment.