Skip to content

Commit 7ba3512

Browse files
committed
Merge branch 'release/0.3.0'
2 parents 78d29e9 + 758e6e1 commit 7ba3512

File tree

9 files changed

+616
-152
lines changed

9 files changed

+616
-152
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Note that any sftp commands that change the state of the sftp session (such as
5252
cd) do not work with the simplified interface, as a new session is created each
5353
time.
5454

55+
## Documentation
56+
57+
[Annotated source](http:/hugoduncan.github.com/clj-ssh/uberdoc.html).
58+
5559
## FAQ
5660

5761
Q: Why doesn't clj-ssh integrate with the OS's ssh agent?
@@ -64,9 +68,13 @@ A: Probably a disk full, or permission error.
6468

6569
## Installation
6670

67-
Via maven and the [clojars](http://clojars.org), or
71+
Via [clojars](http://clojars.org) and
6872
[Leiningen](http://github.com/technomancy/leiningen).
6973

74+
:dependencies [clj-ssh "0.3.0"]
75+
76+
or your favourite maven repository aware tool.
77+
7078
## License
7179

7280
Licensed under [EPL](http://www.eclipse.org/legal/epl-v10.html)

ReleaseNotes.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Release Notes
2+
3+
Current release is 0.3.0
4+
5+
## 0.3.0
6+
7+
* Changes
8+
9+
- Remove use of monolithic contrib
10+
In preparation for clojure 1.3. Use slingshot instead of
11+
contrib.condition. Use local copy of contrib.reflect.
12+
13+
- Switch to tools.logging
14+
15+
- Allow specification of PipedInputStream buffer size
16+
The buffer size (in bytes) for the piped stream used to implement the
17+
:stream option for :out. If the ssh commands generate a high volume of
18+
output, then this buffer size can become a bottleneck. The buffer size
19+
can be specified by binding *piped-stream-buffer-size*, and defaults to
20+
10Kb.
21+
22+
- Add scp-from and scp-to, for copy files over ssh-exec
23+
Add support for scp using ssh-exec. copies files from a remote machine.
24+
copies to a remote machine.
25+
26+
- Drop clojure 1.1.0 support

pom.xml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>clj-ssh</groupId>
55
<artifactId>clj-ssh</artifactId>
6-
<version>0.2.4-SNAPSHOT</version>
6+
<version>0.3.0</version>
77
<name>clj-ssh</name>
8-
<description>ssh from clojure</description>
8+
<description>
9+
clj-ssh is a clojure wrapper for he jsch library, and can be used as an
10+
ssh client
11+
</description>
12+
913
<scm>
1014
<connection>scm:git:git://github.com/hugoduncan/clj-ssh.git</connection>
1115
<developerConnection>scm:git:ssh://[email protected]/hugoduncan/clj-ssh.git</developerConnection>
1216
<tag>380240ba9bf67fffe69bebdc9aaef711e819063d</tag>
1317
<url>http://github.com/hugoduncan/clj-ssh</url>
1418
</scm>
19+
1520
<build>
1621
<sourceDirectory>src</sourceDirectory>
1722
<testSourceDirectory>test</testSourceDirectory>
@@ -33,7 +38,7 @@
3338
<testSourceDirectory>test</testSourceDirectory>
3439
</testSourceDirectories>
3540
<clojureOptions>-Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=256m</clojureOptions>
36-
<warnOnReflection>true</warnOnReflection>
41+
<warnOnReflection>false</warnOnReflection>
3742
<compileDeclaredNamespaceOnly>true</compileDeclaredNamespaceOnly>
3843
<temporaryOutputDirectory>true</temporaryOutputDirectory>
3944
</configuration>
@@ -72,59 +77,52 @@
7277
</plugin>
7378
</plugins>
7479
</build>
80+
7581
<repositories>
76-
<repository>
77-
<id>clojure</id>
78-
<url>http://build.clojure.org/releases</url>
79-
</repository>
80-
<repository>
81-
<id>clojure-snapshots</id>
82-
<url>http://build.clojure.org/snapshots</url>
83-
</repository>
8482
<repository>
8583
<id>clojars</id>
8684
<url>http://clojars.org/repo/</url>
8785
</repository>
8886
</repositories>
87+
8988
<dependencies>
9089
<dependency>
9190
<groupId>org.clojure</groupId>
9291
<artifactId>clojure</artifactId>
93-
<version>1.1.0</version>
92+
<version>${clojure.version}</version>
93+
</dependency>
94+
<dependency>
95+
<groupId>slingshot</groupId>
96+
<artifactId>slingshot</artifactId>
97+
<version>0.2.0</version>
9498
</dependency>
9599
<dependency>
96100
<groupId>org.clojure</groupId>
97-
<artifactId>clojure-contrib</artifactId>
98-
<version>1.1.0</version>
101+
<artifactId>tools.logging</artifactId>
102+
<version>0.1.2</version>
99103
</dependency>
100104
<dependency>
101105
<groupId>com.jcraft</groupId>
102106
<artifactId>jsch</artifactId>
103107
<version>0.1.44-1</version>
104108
</dependency>
109+
<dependency>
110+
<groupId>log4j</groupId>
111+
<artifactId>log4j</artifactId>
112+
<version>1.2.14</version>
113+
<optional>true</optional>
114+
<scope>test</scope>
115+
</dependency>
105116
<dependency>
106117
<groupId>swank-clojure</groupId>
107118
<artifactId>swank-clojure</artifactId>
108-
<version>1.2.1</version>
119+
<version>1.3.1</version>
109120
<optional>true</optional>
121+
<scope>test</scope>
110122
</dependency>
111123
</dependencies>
124+
112125
<profiles>
113-
<profile>
114-
<id>clojure-1.2</id>
115-
<dependencies>
116-
<dependency>
117-
<groupId>org.clojure</groupId>
118-
<artifactId>clojure</artifactId>
119-
<version>1.2.0</version>
120-
</dependency>
121-
<dependency>
122-
<groupId>org.clojure</groupId>
123-
<artifactId>clojure-contrib</artifactId>
124-
<version>1.2.0</version>
125-
</dependency>
126-
</dependencies>
127-
</profile>
128126
<profile>
129127
<id>testuser</id>
130128
<build>
@@ -140,8 +138,16 @@
140138
</plugins>
141139
</build>
142140
</profile>
141+
<profile>
142+
<id>clojure-1.3</id>
143+
<properties>
144+
<clojure.version>1.3.0-beta1</clojure.version>
145+
</properties>
146+
</profile>
143147
</profiles>
148+
144149
<properties>
145150
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
151+
<clojure.version>1.2.0</clojure.version>
146152
</properties>
147153
</project>

project.clj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
(defproject clj-ssh "0.2.0"
1+
(defproject clj-ssh "0.3.0"
22
:description "ssh from clojure"
3-
:dependencies [[org.clojure/clojure "1.1.0"]
4-
[org.clojure/clojure-contrib "1.1.0"]
5-
[com.jcraft/jsch "0.1.42"]]
3+
:dependencies [[org.clojure/clojure "1.2.0"]
4+
[org.clojure/tools.logging "0.1.2"]
5+
[slingshot "0.2.0"]
6+
[com.jcraft/jsch "0.1.44-1"]]
67
:dev-dependencies [[swank-clojure "1.2.1"]
78
[autodoc "0.7.1"]
89
[log4j/log4j "1.2.14"]]
910
:autodoc {:name "clj-ssh"
1011
:description "Library for using SSH from clojure."
11-
:copyright "Copyright Hugo Duncan 2010. All rights reserved."
12+
:copyright "Copyright Hugo Duncan 2010, 2011. All rights reserved."
1213
:web-src-dir "http://github.com/hugoduncan/clj-ssh/blob/"
1314
:web-home "http://hugoduncan.github.com/clj-ssh/" })

src/clj_ssh/keychain.clj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
(ns clj-ssh.keychain
2-
"Primitive keychain support for clj-ssh. Only implemented on OSX at the moment."
2+
"Primitive keychain support for clj-ssh. Only implemented on OSX at the
3+
moment."
34
(:require
4-
[clojure.contrib.logging :as logging]))
5-
6-
;; working towards clojure 1.1/1.2 compat
7-
(try
8-
(require '[clojure.contrib.shell :as shell])
9-
(catch Exception e
10-
(require '[clojure.contrib.shell-out :as shell])))
5+
[clojure.tools.logging :as logging]
6+
[clojure.java.shell :as shell]))
117

128
(defn ask-passphrase [path]
139
(when-let [console (. System console)]
1410
(print "Passphrase for" path ": ")
1511
(.readPassword console)))
1612

17-
(defmulti keychain-passphrase "Obtain password for path" (fn [system path] system))
13+
(defmulti keychain-passphrase "Obtain password for path"
14+
(fn [system path] system))
1815

1916
(defmethod keychain-passphrase :default
2017
[system path]
@@ -24,7 +21,6 @@
2421
(defmethod keychain-passphrase "Mac OS X"
2522
[system path]
2623
(let [result (shell/sh
27-
:return-map true
2824
"/usr/bin/security" "find-generic-password" "-a"
2925
(format "%s" path)
3026
"-g")]
@@ -35,4 +31,3 @@
3531
"Obtain a passphrase for the given key path"
3632
[path]
3733
(keychain-passphrase (System/getProperty "os.name") path))
38-

src/clj_ssh/reflect.clj

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
;;;; taken from clojure.contrib.reflect 1.2.0
2+
3+
;;; Copyright (c) 2010 Stuart Halloway & Contributors. All rights
4+
;;; reserved. The use and distribution terms for this software are
5+
;;; covered by the Eclipse Public License 1.0
6+
;;; (http://opensource.org/licenses/eclipse-1.0.php) which can be
7+
;;; found in the file epl-v10.html at the root of this distribution.
8+
;;; By using this software in any fashion, you are agreeing to be
9+
;;; bound by the terms of this license. You must not remove this
10+
;;; notice, or any other, from this software.
11+
12+
(ns clj-ssh.reflect)
13+
14+
(defn call-method
15+
"Calls a private or protected method.
16+
17+
params is a vector of classes which correspond to the arguments to
18+
the method e
19+
20+
obj is nil for static methods, the instance object otherwise.
21+
22+
The method-name is given a symbol or a keyword (something Named)."
23+
[klass method-name params obj & args]
24+
(-> klass (.getDeclaredMethod (name method-name)
25+
(into-array Class params))
26+
(doto (.setAccessible true))
27+
(.invoke obj (into-array Object args))))
28+
29+
(defn get-field
30+
"Access to private or protected field. field-name is a symbol or
31+
keyword."
32+
[klass field-name obj]
33+
(-> klass (.getDeclaredField (name field-name))
34+
(doto (.setAccessible true))
35+
(.get obj)))

0 commit comments

Comments
 (0)