Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusRich committed Feb 6, 2022
1 parent dc37e8e commit a0fef24
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ gem install end_of_life

## Usage

1. Set up a [GitHub access token];
1. Set up a [GitHub access token][] (we recommend using a read-only token);

[GitHub access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token
[github access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token

2. Export the `GITHUB_TOKEN` environment variable or set it when calling `end_of_life`;

3. Use the `end_of_life` command to list the repositories:

```sh
$ GITHUB_TOKEN=something end_of_life # if your platform supports symlinks, you can use the `eol` command instead
[✔] Fetching repositories...
Expand All @@ -33,23 +34,40 @@ Found 2 repositories using EOL Ruby (<= 2.5.9):
└───┴──────────────────────────────────────────────┴──────────────┘
```
## How it works?
### Options
There are some options to help you filter down the results:
```
Usage: end_of_life [options]
--exclude=NAME,NAME2 Exclude repositories containing a certain word in its name. You can specify up to five words.
--public-only Searches only public repostories
--private-only Searches only private repostories
--repo, --repository=USER/REPO Searches a specific repostory
--org, --organization=ORG,ORG2 Searches within specific organizations
-u, --user=NAME Sets the user used on the repository search
--max-eol-days-away NUMBER Sets the maximum number of days away a version can be from EOL. It defaults to 0.
-v, --version Displays end_of_life version
-h, --help Displays this help
```
## How it works
This gem fetches all your GitHub repositories that contain Ruby code, then
searches for files that may have a Ruby version. Currently, those files are:
`.ruby-version`, `Gemfile`, `Gemfile.lock`, and `.tool-version`. We parse these
files and extract the minimum Ruby version used in the repository.
The EOL Ruby version is defined statically in [this JSON file] provided by
https://endoflife.date/. We plan to fetch their API endpoint in the future.
The EOL Ruby version is provided by https://endoflife.date/, with a file
[fallback].
> **IMPORTANT:** To parse Gemfiles, we need to execute the code inside it. **Be
> careful** because this may be a security risk. We plan to add a secure parser
> for Gemfiles in the future.
Some other limitations are listed on the [issues page].
[this json file]: ./lib/end_of_life.json
[fallback]: ./lib/end_of_life.json
[issues page]: https://github.com/MatheusRich/end_of_life/issues
## Development
Expand Down

0 comments on commit a0fef24

Please sign in to comment.