public this repo is viewable by everyone
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/dysinger/gitnub.git
Merge branch 'master' of git://github.com/Caged/gitnub

* 'master' of git://github.com/Caged/gitnub:
  Don't replace the person image with the standard gravatar image if no 
  gravatar is found
  Properly set the image load operation as complete when it downloads the 
  image
dysinger (author)
6 days ago
commit  f919b28a64eab546d281f18d885bf6e799ff0cd4
tree    85f6d738d73e2d99696fca7b2f3dc055d21c459b
parent  7c065351cc7b93f4db4697254926d8b3f369a27c parent  e11c191e7c2694acba0bf585599f61def57a5639
...
10
11
12
13
 
14
15
 
 
16
17
18
...
10
11
12
 
13
14
 
15
16
17
18
19
0
@@ -10,9 +10,10 @@ require 'osx/cocoa'
0
 require 'md5'
0
 require 'cgi'
0
  
0
-def gravatar_url(email, size=36)
0
+def gravatar_url(email, size=36, default="x-img://default")
0
   hash = MD5.hexdigest(email.downcase)
0
- NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{hash}&size=#{size}")
0
+ edefault = default.gsub(/[^a-zA-Z0-9_-]/) { |s| "%%%02X" % s[0]}
0
+ NSURL.URLWithString("http://www.gravatar.com/avatar.php?gravatar_id=#{hash}&s=#{size}&d=#{edefault}")
0
 end
0
  
0
 class CommitsController < OSX::NSObject
...
69
70
71
 
 
 
 
 
 
 
 
 
 
 
 
72
73
74
...
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
0
@@ -69,6 +69,18 @@ class ImageLoadOperation < OSX::NSOperation
0
       )
0
       @delegate.imageLoadForURL_didFailWithError(@url, error)
0
     end
0
+ setExecuting false
0
+ setFinished true
0
+ end
0
+
0
+ def connection_willSendRequest_redirectResponse(connection, request, redirectResponse)
0
+ if request.URL.absoluteString == "x-img://default" then
0
+ # we're already showing the default image
0
+ connection.cancel
0
+ setExecuting false
0
+ setFinished true
0
+ end
0
+ request
0
   end
0
   
0
   private

Comments

    No one has commented yet.