avescodes / lein-try

A Leiningen plugin for trying out new libraries
314 stars 13 forks source link

Using 'RELEASE' if no version is given #8

Closed xsc closed 11 years ago

xsc commented 11 years ago

As discussed in #7, this pull request should enable lein-try to handle calls without explicit version numbers, e.g.:

lein try panoptic

The mechanism relies on the new function version-string? which determines if a given String represents a version number by checking against "RELEASE", "LATEST" and whether it starts with a number or not. Since artifact IDs may not start with a number (Clojure symbols mustn't, at least), I think this will suffice. (Maybe the lowercase Strings "release" and "latest" should be included?)

Example:

$ lein try panoptic
Retrieving panoptic/panoptic/0.2.1/panoptic-0.2.1.pom from clojars
Retrieving panoptic/panoptic/0.2.1/panoptic-0.2.1.jar from clojars
nREPL server started on port 34336
REPL-y 0.2.0
Clojure 1.5.1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)

user=>
avescodes commented 11 years ago

Awesome! I'm going to bump the minor version and do a release of this today. (Docs will also need an update, I think this is a huge improvement!)