gem_collector icon indicating copy to clipboard operation
gem_collector copied to clipboard

[WIP] Import latest gem versions from rubygems.org

Open onk opened this issue 7 years ago • 2 comments

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

  1. Download https://rubygems.org/specs.4.8.gz.
  2. Import it to gem_collector_latest_gem_versions table.
  3. 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?

onk avatar Mar 23 '17 21:03 onk

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".

eagletmt avatar Apr 03 '17 03:04 eagletmt

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 🤔

onk avatar Apr 03 '17 05:04 onk