Skip to content

Instantly share code, notes, and snippets.

@segfault
Forked from anonymous/shit.rb
Created July 31, 2008 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save segfault/3476 to your computer and use it in GitHub Desktop.
Save segfault/3476 to your computer and use it in GitHub Desktop.
Shoes.setup do
gem "mime-types"
gem "open4"
source "http://gems.github.com/"
gem "mojombo-grit"
end
require 'mojombo-grit'
repo = Grit::Repo.new(Dir.pwd)
light, nextp, master = nil, nil, master
Shoes.app do
stack do
repo.commits('master', 90).each_with_index do |c, i|
master = !(nextp and nextp != c.id)
f = flow :width => -gutter, :height => 28 do
b = background(i.even? ? "#f1f0e0" : "#e1e5e0")
line 14, 0, 14, 400
stack(:width => 40, :margin => 2) do
fill(master ? green : red)
oval(master ? 7 : 22, 7, 10, 10)
end
stack(:width => -290, :margin => 2) { para c.message, :margin => 4 }
stack(:width => 70, :margin => 2) { para strong(c.author), :margin => 4 }
stack(:width => 180, :margin => 2) { para c.authored_date.strftime("%Y-%m-%d %H:%M:%S"), :margin => 4 }
hover do
light.remove if light
after(b) { light = background "#dfa" }
end
click do
if f.height == 28 and f.scroll_height > 38
f.height = f.scroll_height
else
f.height = 28
end
end
end
nextp = c.parents[0].id
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment