Skip to content
Jean-Rémy Falleri edited this page Jul 2, 2015 · 2 revisions

In this page we will teach you how to use diggit to run an analysis that runs CLOC on a list of repositories.

To have this tutorial working, you need the cloc command in your path, a MongoDB server running with default settings on localhost, and the mongo gem (gem install mongo to retrieve it).

The first step is to install diggit. Make sure that the bin directory of gemfiles is in your path.

gem install diggit

Then you need to create and initialize a diggit folder.

mkdir diggit_cloc
cd diggit_cloc
dgit init

Now the diggit_cloc folder contains:

  • a .dgit folder where config files are located
  • an empty sources folder where repositories will be cloned
  • a plugins folder where you can put custom plugins

The next step is to add a repository to analyze. This is done via the command:

dgit analyses add cloc

You can check that the analysis has been correctly added by typing the command:

dgit status

Now, we have to set up the repositories to be analysed. We will use the diggit repository for this purpose. Type the command:

dgit sources add https://github.com/jrfaller/diggit.git

You can check the list of sources with the command:

dgit sources

We will now retrieve the repositories via the command

dgit clone

After the execution of this command, a https_github_com_jrfaller_diggit_git folder will be present in sources.

Finally we can perform the analysis using the command:

dgit analyses perform

That's all folks.

Clone this wiki locally