29
30
31
32
33
34
35
36
|
# File 'lib/git_explorer.rb', line 29
def explore(root_dir="./")
run("find #{root_dir} -type d -name .git", config={:capture=>true, :verbose=>false})
.split("\n")
.map{|file| file >> GitExplorer::}
.map{|dir| run("basename `git -C #{dir} rev-parse --show-toplevel`; git -C #{dir} status", config={:capture=>true, :verbose=>false})}
.map{|status| status >> GitExplorer::}
.map{|status| say(message="#{status.project_name} is #{status.status} on branch #{status.branch}\n#{status.files.map{|f| "\t#{f}\n"}.join}", color=(:red if status.status.equal?(:not_staged)))}
end
|