We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Fork of Caged/gitnub
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/dustin/gitnub.git
dustin (author)
Tue Apr 01 09:06:26 -0700 2008
commit  69357dd18bcb8e4ab7e8107766381de6e4617ae8
tree    7a8b70a47eadb53c4f092b0acf8ada17a359afd0
parent  f7e8c6cf6273967d8f7237c828e4c86e036949bc
gitnub / VisualizationView.rb
100644 52 lines (40 sloc) 1.058 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# VisualizationView.rb
# GitNub
#
# Created by Justin Palmer on 4/12/08.
# Copyright (c) 2008 Active Reload, LLC. All rights reserved.
#
 
require 'osx/cocoa'
 
class VisualizationView < OSX::NSView
  ib_outlet :application_controller
  
  def initWithFrame(frame)
    super_initWithFrame(frame)
    # Initialization code here.
    return self
  end
  
  def awakeFromNib
    @repo ||= @application_controller.repo
  end
  
  def isFlipped
    true
  end
  
  def drawRect(rect)
    points = []
    context = NSGraphicsContext.currentContext
    NSColor.darkGrayColor.set
    NSRectFill(self.bounds)
    
    path = NSBezierPath.bezierPath
    path.lineWidth = 2
    
    path.moveToPoint([100, 100])
    @repo.commits(:master, 50, 0).each_with_index do |commit, index|
      point = [((index + 1) * 25), 100]
      #path.lineToPoint([25 * index, 100])
      path.appendBezierPathWithOvalInRect(NSMakeRect(point[0] + 75, point[1], 10, 10))
    end
    
    NSColor.blackColor.set
    path.fill
    
    NSColor.whiteColor.set
    path.stroke
  end
 
end