-
-
Save shaiguitar/d2af997b7f58e24fd305 to your computer and use it in GitHub Desktop.
sum in rubygems api is incorrect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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