app/lib/github_basic_detective.rb
# Take JSON data of form {:language => lines_of_code, ...}
# and return a cleaned-up string representing it.  We forcibly sort
# it by LOC (GitHub returns it that way, but I don't see any guarantee,
# so we sort it to make sure).  We also exclude languages that most people
# wouldn't expect to see listed.
# Currently we include *all* languages listed; if it's a long list, the
# later ones are more likely to be a mistake, but it's hard to figure out
# where to cut things off.
Take JSON data of form {:language => lines_of_code, ...}
and return a cleaned-up string representing it.  We forcibly sort
it by LOC (GitHub returns it that way, but I don't see any guarantee,
so we sort it to make sure).  We also exclude languages that most people
wouldn't expect to see listed.
Currently we include *all* languages listed; if it's a long list, the
later ones are more likely to be a mistake, but it's hard to figure out
where to cut things off.
Take JSON data of form { : language = > lines_of_code ... } and return a cleaned - up string representing it . We forcibly sort it by LOC ( GitHub returns it that way but I don ' t see any guarantee so we sort it to make sure ) . We also exclude languages that most people wouldn ' t expect to see listed . Currently we include * all * languages listed ; if it ' s a long list the later ones are more likely to be a mistake but it ' s hard to figure out where to cut things off .
def language_cleanup(raw_language_data)
    return '' if raw_language_data.blank?
    full_list = raw_language_data.sort_by(&:last).reverse.map(&:first)
    shorter_list = full_list - EXCLUDE_IMPLEMENTATION_LANGUAGES
    shorter_list.join(', ')
  end
def language_cleanup ( raw_language_data ) return '' if raw_language_data . blank? full_list = raw_language_data . sort_by ( & :last ) . reverse . map ( & :first ) shorter_list = full_list - EXCLUDE_IMPLEMENTATION_LANGUAGES shorter_list . join ( ', ' ) end
Take JSON data of form {:language => lines_of_code, ...}
and return a cleaned-up string representing it.
Take JSON data of form { : language = > lines_of_code ... } and return a cleaned - up string representing it .
raw_language_data
<not_specific>