Skip to content

Commit

Permalink
Merge commit 'oldkens/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrestivo committed May 7, 2012
2 parents fdeb559 + f43ee08 commit 94fc41f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/noir/validation.clj
Expand Up @@ -39,6 +39,22 @@
[v]
(re-matches #"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" v))


(defn valid-file?
"Returns true if a valid file was supplied"
[m]
(and (> (:size m) 0)
(:filename m)))


(defn greater-than-zero?
"Returns true if the string represents a positive number."
[v]
(and (not (empty? v))
(> (Long/parseLong v) 0)))



(declare ^:dynamic *errors*)

;;errors and rules
Expand Down

0 comments on commit 94fc41f

Please sign in to comment.