framework.dev icon indicating copy to clipboard operation
framework.dev copied to clipboard

Add support for Ruby libraries on framework.dev

Open kenslachtajr opened this issue 2 years ago • 0 comments

Description

  • Ruby is not supported out of the box and a research spike was conducted to determine the best way to add support for Ruby libraries on framework.dev. This ticket involves and adding support for comparing different Ruby libraries based on certain properties. At the end of this text, you can see some suggested properties for comparison which we can use.

  • Adding badges for Ruby libraries is an additional need for this ticket. We are able to make use of the same properties in implementing badge functionality as well. Please refer to the original spike ticket for more context: https://github.com/thisdot/framework.dev/issues/577

Ruby

In Ruby, RubyGems.org is the index of Ruby gems (packages) and there is also BestGems.org which offers download statistics for Ruby gems.

For example, BestGems.org has the following endpoints for getting downloads and ranking:

  • https://bestgems.org/api/v1/gems/[package-name]/total_ranking.json
  • https://bestgems.org/api/v1/gems/[package-name]/daily_ranking.json
  • https://bestgems.org/api/v1/gems/[package-name]/total_downloads.json
  • https://bestgems.org/api/v1/gems/[package-name]/daily_downloads.json

RubyGems.org can get you other information about a package:

// GET https://rubygems.org/api/v1/gems/aws-sdk-core.json

{
  "name": "aws-sdk-core",
  "downloads": 873693539,
  "version": "3.169.0",
  "version_created_at": "2023-01-18T20:31:20.443Z",
  "version_downloads": 691524,
  "platform": "ruby",
  "authors": "Amazon Web Services",
  "info": "Provides API clients for AWS. This gem is part of the official AWS SDK for Ruby.",
  "licenses": [
    "Apache-2.0"
  ],
  "metadata": {
    "changelog_uri": "https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core/CHANGELOG.md",
    "source_code_uri": "https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core"
  },
  "yanked": false,
  "sha": "81e75e70dfd4a17c55554b593ad2de5534b6cab9197cd8e278eb8b0a9ad4051b",
  "project_uri": "https://rubygems.org/gems/aws-sdk-core",
  "gem_uri": "https://rubygems.org/gems/aws-sdk-core-3.169.0.gem",
  "homepage_uri": "https://github.com/aws/aws-sdk-ruby",
  "wiki_uri": null,
  "documentation_uri": null,
  "mailing_list_uri": null,
  "source_code_uri": "https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core",
  "bug_tracker_uri": null,
  "changelog_uri": "https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-core/CHANGELOG.md",
  "funding_uri": null,
  "dependencies": {}
}

GitHub stars can be retrieved directly from GitHub via the https://api.github.com/repos/[owner]/[project] API endpoint. For example:

// GET https://api.github.com/repos/Seldaek/monolog

{
  "id": 1376664,
  "node_id": "MDEwOlJlcG9zaXRvcnkxMzc2NjY0",
  "name": "monolog",
  "full_name": "Seldaek/monolog",
  "private": false,
  // ...
  "size": 3709,
  "stargazers_count": 20133,
  "watchers_count": 20133,
}

For framework.dev, we might consider:

  • Daily ranking
  • Daily downloads
  • GitHub stars

kenslachtajr avatar Mar 21 '23 20:03 kenslachtajr