Giter Site home page Giter Site logo

epistrephein / rubies Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 1.0 614 KB

A Sinatra API interface to Ruby versions, releases and branches.

Home Page: https://rubies.io

License: MIT License

Ruby 83.27% HTML 13.65% CSS 0.63% Shell 2.45%
ruby ruby-versions version-checker rest-api sinatra redis

rubies's Introduction

Rubies CI

A Sinatra API interface to Ruby versions, releases and branches.

The application is live at https://rubies.io.

Usage

The API endpoint is https://rubies.io/api.
All successful requests return a JSON response with Content-Type application/json and status 200.
CORS is enabled by default.

Statuses

/normal - returns the branches and the latest releases in normal maintenance (receiving bug fixes and security fixes).

$ curl -s https://rubies.io/api/normal | jq
{
  "status": "normal",
  "branches": [
    "3.2",
    "3.1"
  ],
  "latest": [
    "3.2.2",
    "3.1.4"
  ]
}

/security - returns the branches and the latest releases in security maintenance (receiving security fixes only).

$ curl -s https://rubies.io/api/security | jq
{
  "status": "security",
  "branches": [
    "3.0"
  ],
  "latest": [
    "3.0.6"
  ]
}

/preview - returns the branches and the latest releases currently in preview.

$ curl -s https://rubies.io/api/preview | jq
{
  "status": "preview",
  "branches": [
    "3.3"
  ],
  "latest": [
    "3.3.0-preview3"
  ]
}

/eol - returns the end-of-life branches and latest releases (no longer supported and not receiving any fixes).

$ curl -s https://rubies.io/api/eol | jq
{
  "status": "eol",
  "branches": [
    "2.7",
    "2.6",
    "2.5",
    "2.4",
    "2.3",
    "2.2",
    "2.1",
    "2.0",
    "1.9"
  ],
  "latest": [
    "2.7.8",
    "2.6.10",
    "2.5.9",
    "2.4.10",
    "2.3.8",
    "2.2.10",
    "2.1.10",
    "2.0.0-p648",
    "1.9.3-p551"
  ]
}

Branches

/<major>.<minor> - returns the status, release date, eol date (if any), latest release and all releases of a branch.
Lowest branch returned: 1.9.

$ curl -s https://rubies.io/api/3.2 | jq
{
  "branch": "3.2",
  "status": "normal",
  "release_date": "2022-12-25",
  "eol_date": null,
  "latest": "3.2.2",
  "releases": [
    "3.2.2",
    "3.2.1",
    "3.2.0",
    "3.2.0-rc1",
    "3.2.0-preview3",
    "3.2.0-preview2",
    "3.2.0-preview1"
  ]
}
$ curl -s https://rubies.io/api/2.7 | jq
{
  "branch": "2.7",
  "status": "eol",
  "release_date": "2019-12-25",
  "eol_date": "2023-03-31",
  "latest": "2.7.8",
  "releases": [
    "2.7.8",
    "2.7.7",
    "2.7.6",
    "2.7.5",
    "2.7.4",
    "2.7.3",
    "2.7.2",
    "2.7.1",
    "2.7.0",
    "2.7.0-rc2",
    "2.7.0-rc1",
    "2.7.0-preview3",
    "2.7.0-preview2",
    "2.7.0-preview1"
  ]
}

Releases

/<major>.<minor>.<patch> - returns the branch, status and release date of a release, and whether it's the latest version of the branch and/or a prerelease.
Lowest release returned: 1.9.0.

$ curl -s https://rubies.io/api/3.2.0 | jq
{
  "release": "3.2.0",
  "branch": "3.2",
  "status": "normal",
  "release_date": "2022-12-25",
  "latest": false,
  "prerelease": false
}
$ curl -s https://rubies.io/api/3.0.6 | jq
{
  "release": "3.0.6",
  "branch": "3.0",
  "status": "security",
  "release_date": "2023-03-30",
  "latest": true,
  "prerelease": false
}
$ curl -s https://rubies.io/api/2.7.7 | jq
{
  "release": "2.7.7",
  "branch": "2.7",
  "status": "eol",
  "release_date": "2022-11-24",
  "latest": false,
  "prerelease": false
}

Meta

/last_update - returns the time the data was updated. Time format is %Y-%m-%d %H:%M:%S %z.

$ curl -s https://rubies.io/api/last_update | jq
{
  "last_update": "2023-11-27 09:00:00 +0000"
}

Errors

Invalid requests return a 404 status with no body.

$ curl -I https://rubies.io/api/invalid
HTTP/1.1 404 Not Found

Development

After checking out the repo, run bin/setup -d to install dependencies for the development environment.

This application fetches data regarding Ruby branches and releases from the official repo ruby/www.ruby-lang.org and stores it in Redis for fast access.
Use rake redis to populate Redis with the latest data.

The Sinatra server is automatically reloaded when files change using rerun.
Use rake server to start the development server locally.

Use rake console to start a console session.

Use rake spec to run the tests and rake rubocop to run RuboCop.

Contributing

Bug reports and pull requests are welcome on GitHub.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Code of Conduct.

You can contribute changes by forking the project and submitting a pull request. To get started:

  1. Fork the repo
  2. Install the dependencies (bin/setup -d)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Pass the test suite (bundle exec rake spec rubocop)
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new pull request

License

This project is released as open source under the terms of the MIT License.

rubies's People

Contributors

depfu[bot] avatar epistrephein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ruurd

rubies's Issues

Use ruby/www.ruby-lang.org YAML files instead of scraping

The API data relies on scraping the ruby-lang.org website for updated infos about status, branches and releases. The website is actually built using YAML data sources stored in the ruby/www.ruby-lang.org git repository.

The Rubies rake task for Redis should parse these yml files instead of trying to scrape the website directly. This would allow to ditch the nokogiri dependency and lighten the process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.