#!/usr/bin/env ruby # -*- coding: utf-8 -*- require "capillary/log_parser" require "capillary/commit" require 'gitspotter' gitrepo_dotgit_path = "." #TODO use ARGV[0] if present and a directory # Steal logic from graphs_controller here... # TODO generate json based on git log in given repo dir data = `git --git-dir=./.git log --all --graph --pretty=format:"%H§%P§%ai§%ae§%d§%s§" --decorate=full -100 master` parser = Capillary::LogParser.new data.split("\n").each { |line| parser << line } git_json = parser.to_json html_visualization = git_json #puts html_visualization def html_body(git_json) < Gitspotter generated graph

This page requires JavaScript

HTML_BODY end puts html_body(git_json) # TODO: handle param so i can point it to any git repo # TODO: embed javascripts/styling/other assets: copy the files I need into js_assets folder in gem, concat them, embed in markup # TODO: rewrite to enable non-flickering/reloading refreshes of the graph