gem_collector
gem_collector copied to clipboard
[WIP] Import latest gem versions from rubygems.org
What
Automaticaly update the latest version of gems. It is useful to know it is up to date.
current: The newest version used in the registered project in gem_collector.
Now it wants this: The latest version on rubygems.org.
How
- Download
https://rubygems.org/specs.4.8.gz
. - Import it to
gem_collector_latest_gem_versions
table. - Automaticaly update it by sidekiq plug-in, whenever, vanilla cron, etc.
Like this:
rails runner "GemCollector::UpdateLatestGemVersionsJob.new.perform"
Implements
Table name: latest_gem_versions
Name | Type | Attributes |
---|---|---|
id |
integer |
not null, primary key |
gem_name |
string |
not null |
version |
string |
-
index_latest_gem_versions_on_gem_name
(unique):-
gem_name
-
gem_name
column has unique constraint and import with :on_duplicate_key_update
option.
Wish to consult
- It does not fetch prerelease_specs. Is it OK? I think when calcurating latest gem rate, beta version should be excluded.
- gem's platform is fixed to "ruby". Is it OK?
It looks a good starting point to me, but I have one question; why do you import only latest versions? With only latest versions, we can judge "up-to-date or not", but cannot measure "how up-to-date".
Thank you for review!
why do you import only latest versions?
I only thought about checking "up-to-date or not", like this. https://gyazo.com/dc491bc97a5b8b59b979f054f015ed1c It seems better to keep all gem versions, but how do I show it 🤔