Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Feb 10, 2014
1 parent 73f0f15 commit 79accde
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/ruby/rendering-data-as-graphs/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MyGraphApp < Sinatra::Base
repos = octokit_client.repositories
language_obj = {}
repos.each do |repo|
# sometimes language can be nil
# sometimes language can be nil
if repo.language
if !language_obj[repo.language]
language_obj[repo.language] = 1
Expand All @@ -46,18 +46,18 @@ class MyGraphApp < Sinatra::Base
language_obj.each do |lang, count|
languages.push :language => lang, :count => count
end

language_byte_count = []
repos.each do |repo|
repo_name = repo.name
repo_langs = [];
repo_langs = []
begin
repo_url = "#{github_user.login}/#{repo_name}"
repo_langs = octokit_client.languages(repo_url)
rescue Octokit::NotFound
puts "Error retrieving languages for #{repo_url}"
puts "Error retrieving languages for #{repo_url}"
end
if !repo_langs.empty?
if !repo_langs.empty?
repo_langs.each do |lang, count|
if !language_obj[lang]
language_obj[lang] = count
Expand Down

0 comments on commit 79accde

Please sign in to comment.