Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Leiningen and autodoc added

  • Loading branch information...
commit 3b1eab349b233d1868d94146a58042fc962ef210 1 parent a23d94b
@hugoduncan authored
View
4 .gitignore
@@ -1,2 +1,4 @@
*.class
-clj-fluiddb.jar
+clj-fluiddb.jar
+autodoc
+lib
View
4 README.markdown
@@ -5,6 +5,6 @@ clj-fluiddb
clj-fluiddb is a client library for accessing [fluiddb](http://fluidinfo.com/fluiddb) from Clojure.
-The interface is similar to [cl-fluiddb](http://github.com/hdurer/cl-fluiddb).
+The [interface](http://hugoduncan.github.com/clj-fluiddb) is similar to [cl-fluiddb](http://github.com/hdurer/cl-fluiddb).
-Licensed under [EPL](http://www.eclipse.org/legal/epl-v10.html)
+Licensed under [EPL](http://www.eclipse.org/legal/epl-v10.html)
View
101 build.xml
@@ -1,101 +0,0 @@
-<project name="clj-fliuddb" default="jar" xmlns:mvn="urn:maven-artifact-ant">
-
- <description>
- Compile clj-fluiddb
- </description>
-
- <property name="src.dir" location="src"/>
- <property name="build.dir" location="classes"/>
- <property name="deps.dir" location="deps"/>
- <property name="tests.dir" location="test"/>
-
- <!-- The JAR file to create. -->
- <property name="jarfile" location="clj-fluiddb.jar"/>
-
- <path id="classpath">
- <path location="${build.dir}"/>
- <path location="${src.dir}"/>
- <fileset dir="${deps.dir}">
- <include name="*.jar"/>
- </fileset>
- </path>
-
- <target name="init">
- <tstamp/>
- <mkdir dir="${build.dir}"/>
- </target>
-
- <target name="clean" description="Remove generated files and directories.">
- <delete file="${jarfile}"/>
- <delete dir="${build.dir}"/>
- </target>
-
- <target name="test" description="Run tests">
- <java classname="clojure.main" fork="true">
- <classpath refid="classpath"/>
- <classpath>
- <path location="${tests.dir}"/>
- </classpath>
- <arg value="-e"/>
- <arg value="(require 'clojure.contrib.test-is 'clj-fluiddb.test.clj-fluiddb)(clojure.contrib.test-is/run-tests 'clj-fluiddb.test.clj-fluiddb)"/>
- <jvmarg value="-Djava.security.policy=config/jmx.policy"/>
- </java>
- </target>
-
- <target name="compile" depends="init"
- description="Compile Clojure sources.">
- <java classname="clojure.lang.Compile">
- <classpath refid="classpath"/>
- <sysproperty key="clojure.compile.path" value="${build.dir}"/>
- <sysproperty key="java.awt.headless" value="true"/>
- <arg value="clj-fluiddb"/>
- </java>
- </target>
-
- <target name="jar" description="Create jar files." depends="compile">
- <jar jarfile="${jarfile}">
- <fileset dir="${src.dir}" includes="**/*.clj"/>
- <fileset dir="${build.dir}" includes="**/*.class"/>
- <manifest>
- <attribute name="Class-Path" value="."/>
- </manifest>
- </jar>
- </target>
-
- <target name="clean-build" depends="clean,compile,test,jar"
- description="Builds clj-fluiddb from scratch and runs all tests."/>
-
- <target name="-setup-maven" description="Load Maven typedefs, read POM, establish dependencies.">
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"/>
- <mvn:pom file="pom.xml" id="contrib.pom"/>
- <mvn:dependencies pomRefId="contrib.pom"/>
- </target>
-
- <target name="ci-build" depends="-setup-maven"
- description="Build clj-fluiddb using Clojure obtained via Maven.">
- <antcall target="clean-build">
- <param name="clojure.jar" value="${org.clojure:clojure-lang:jar}"/>
- <param name="clojure-contrib.jar" value="${org.clojure:clojure-contrib:jar}"/>
- </antcall>
- <mvn:install file="${jarfile}" pomrefid="contrib.pom">
- </mvn:install>
- </target>
-
- <macrodef name="deploy">
- <attribute name="target-dir" description="Root of Maven repository"/>
- <sequential>
- <mvn:deploy file="${jarfile}" pomrefid="contrib.pom">
- <remoteRepository url="file:@{target-dir}"/>
- </mvn:deploy>
- </sequential>
- </macrodef>
-
- <target name="nightly-build" depends="ci-build"
- description="Build and deploy to nightly (snapshot) repository.">
- <deploy target-dir="${snapshot.repo.dir}"/>
- </target>
-
- <target name="stable-build" depends="ci-build" description="Build and deploy to stable repository.">
- <deploy target-dir="${stable.repo.dir}"/>
- </target>
-</project>
View
BIN  deps/clojure-contrib.jar
Binary file not shown
View
BIN  deps/clojure.jar
Binary file not shown
View
13 project.clj
@@ -0,0 +1,13 @@
+(defproject clj-fluiddb "0.0.1-SNAPSHOT"
+ :description "FluidDb Client Library"
+ :url "http://github.com/hugoduncan/clj-fluiddb"
+ :dependencies [[org.clojure/clojure "1.1.0"]
+ [org.clojure/clojure-contrib "1.1.0"]]
+ :dev-dependencies [[leiningen/lein-swank "1.0.0-SNAPSHOT"]
+ [autodoc "0.7.0"]]
+ :repositories { "build.clojure.org" "http://build.clojure.org/releases/" }
+ :autodoc {:name "clj-fluiddb"
+ :description "A FluidDb client library."
+ :copyright "Copyright Hugo Duncan 2010. All rights reserved."
+ :web-src-dir "http://github.com/hugoduncan/clj-fluiddb/blob/"
+ :web-home "http://hugoduncan.github.com/clj-fluiddb/" })
View
27 src/clj_fluiddb.clj
@@ -1,4 +1,19 @@
-(ns clj-fluiddb
+;;;; Copyright (c) Hugo Duncan. All rights reserved.
+
+;;;; The use and distribution terms for this software are covered by the
+;;;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;;;; which can be found in the file epl-v10.html at the root of this distribution.
+;;;; By using this software in any fashion, you are agreeing to be bound by
+;;;; the terms of this license.
+;;;; You must not remove this notice, or any other, from this software.
+
+
+(ns #^{:author "Hugo Duncan"
+ :doc "clj-fluiddb is a client library for accessing FluidDb from Clojure."
+ :see-also [["http://github.com/hugoduncan/clj-fluiddb" "Source code"]
+ ["http://fluidinfo.com/fluiddb" "FluidDb"]
+ ["http://github.com/hdurer/cl-fluiddb" "cl-fluiddb"]]}
+ clj-fluiddb
(:use [clojure.contrib.http.connection :as connection]
[clojure.contrib.duck-streams :as duck]
[clojure.contrib.fcase :as fcase])
@@ -10,13 +25,17 @@
UnknownHostException)
(java.io.PushbackReader)))
-(def *host* "sandbox.fluidinfo.com")
+(def #^{:doc "Host to use for accessing FluidDB."}
+ *host* "sandbox.fluidinfo.com")
(def *sandbox-host* "sandbox.fluidinfo.com")
-(def *user-agent* "CLJ-FLUIDDB")
+(def #^{:doc "User Agent to use in HTTP requests."}
+ *user-agent* "CLJ-FLUIDDB")
(def *content-type* "application/json")
(def *fdb* {:fdb nil})
-(defn- credentials [user password]
+(defn- credentials
+ "Encode username and password to use with Basic HTTP authentication."
+ [user password]
(str "Basic " (clojure.contrib.base64/encode-str (str user ":" password))))
(defn- to-string [arg]
Please sign in to comment.
Something went wrong with that request. Please try again.