Permalink
Browse files

Added more contrib projects to 1.3/complete version, getting there.

Fixed a bug in clj script which was messing up jline processing.
Add support (I think) for rlwrap, still need to test this.
Cleaned up the tests so that at least we can test with the 1.2.1/complete version.

Still need to update the windows C program to mirror the behavior of the
*nix script, come up with a way to test the other versions of the code.
  • Loading branch information...
1 parent 7b47c5f commit 122854ed505a5337daafad0c93f2be84574b325c Russ Olsen committed Oct 1, 2011
Showing with 50 additions and 14 deletions.
  1. +23 −3 bin/clj
  2. +19 −1 ivy.xml
  3. +8 −10 test/dejour-tests.clj
View
26 bin/clj
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
# -----------------------------------------------------------------------------
# clj - Start Script for the Clojure interperter
# Shamelessly stolen from the Jruby startup script,
@@ -7,6 +7,7 @@
# Options:
# -debug Just print out the java cmd and exit.
# -no-jline Don't use jline
+# -rlwrap Turns off jline and tries to use rlwrap
# -cp <jar or directory> Add the next argument to the classpath
# -classpath <jar or directory> Add the next argument to the classpath
# -Dname=value Define the given Java system property, passed directly to java.
@@ -23,6 +24,14 @@
# clj my_clojure_file.clj -first_arg -second_arg
#
# Will run clojure_file.clj and pass the two args to it.
+#
+# Environment variables:
+#
+# JAVA_HOME - specifies where Java lives, but not required: If JAVA_HOME
+# is not set, clj will assume that the java command is on the PATH
+#
+# CLJ_USE_RLWRAP - has the same effect as the -rlwrap flag: Turns jline off
+# and tries to use rlwrap
#
# -----------------------------------------------------------------------------
@@ -115,8 +124,14 @@ DEBUG_CMD=""
CLOJURE_ARGS=""
declare -a JAVA_ARGS
+if [ -z "$CLJ_USE_RLWRAP" ]; then
+ RLWRAP_CMD=""
+ USE_JLINE=true
+else
+ RLWRAP_CMD=rlwrap
+ USE_JLINE=false
+fi
-USE_JLINE=true
CLOJURE_MAIN_CLASS=clojure.main
CLOJURE_JLINE_CLASS=jline.ConsoleRunner
@@ -166,6 +181,11 @@ do
USE_JLINE=false
;;
+ -rlwrap)
+ USE_JLINE=false
+ RLWRAP_CMD=rlwrap
+ ;;
+
-repl-class)
arg_check "$1" $#
shift
@@ -219,7 +239,7 @@ if $cygwin; then
CLOJURE_CP=`cygpath -wp $CLOJURE_CP`
fi
-$DEBUG_CMD $JAVA_CMD -DCLOJURE_HOME="$CLOJURE_HOME" \
+$DEBUG_CMD $RLWRAP_CMD $JAVA_CMD -DCLOJURE_HOME="$CLOJURE_HOME" \
-classpath "$CLOJURE_CP" "${JAVA_ARGS[@]}" $CLOJURE_JLINE_CLASS $CLOJURE_MAIN_CLASS "$@"
View
20 ivy.xml
@@ -34,10 +34,28 @@
<dependency org="org.clojure" name="clojure" rev="1.3.0"
conf="minimal-1.3.0c->default"/>
+ <dependency org="org.clojure" name="tools.nrepl" rev="0.0.5"
+ conf="complete-1.3.0c->default"/>
+
+ <dependency org="org.clojure" name="algo.monads" rev="0.1.0"
+ conf="complete-1.3.0c->default"/>
+
+ <dependency org="org.clojure" name="core.incubator" rev="0.1.0"
+ conf="complete-1.3.0c->default"/>
+
+ <dependency org="org.clojure" name="core.logic" rev="0.6.3"
+ conf="complete-1.3.0c->default"/>
+
+ <dependency org="org.clojure" name="data.finger-tree" rev="0.0.1"
+ conf="complete-1.3.0c->default"/>
+
+ <dependency org="org.clojure" name="data.json" rev="0.1.1"
+ conf="complete-1.3.0c->default"/>
+
<dependency org="org.clojure" name="java.classpath" rev="0.1.0"
conf="complete-1.3.0c->default"/>
- <dependency org="org.clojure" name="tools.nrepl" rev="0.0.5"
+ <dependency org="org.clojure" name="java.jdbc" rev="0.0.6"
conf="complete-1.3.0c->default"/>
</dependencies>
View
18 test/dejour-tests.clj
@@ -17,14 +17,16 @@
(rest cmd))))
(defn output-matches? [cmd re msg]
- (is
- (re-seq re (run cmd))
- msg))
+ (let [ output (run cmd) ]
+ (is
+ (re-seq re output)
+ msg)))
(defn output-doesnt-match? [cmd re msg]
- (is
- (not (re-seq re (run cmd)))
- msg))
+ (let [ output (run cmd) ]
+ (is
+ (not (re-seq re output))
+ msg)))
; core jar files and main classes
@@ -49,10 +51,6 @@
(output-doesnt-match? ["clj" "-debug" "-no-jline"] #"jline.jar" "no jline, no jar")
(output-doesnt-match? ["clj" "-debug" "-no-jline"] #"jline.ConsoleRunner" "no jline no class")
-; no contrib
-
-(output-doesnt-match? ["clj" "-debug" "-no-contrib"] #"clojure-contrib.jar" "no contrib")
-
; -classpath and -cp
(output-matches? ["clj" "-debug" "-cp" "extra" ] #"extra" "-cp")

0 comments on commit 122854e

Please sign in to comment.