Rakefilefor common build tasks, and a
Guardfilewhich you can use with Ruby’s
guardto run your tests automatically while editing. It even sends notifications to your OS’ notification system. It has worked out really well and runs single-module test suites fast enough that I don’t find myself getting slowed down waiting on test builds too often.
cd my-project-dir/ wget -qO- https://gist.github.com/MichaelXavier/5847963/download | tar xz --strip 1 bundle # gem install bundler if you don't have it rake --tasks # list build tasks guard start # monitor code and run tests
- You have your project split into
- You’re using hspec and follow the hspec-discover pattern of having a file
test/Spec.hsand that your
testdir mirrors your
srcfiles, but with
Spec.hsat the end. For example:
src/Foo/Bar.hstest file will be
- You have a recent ruby installed and bundler.
- You’re using either the newest
cabalwith sandboxing or
cabal-dev, preferring the former.
rake sandboxfor example will try to set up a native sandbox with cabal.
- Your system supports
nprocto determine how many cores to build on. Works on linux. Take it out if that’s not cool with you.
rakewill build your package. The
buildtask installs dependencies to your sandbox. Likewise, the
testtask installs test dependencies.