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/drodriguez/gitnub.git
Search Repo:
Revert changes introduced by the last merge.  Note to self: don't blindly 
apply patches in a hurry
Caged (author)
Mon Apr 14 14:45:48 -0700 2008
commit  f7e8c6cf6273967d8f7237c828e4c86e036949bc
tree    8519e5524744ac3d1eddc25d49c1463f19e9367b
parent  31d87daed47be3336a133aea4a52b0fd3ed2bfc4
...
5
6
7
8
 
9
10
11
12
 
13
14
15
16
17
 
18
19
20
...
29
30
31
32
33
34
35
36
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
140
141
142
143
144
145
146
147
148
149
150
 
151
152
153
154
155
...
170
171
172
173
 
174
175
176
177
178
179
180
 
181
182
183
184
185
 
186
187
188
189
...
190
191
192
193
 
194
195
196
197
198
 
199
200
201
...
209
210
211
212
 
213
214
215
...
221
222
223
224
225
 
 
226
227
228
...
5
6
7
 
8
9
10
11
 
12
13
14
15
16
 
17
18
19
20
...
29
30
31
 
 
32
33
34
...
122
123
124
 
 
 
 
 
 
 
125
126
127
128
...
131
132
133
 
 
 
 
134
135
136
 
137
138
139
140
141
142
...
157
158
159
 
160
161
162
163
164
165
166
 
167
168
169
170
171
 
172
173
174
175
176
...
177
178
179
 
180
181
182
183
184
 
185
186
187
188
...
196
197
198
 
199
200
201
202
...
208
209
210
 
 
211
212
213
214
215
0
@@ -5,16 +5,16 @@
0
 # Created by Justin Palmer on 3/2/08.
0
 # Copyright (c) 2008 Active Reload, LLC. All rights reserved.
0
 #
0
-
0
+
0
 require 'osx/cocoa'
0
 require 'md5'
0
 require 'cgi'
0
-
0
+
0
 def gravatar_url(email, size=36)
0
   hash = MD5.hexdigest(email.downcase)
0
   NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{hash}&size=#{size}")
0
 end
0
-
0
+
0
 class CommitsController < OSX::NSObject
0
   ib_outlet :commits_table
0
   ib_outlet :branch_select
0
@@ -29,8 +29,6 @@
0
     @branch = :master
0
     @icon_queue = NSOperationQueue.alloc.init
0
     @icon_url_map = {}
0
- @standard_url = gravatar_url('standardimage')
0
- @icon_queue.addOperation(ImageLoadOperation.alloc.initWithURL_delegate(@standard_url, self))
0
     @icons = Hash.new do |hash, email|
0
       url = gravatar_url(email)
0
       @icon_url_map[url] = email
0
@@ -124,13 +122,6 @@
0
   end
0
   
0
   def imageLoadForURL_didFinishLoading(url, image)
0
-
0
- if url.absoluteString.isEqualToString(@standard_url.absoluteString)
0
- @standardimage = image
0
- return
0
- end
0
-
0
- return if checkImage(image)
0
     email = @icon_url_map[url]
0
     @icons[email] = image
0
     @commits_table.rowsInRect(@commits_table.enclosingScrollView.documentVisibleRect).to_range.each do |i|
0
0
@@ -140,14 +131,10 @@
0
     end
0
   end
0
   
0
- def checkImage(image)
0
- image.TIFFRepresentation.isEqualToData(@standardimage)
0
- end
0
-
0
   def imageLoadForURL_didFailWithError(url, error)
0
     STDERR.puts "Async image load failed for URL: #{url}\n#{error}"
0
   end
0
-
0
+
0
   def select_latest_commit
0
     indices = @commits_table.selectedRowIndexes
0
     if indices.isEqualToIndexSet(NSIndexSet.indexSetWithIndex(0))
0
0
0
@@ -170,19 +157,19 @@
0
       hide_element("message")
0
     end
0
     set_html("hash", active_commit.id)
0
-
0
+
0
     if Time.now.day == active_commit.authored_date.day
0
       cdate = active_commit.authored_date.to_system_time(:time)
0
     else
0
       cdate = active_commit.authored_date.to_system_time
0
     end
0
     set_html("date", "#{cdate} by #{active_commit.author.name}")
0
-
0
+
0
     file_list = doc.getElementById('files')
0
     diff_list = doc.getElementById('diffs')
0
     diff_list.setInnerHTML("")
0
     file_list.setInnerHTML("")
0
-
0
+
0
     active_commit.diffs.each_with_index do |diff, i|
0
       li = doc.createElement('li')
0
       li.setAttribute__('id', "item-#{i}")
0
0
@@ -190,12 +177,12 @@
0
       li.setAttribute__('class', 'delete') if diff.deleted_file
0
       li.setInnerHTML(%(<a href="#diff-#{i}" class="">#{diff.b_path}</a>))
0
       file_list.appendChild(li)
0
-
0
+
0
       unless diff.deleted_file or diff.diff.nil?
0
         diff_div = doc.createElement('div')
0
         diff_div.setAttribute__('class', 'diff')
0
         diff_div.setAttribute__('id', "diff-#{i}")
0
-
0
+
0
         colored_diff = []
0
         html = CGI.escapeHTML(diff.diff)
0
         html.each_line do |line|
0
@@ -209,7 +196,7 @@
0
             colored_diff << line
0
           end
0
         end
0
-
0
+
0
         diff_div.setInnerHTML(%(
0
           <h3>#{File.basename(diff.b_path)}</h3>
0
           <pre><code class="diffcode">#{colored_diff}</pre></code>
0
@@ -221,8 +208,8 @@
0
   
0
   def refresh
0
     current_commit = active_commit && active_commit.id
0
- @branch = @branch_select.titleOfSelectedItem
0
- fetch_commits_for @branch, @offset
0
+ @branch = @branch_select.titleOfSelectedItem
0
+ fetch_commits_for @branch, @offset
0
     
0
     @commits_table.reloadData
0
     

Comments

    No one has commented yet.