File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
1
(defproject clojail " 0.5.0"
2
2
:description " A sandboxing library."
3
- :dependencies [[clojure " 1.3.0" ]])
3
+ :dependencies [[clojure " 1.3.0" ]]
4
+ :dev-dependencies [[lein-multi " 1.1.0-SNAPSHOT" ]]
5
+ :multi-deps {" 1.2.1" [[clojure " 1.2.1" ]]})
Original file line number Diff line number Diff line change 22
22
val )
23
23
24
24
; ; It sucks to have to deal with TimeUnits. They're so damned long.
25
- (def uglify-time-unit " Create a map of pretty keywords to ugly TimeUnits"
25
+ (def ^{:doc " Create a map of pretty keywords to ugly TimeUnits" }
26
+ uglify-time-unit
26
27
(into {} (for [[enum aliases] {TimeUnit/NANOSECONDS [:ns :nanoseconds ]
27
28
TimeUnit/MICROSECONDS [:us :microseconds ]
28
29
TimeUnit/MILLISECONDS [:ms :milliseconds ]
68
69
(try (if-let [resolved (ns-resolve nspace s)]
69
70
resolved
70
71
s)
71
- (catch RuntimeException _ s)))
72
+ ; ; Catching both of these exceptions appears to be necessary, because the exception that
73
+ ; ; is thrown appears to be different depending on which version of Clojure you use.
74
+ (catch RuntimeException _ s)
75
+ (catch ClassNotFoundException _ s)))
72
76
73
77
(defn flatten-all
74
78
" The core flatten doesn't flatten maps."
121
125
(recurse form)))))))
122
126
123
127
; ; Compose our earlier functions.
124
- (def ^{:private true } ensafen " Fix code to make interop safe."
128
+ (def ^{:private true
129
+ :doc " Fix code to make interop safe." }
130
+ ensafen
125
131
(comp dotify macroexpand-most))
126
132
127
133
(defn- mutilate
Original file line number Diff line number Diff line change 7
7
" Create a package object for putting in a tester."
8
8
[s] (Package/getPackage s))
9
9
10
- (def secure-tester-without-def " A tester that attempts to be secure, and allows def."
10
+ (def ^{:doc " A tester that attempts to be secure, and allows def." }
11
+ secure-tester-without-def
11
12
#{'alter-var-root 'intern 'eval 'catch clojure.lang.Compiler
12
13
'load-string 'load-reader 'addMethod 'ns-resolve 'resolve 'find-var
13
14
'*read-eval* clojure.lang.Ref clojure.lang.Reflector 'ns-publics
20
21
(p " java.util.concurrent" )
21
22
(p " java.awt" )})
22
23
23
- (def secure-tester " A somewhat secure tester. No promises."
24
+ (def ^{:doc " A somewhat secure tester. No promises." }
25
+ secure-tester
24
26
(conj secure-tester-without-def 'def))
You can’t perform that action at this time.
0 commit comments