picostitch
crafting (and) JavaScript

Run delta-flora

I was fighting a little bit with getting Michael Feather's delta-flora to run, but made it finally. My starter level of ruby knowledge made it not much simpler to get it to run :). But in the end I succeeded doing the following steps.

  1. git clone git@github.com:michaelfeathers/delta-flora.git

  2. cd delta-flora

  3. gem install awesome-print It was hard-core trying and reading (and trying to understand) error messages that made me understand this :)

  4. cd lib

  5. open the ruby REPL by typing irb

  6. > load './repository.rb'

  7. e = load_events("/Users/.../the/repo/path") which will scan a repo and probably print out a lot like this

    Calculating commit 1 of 3918
    Calculating commit 2 of 3918
    Calculating commit 3 of 3918
    Calculating commit 4 of 3918
    Calculating commit 5 of 3918
    Calculating commit 6 of 3918
    Calculating commit 7 of 3918
    ...

    the last number is the total number of commits in that repo.

  8. and then you can run various methods like > method_churns e provided in the analytics.rb to get some stats on the repo.

It might be worth digging a bit into code_event.rb to see some more capabilities of the analytics data.

If you reached this point and still have no clue what all this is about watch his talk The Hidden Dimension Of Refactoring at craft conf 2015.