librelist archives

« back to archive

Accessing the profile from within the repl

Accessing the profile from within the repl

From:
Brian Marick
Date:
2013-01-28 @ 19:27
In the alpha Midje 1.5, everything you can do via `lein midje` can also be
done via the Midje repl tools. For example, you can run `autotest` in the 
repl, which has some real advantages for people who like repl-oriented 
development.

Now suppose that the `project.clj` uses profiles, and the :system-testing 
profile adds different paths onto the :test-paths. With `lein midje`, I 
can handle that, since the computed project gets passed into the `midje` 
task. But consider:

% lein with-profile system-testing repl
user=> (use 'midje.repl)
user=> (autotest)

As far as I can tell, there's no way for the Midje repl tools to get hold 
of what the user expects the :test-paths to be. Would it be reasonable to 
make the project map available in the repl somehow? Maybe a `leiningen` 
namespace that's populated with Leiningen data (and maybe useful leiningen
tools)?

More generally, is it reasonable to move in a direction where users would 
expect to be able to do interactively many of the things that they can do 
from the command line? (Especially for small, repetitive tasks like 
red-green-refactor.)

--------
Looking for 1/2-time employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo