Skip to content

Instantly share code, notes, and snippets.

@shaiguitar
Last active December 25, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaiguitar/d2af997b7f58e24fd305 to your computer and use it in GitHub Desktop.
Save shaiguitar/d2af997b7f58e24fd305 to your computer and use it in GitHub Desktop.
sum in rubygems api is incorrect
Close, but no cigar:
## Example 1
>> Gems.downloads('rails','4.0.0',4.year.ago, Time.now).map(&:last).sum
=> 710804
But...https://rubygems.org/gems/rails/versions/4.0.0 says 740248
So, 740248 vs 710804.
## Example 2
>> Gems.downloads('gems','0.8.3',2.year.ago, Time.now).map(&:last).sum
=> 2324
https://rubygems.org/gems/gems/versions/0.8.3 says 3055.
So, 2324 vs 3055.
## Example 4
>> Gems.downloads('rails','2.3.5',3.year.ago, Time.now).map(&:last).sum
=> 32966
But...https://rubygems.org/gems/rails/versions/2.3.5 says 1,052,940.
So, 32966 vs 1,052,940.
Probably can find more..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment