Permalink
Browse files

Merge branch 'snowblink/master' into integration

  • Loading branch information...
2 parents 2ad3fff + df4893a commit c9354c7d9f0f024f39ffaf78e8e774fe644c9041 @drnic drnic committed Jan 30, 2011
Showing with 13 additions and 6 deletions.
  1. +12 −6 lib/commands/helpers.rb
  2. +1 −0 lib/github/ui.rb
View
@@ -334,8 +334,9 @@
if cache_network_data(options)
begin
return cache_data(user)
- rescue SocketError
+ rescue Exception => e
STDERR.puts "*** Warning: There was a problem accessing the network."
+ STDERR.puts e
rv = get_cache
STDERR.puts "Using cached data."
rv
@@ -373,12 +374,17 @@
File.join(dir, 'commits-cache')
end
+helper :github_user do
+ `git config --get github.user`.chomp
+end
+
+helper :github_token do
+ `git config --get github.token`.chomp
+end
+
helper :cache_data do |user|
- raw_data = Kernel.open(network_meta_for(user)).read
- File.open( network_cache_path, 'w' ) do |out|
- out.write(raw_data)
- end
- data = JSON.parse(raw_data)
+ `curl -s -L -F 'login=#{github_user}' -F 'token=#{github_token}' #{network_meta_for(user)} -o #{network_cache_path}`
+ get_cache
end
helper :cache_expired? do
View
@@ -1,3 +1,4 @@
+require 'rubygems'
require "readline"
require "highline"
module GitHub

0 comments on commit c9354c7

Please sign in to comment.