abhshkdz/graf — pull request #9 by pravj (2014-07-10 12:03:51+00:00)
Title: Feature: better git response handling

Hi :yoda: :)

This PR contains 2 commits :

:one: : https://github.com/pravj/graf/commit/9d62e059eda0ad217c444d11a63d6e76c13283be
this commit was not in my list when I thought about forking 'graf' repo but when I started, I saw that :gem:'s main file [lib/graf/source.rb] was having bad and different ruby syntax/code-style from other files in project.
so I changed the code to follow GitHub's ruby [code-style](https://github.com/styleguide/ruby).

what I have changed, is :
* changed code to have soft-tabs(2 spaces).
* lines are now fewer than 80 characters
* using string interpolation instead of string concatenation
* used empty lines between `methods` and to break up a method into logical paragraphs.

:two: : https://github.com/pravj/graf/commit/2c826264bbf0b42ed20cf05b79bd4ad5f115d1cf
this commit have the main logic of the PR Branch : `better handling git's response`

in the current graf version, it just ask git for logs and work on the result.
this thing leads to the situation, where it goes into halt state, when :
* the directory is not a git repository
* git repo don't have any commits to generate graf.

in both situations, we see `(reading log message from standard input)` on `STDOUT`

now I have added a file `filter.rb` in `lib/graf/`, that checks for both conditions and work accordingly.
So it returns :
* Not a git repository (or any of the parent directories) : if you are not using 'graf' in a Git repo.
* This git repository don\'t have any commits yet : if Git repo don't have any commits yet

it calls for `Graf::Source.authors`, when everything is all clear.

I hope, I have done it right :smile:. correct me, if I'm wrong anywhere.
Please review this.