gem_lookup 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/tests.yml +16 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.rubocop.yml +46 -0
- data/CHANGELOG.md +98 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +24 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +378 -0
- data/Rakefile +12 -0
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/booster_pack.rb +5 -0
- data/exe/gems +8 -0
- data/gem_lookup.gemspec +42 -0
- data/init/bundler.rb +6 -0
- data/init/environment.rb +3 -0
- data/init/zeitwerk.rb +13 -0
- data/lib/gem_lookup.rb +3 -0
- data/lib/gem_lookup/errors.rb +13 -0
- data/lib/gem_lookup/flags.rb +49 -0
- data/lib/gem_lookup/gems.rb +75 -0
- data/lib/gem_lookup/help.rb +78 -0
- data/lib/gem_lookup/rate_limit.rb +34 -0
- data/lib/gem_lookup/requests.rb +69 -0
- data/lib/gem_lookup/ruby_gems.rb +132 -0
- data/lib/gem_lookup/serializers/emoji.rb +120 -0
- data/lib/gem_lookup/serializers/interface.rb +51 -0
- data/lib/gem_lookup/serializers/json.rb +23 -0
- data/lib/gem_lookup/serializers/wordy.rb +118 -0
- data/lib/gem_lookup/version.rb +9 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 51612222b09b861d0448add7b96f2f83bd9c53df77c9eff3dc8c89ee67c717e2
|
4
|
+
data.tar.gz: 27ae8d9adf7bf3b18d6d104c3fae84b1e897438b6118ed1fb66c89c42b80daf6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f044675c1498ab060f2bd121dd9bc96f3953b939090fb1e0f47c7e633c22430ba7c247ad13e9a4692c728f7cdc3c7024aa0cbcdfdf4876fa9a03f3d968c25b9
|
7
|
+
data.tar.gz: 4691f287d685c9f1b586d480923cacef9cbe4361fbef71d29e50a3dc0bc88416f50ce92ddce2b79ae6bf60932d875969918586988633abb2b8efdfc9e81b00c7
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
ruby: [2.4, 2.5, 2.6, 2.7, 3.0, head]
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: ${{ matrix.ruby }}
|
15
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
16
|
+
- run: bundle exec rspec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
NewCops: enable
|
5
|
+
TargetRubyVersion: 2.7
|
6
|
+
SuggestExtensions: false
|
7
|
+
Exclude:
|
8
|
+
- 'vendor/**/*'
|
9
|
+
|
10
|
+
Gemspec/RequiredRubyVersion:
|
11
|
+
Enabled: false
|
12
|
+
Layout/LineLength:
|
13
|
+
Max: 100
|
14
|
+
Layout/HashAlignment:
|
15
|
+
EnforcedHashRocketStyle: table
|
16
|
+
EnforcedColonStyle: table
|
17
|
+
Layout/SpaceInsideBlockBraces:
|
18
|
+
SpaceBeforeBlockParameters: false
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 12
|
21
|
+
Style/Documentation:
|
22
|
+
Enabled: false
|
23
|
+
Style/RedundantFetchBlock:
|
24
|
+
Enabled: false
|
25
|
+
Style/ClassAndModuleChildren:
|
26
|
+
Enabled: false
|
27
|
+
Style/RaiseArgs:
|
28
|
+
EnforcedStyle: exploded
|
29
|
+
Style/StringLiterals:
|
30
|
+
Enabled: true
|
31
|
+
EnforcedStyle: single_quotes
|
32
|
+
Style/StringLiteralsInInterpolation:
|
33
|
+
Enabled: true
|
34
|
+
EnforcedStyle: double_quotes
|
35
|
+
RSpec/DescribeClass:
|
36
|
+
Enabled: false
|
37
|
+
RSpec/FilePath:
|
38
|
+
Enabled: false
|
39
|
+
RSpec/MessageSpies:
|
40
|
+
EnforcedStyle: receive
|
41
|
+
RSpec/MultipleExpectations:
|
42
|
+
Max: 3
|
43
|
+
RSpec/MultipleMemoizedHelpers:
|
44
|
+
Max: 10
|
45
|
+
RSpec/NestedGroups:
|
46
|
+
Max: 4
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog][changelog], and this project adheres to
|
6
|
+
[Semantic Versioning][semver].
|
7
|
+
|
8
|
+
## [1.0.0] - 2021-07-14
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
* CI support for multiple Ruby versions:
|
13
|
+
* MRI Ruby 2.4
|
14
|
+
* MRI Ruby 2.5
|
15
|
+
* MRI Ruby 2.6
|
16
|
+
* MRI Ruby 2.7
|
17
|
+
* MRI Ruby 3.0
|
18
|
+
* MRI Ruby head
|
19
|
+
* [Zeitwerk][zeitwerk] autoloader gem.
|
20
|
+
* Support for the `ENV['APP_ENV']` variable.
|
21
|
+
* Defaults to `development`.
|
22
|
+
* `exe/gems` explicitly sets it to `production`.
|
23
|
+
* `spec/spec_helper.rb` explicitly sets it to `test`.
|
24
|
+
* New **Wordy** output mode.
|
25
|
+
* No emojis, only words. :frowning_face:
|
26
|
+
* Enabled by passing `--wordy` or `-w` to the executable.
|
27
|
+
* Support for request timeouts.
|
28
|
+
* JSON responses now have an extra `"timeout"` boolean key.
|
29
|
+
* Requests now have an `"Accept Encoding" => "gzip"` header.
|
30
|
+
* Requests now limit timeouts to 10 seconds.
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
* Converted to a real gem! :gem:
|
35
|
+
* `gem install gem_lookup`
|
36
|
+
* Includes an executable, `gems`.
|
37
|
+
* Any previous symlinked `gems` script should be deleted.
|
38
|
+
* Renamed repository from `gem-lookup` to `gem_lookup`.
|
39
|
+
|
40
|
+
### Removed
|
41
|
+
|
42
|
+
* Dropped support for Ruby 2.3 and earlier.
|
43
|
+
|
44
|
+
## [0.7.0] - 2021-06-18
|
45
|
+
|
46
|
+
### Added
|
47
|
+
|
48
|
+
* New `--json` / `-j` flags return a JSON data structure that includes the entire response from
|
49
|
+
[RubyGems.org][gems api].
|
50
|
+
* Gems that are found successfully have an `"exists" : true` added to their JSON.
|
51
|
+
* Gems that are not found have a simple structure: `{ "name" : "gem_name", "exists" : false }`
|
52
|
+
|
53
|
+
## [0.6.5] - 2021-06-17
|
54
|
+
|
55
|
+
### Changed
|
56
|
+
|
57
|
+
* Flags are now analyzed at `#lookup` time.
|
58
|
+
|
59
|
+
## [0.6.4] - 2021-06-15
|
60
|
+
|
61
|
+
### Changed
|
62
|
+
|
63
|
+
* Unsupported flags now return an error instead of causing a lookup.
|
64
|
+
|
65
|
+
## [0.6.3] - 2021-06-14
|
66
|
+
|
67
|
+
### Changed
|
68
|
+
|
69
|
+
* Refactored the class-based methods to be more concise.
|
70
|
+
* The `--help` format has been updated to be akin to [`the_silver_searcher`'s][ag].
|
71
|
+
* Calling the application without any arguments now displays the `--help` content.
|
72
|
+
|
73
|
+
## [0.6.2] - 2021-06-14
|
74
|
+
|
75
|
+
### Changed
|
76
|
+
|
77
|
+
* Standardized the changelog emoji, so it is the same if there is a changelog or not.
|
78
|
+
|
79
|
+
## [0.6.1] - 2021-06-14
|
80
|
+
|
81
|
+
### Changed
|
82
|
+
|
83
|
+
* Extracted the `RubyGems.usage` method and added it to the message when the file is called without
|
84
|
+
any arguments.
|
85
|
+
|
86
|
+
### Added
|
87
|
+
|
88
|
+
## [0.6.0] - 2021-06-14
|
89
|
+
|
90
|
+
### Added
|
91
|
+
|
92
|
+
* Basic version support.
|
93
|
+
|
94
|
+
[changelog]: https://keepachangelog.com/en/1.0.0/
|
95
|
+
[semver]: https://semver.org/spec/v2.0.0.html
|
96
|
+
[ag]: https://github.com/ggreer/the_silver_searcher
|
97
|
+
[gems api]: https://guides.rubygems.org/rubygems-org-api/#gem-methods
|
98
|
+
[zeitwerk]: https://github.com/fxn/zeitwerk
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at josh@trueheart78.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Runtime dependencies go in the gemspec file.
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# Since ENV['APP_ENV'] is being used, requiring here instead of the gemspec file is wisest.
|
9
|
+
# Otherwise, access to certain gems will be restricted due to the ENV['APP_ENV'] setting being
|
10
|
+
# 'development' or 'test', as the latter does not load development dependencies defined in the
|
11
|
+
# gemspec file.
|
12
|
+
group :development, :test do
|
13
|
+
gem 'pry', '~> 0.14'
|
14
|
+
gem 'rake', '~> 13.0'
|
15
|
+
gem 'rspec', '~> 3.0'
|
16
|
+
gem 'rspec-junklet', '~> 2.2'
|
17
|
+
gem 'rubocop', '~> 1.7', require: false
|
18
|
+
# RuboCop RSpec's last version that supports Ruby 2.4
|
19
|
+
gem 'rubocop-rspec', '2.2.0', require: false
|
20
|
+
# SimpleCov's last version that supports Ruby 2.4
|
21
|
+
gem 'simplecov', '0.18.5', require: false
|
22
|
+
# WebMock's last version that supports Ruby 2.4
|
23
|
+
gem 'webmock', '3.8.3'
|
24
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Josh Mills
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Josh Mills
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,378 @@
|
|
1
|
+
# GemLookup :detective: ![workflow ci badge][ci badge]
|
2
|
+
|
3
|
+
Uses the [`typhoeus` :gem:][typhoeus] to make parallel requests to the public
|
4
|
+
[RubyGems API][rubygems api].
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
```sh
|
9
|
+
$ gem install gem_lookup
|
10
|
+
```
|
11
|
+
|
12
|
+
### Design
|
13
|
+
|
14
|
+
The idea behind `gem_lookup` is that you'll call the it using the `gems` executable command. It
|
15
|
+
should be used when you are doing maintenance and project upgrades. It will be able to answer
|
16
|
+
questions the [RubyGems website][rubygems site] can.
|
17
|
+
|
18
|
+
```sh
|
19
|
+
gems
|
20
|
+
```
|
21
|
+
|
22
|
+
This will be made available when the gem is installed.
|
23
|
+
|
24
|
+
### Flags
|
25
|
+
|
26
|
+
#### Help
|
27
|
+
|
28
|
+
Pass `-h` or `--help` to get help.
|
29
|
+
|
30
|
+
```sh
|
31
|
+
$ gems --help
|
32
|
+
```
|
33
|
+
|
34
|
+
#### Version
|
35
|
+
|
36
|
+
Pass `-v` or `--version` to get the installed version.
|
37
|
+
|
38
|
+
```sh
|
39
|
+
$ gems --version
|
40
|
+
```
|
41
|
+
|
42
|
+
### Pass It Some Gems
|
43
|
+
|
44
|
+
Since it sends requests in parallel, the order you pass gems in may not be the order in which
|
45
|
+
you see the results.
|
46
|
+
|
47
|
+
#### Formatting
|
48
|
+
|
49
|
+
The list of gems are lowercased, and then de-duped. So don't worry if you pass in any
|
50
|
+
capitalization or duplicate gems; It's got you covered. :sparkling_heart:
|
51
|
+
|
52
|
+
#### Output
|
53
|
+
|
54
|
+
By default, there will be many emojis to identify info, and a small variety of colors depending
|
55
|
+
on whether certain criteria are met for the line. It also looks even better with font ligatures
|
56
|
+
enabled, so if your font and/or terminal support them, it is recommended that they be enabled.
|
57
|
+
|
58
|
+
#### The Basics
|
59
|
+
|
60
|
+
##### Default Output
|
61
|
+
|
62
|
+
Just pass it a gem name.
|
63
|
+
|
64
|
+
```sh
|
65
|
+
$ gems pry
|
66
|
+
=> ๐ Looking up: pry
|
67
|
+
=> ๐ pry is at 0.14.1
|
68
|
+
==> ๐
April 12, 2021
|
69
|
+
==> ๐ http://pry.github.io
|
70
|
+
==> ๐ https://github.com/pry/pry
|
71
|
+
==> ๐ https://github.com/pry/pry/blob/master/CHANGELOG.md
|
72
|
+
```
|
73
|
+
|
74
|
+
##### Wordy Output
|
75
|
+
|
76
|
+
Use the `-w` or `--wordy` flags for emoji-less output.
|
77
|
+
|
78
|
+
```
|
79
|
+
$ gems --wordy pry
|
80
|
+
=> Looking up: pry
|
81
|
+
=> Gem: pry is at 0.14.1
|
82
|
+
==> Updated: April 12, 2021
|
83
|
+
==> Homepage: http://pry.github.io
|
84
|
+
==> Source Code: https://github.com/pry/pry
|
85
|
+
==> Changelog: https://github.com/pry/pry/blob/master/CHANGELOG.md
|
86
|
+
==> Mailing List: Unavailable
|
87
|
+
```
|
88
|
+
|
89
|
+
##### JSON Output
|
90
|
+
|
91
|
+
Use the `-j` or `--json` flags for JSON-based output. Two entries are added to each gem queried:
|
92
|
+
1. `exists` is whether or not the gem was found.
|
93
|
+
2. `timeout` is whether or not the request to the server for the gem timed out.
|
94
|
+
|
95
|
+
```
|
96
|
+
$ gems --json pry
|
97
|
+
{
|
98
|
+
"gems": [
|
99
|
+
{
|
100
|
+
"name": "pry",
|
101
|
+
"downloads": 212107466,
|
102
|
+
"version": "0.14.1",
|
103
|
+
"version_created_at": "2021-04-12T10:37:24.934Z",
|
104
|
+
"version_downloads": 1719287,
|
105
|
+
"platform": "ruby",
|
106
|
+
"authors": "John Mair (banisterfiend), Conrad Irwin, Ryan Fitzgerald, Kyrylo Silin",
|
107
|
+
"info": "Pry is a runtime developer console and IRB alternative with powerful\nintrospection capabilities. Pry aims to be more than an IRB replacement. It is\nan attempt to bring REPL driven programming to the Ruby language.\n",
|
108
|
+
"licenses": [
|
109
|
+
"MIT"
|
110
|
+
],
|
111
|
+
"metadata": {
|
112
|
+
"changelog_uri": "https://github.com/pry/pry/blob/master/CHANGELOG.md",
|
113
|
+
"bug_tracker_uri": "https://github.com/pry/pry/issues",
|
114
|
+
"source_code_uri": "https://github.com/pry/pry"
|
115
|
+
},
|
116
|
+
"yanked": false,
|
117
|
+
"sha": "99b6df0665875dd5a39d85e0150aa5a12e2bb4fef401b6c4f64d32ee502f8454",
|
118
|
+
"project_uri": "https://rubygems.org/gems/pry",
|
119
|
+
"gem_uri": "https://rubygems.org/gemspry-0.14.1.gem",
|
120
|
+
"homepage_uri": "http://pry.github.io",
|
121
|
+
"wiki_uri": null,
|
122
|
+
"documentation_uri": null,
|
123
|
+
"mailing_list_uri": null,
|
124
|
+
"source_code_uri": "https://github.com/pry/pry",
|
125
|
+
"bug_tracker_uri": "https://github.com/pry/pry/issues",
|
126
|
+
"changelog_uri": "https://github.com/pry/pry/blob/master/CHANGELOG.md",
|
127
|
+
"funding_uri": null,
|
128
|
+
"dependencies": {
|
129
|
+
"development": [
|
130
|
+
|
131
|
+
],
|
132
|
+
"runtime": [
|
133
|
+
{
|
134
|
+
"name": "coderay",
|
135
|
+
"requirements": "~> 1.1"
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"name": "method_source",
|
139
|
+
"requirements": "~> 1.0"
|
140
|
+
}
|
141
|
+
]
|
142
|
+
},
|
143
|
+
"exists": true,
|
144
|
+
"timeout": false
|
145
|
+
}
|
146
|
+
]
|
147
|
+
}
|
148
|
+
```
|
149
|
+
|
150
|
+
#### Standard Mode
|
151
|
+
|
152
|
+
Since there is a [rate limit](#rate-limit), passing less gems than that will cause it to run in
|
153
|
+
`Standard` mode:
|
154
|
+
|
155
|
+
```sh
|
156
|
+
$ gems pry rspec sentry-ruby rails
|
157
|
+
=> โจ Gems: 4
|
158
|
+
=> ๐ Looking up: pry, rspec, sentry-ruby, rails
|
159
|
+
=> ๐ rspec is at 3.10.0
|
160
|
+
==> ๐
October 30, 2020
|
161
|
+
==> ๐ http://github.com/rspec
|
162
|
+
==> ๐ https://github.com/rspec/rspec
|
163
|
+
==> ๐ No changelog
|
164
|
+
=> ๐ sentry-ruby is at 4.5.1
|
165
|
+
==> ๐
June 4, 2021
|
166
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
167
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
168
|
+
==> ๐ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
169
|
+
=> ๐ pry is at 0.14.1
|
170
|
+
==> ๐
April 12, 2021
|
171
|
+
==> ๐ http://pry.github.io
|
172
|
+
==> ๐ https://github.com/pry/pry
|
173
|
+
==> ๐ https://github.com/pry/pry/blob/master/CHANGELOG.md
|
174
|
+
=> ๐ rails is at 6.1.3.2
|
175
|
+
==> ๐
May 5, 2021
|
176
|
+
==> ๐ https://rubyonrails.org
|
177
|
+
==> ๐ https://github.com/rails/rails/tree/v6.1.3.2
|
178
|
+
==> ๐ https://github.com/rails/rails/releases/tag/v6.1.3.2
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Batch Mode
|
182
|
+
|
183
|
+
When more gems are passed in than the [rate limit](#rate-limit) supports, the script will enter
|
184
|
+
`Batch` mode. In this mode, the output is slightly different, and there is a **one second** pause
|
185
|
+
between batches, so as to respect the rate limit.
|
186
|
+
|
187
|
+
```sh
|
188
|
+
$ gems byebug pinglish rspec rubocop rubocop-rspec rubocop-rails sentry-ruby sentry-rails pry byebug typhoeus faraday Faraday rails pagy clowne discard aasm logidze GLOBALIZE lockbox factory_BOT faker site_prism nokogiri simplecov
|
189
|
+
=> โจ Gems: 24
|
190
|
+
=> ๐งบ Batch: 1 of 3
|
191
|
+
=> ๐ Looking up: byebug, pinglish, rspec, rubocop, rubocop-rspec, rubocop-rails, sentry-ruby, sentry-rails, pry, typhoeus
|
192
|
+
=> ๐ pinglish is at 0.2.1
|
193
|
+
==> ๐
November 13, 2014
|
194
|
+
==> ๐ https://github.com/jbarnette/pinglish
|
195
|
+
==> ๐ No changelog
|
196
|
+
=> ๐ sentry-rails is at 4.5.1
|
197
|
+
==> ๐
June 4, 2021
|
198
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
199
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
200
|
+
==> ๐ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
201
|
+
=> ๐ sentry-ruby is at 4.5.1
|
202
|
+
==> ๐
June 4, 2021
|
203
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
204
|
+
==> ๐ https://github.com/getsentry/sentry-ruby
|
205
|
+
==> ๐ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
206
|
+
=> ๐ rubocop-rails is at 2.10.1
|
207
|
+
==> ๐
May 5, 2021
|
208
|
+
==> ๐ https://docs.rubocop.org/rubocop-rails/
|
209
|
+
==> ๐ https://github.com/rubocop/rubocop-rails/
|
210
|
+
==> ๐ https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
|
211
|
+
=> ๐ rspec is at 3.10.0
|
212
|
+
==> ๐
October 30, 2020
|
213
|
+
==> ๐ http://github.com/rspec
|
214
|
+
==> ๐ https://github.com/rspec/rspec
|
215
|
+
==> ๐ No changelog
|
216
|
+
=> ๐ rubocop is at 1.16.1
|
217
|
+
==> ๐
June 9, 2021
|
218
|
+
==> ๐ https://rubocop.org/
|
219
|
+
==> ๐ https://github.com/rubocop/rubocop/
|
220
|
+
==> ๐ https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
221
|
+
=> ๐ rubocop-rspec is at 2.4.0
|
222
|
+
==> ๐
June 9, 2021
|
223
|
+
==> ๐ https://github.com/rubocop/rubocop-rspec
|
224
|
+
==> ๐ https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md
|
225
|
+
=> ๐ pry is at 0.14.1
|
226
|
+
==> ๐
April 12, 2021
|
227
|
+
==> ๐ http://pry.github.io
|
228
|
+
==> ๐ https://github.com/pry/pry
|
229
|
+
==> ๐ https://github.com/pry/pry/blob/master/CHANGELOG.md
|
230
|
+
=> ๐ typhoeus is at 1.4.0
|
231
|
+
==> ๐
May 8, 2020
|
232
|
+
==> ๐ https://github.com/typhoeus/typhoeus
|
233
|
+
==> ๐ https://github.com/typhoeus/typhoeus
|
234
|
+
==> ๐ No changelog
|
235
|
+
=> ๐ byebug is at 11.1.3
|
236
|
+
==> ๐
April 23, 2020
|
237
|
+
==> ๐ https://github.com/deivid-rodriguez/byebug
|
238
|
+
==> ๐ https://github.com/deivid-rodriguez/byebug
|
239
|
+
==> ๐ No changelog
|
240
|
+
=> ๐งบ Batch: 2 of 3
|
241
|
+
=> ๐ Looking up: faraday, rails, pagy, clowne, discard, aasm, logidze, globalize, lockbox, factory_bot
|
242
|
+
=> ๐ faraday is at 1.4.2
|
243
|
+
==> ๐
May 22, 2021
|
244
|
+
==> ๐ https://lostisland.github.io/faraday
|
245
|
+
==> ๐ https://github.com/lostisland/faraday
|
246
|
+
==> ๐ https://github.com/lostisland/faraday/releases/tag/v1.4.2
|
247
|
+
=> ๐ logidze is at 1.2.0
|
248
|
+
==> ๐
June 11, 2021
|
249
|
+
==> ๐ http://github.com/palkan/logidze
|
250
|
+
==> ๐ http://github.com/palkan/logidze
|
251
|
+
==> ๐ https://github.com/palkan/logidze/blob/master/CHANGELOG.md
|
252
|
+
=> ๐ clowne is at 1.3.0
|
253
|
+
==> ๐
May 12, 2021
|
254
|
+
==> ๐ https://clowne.evilmartians.io/
|
255
|
+
==> ๐ http://github.com/clowne-rb/clowne
|
256
|
+
==> ๐ https://github.com/clowne-rb/clowne/blob/master/CHANGELOG.md
|
257
|
+
=> ๐ discard is at 1.2.0
|
258
|
+
==> ๐
February 17, 2020
|
259
|
+
==> ๐ https://github.com/jhawthorn/discard
|
260
|
+
==> ๐ No changelog
|
261
|
+
=> ๐ pagy is at 4.8.0
|
262
|
+
==> ๐
June 8, 2021
|
263
|
+
==> ๐ https://github.com/ddnexus/pagy
|
264
|
+
==> ๐ No changelog
|
265
|
+
=> ๐ globalize is at 6.0.0
|
266
|
+
==> ๐
January 11, 2021
|
267
|
+
==> ๐ http://github.com/globalize/globalize
|
268
|
+
==> ๐ No changelog
|
269
|
+
=> ๐ factory_bot is at 6.2.0
|
270
|
+
==> ๐
May 7, 2021
|
271
|
+
==> ๐ https://github.com/thoughtbot/factory_bot
|
272
|
+
==> ๐ No changelog
|
273
|
+
=> ๐ rails is at 6.1.3.2
|
274
|
+
==> ๐
May 5, 2021
|
275
|
+
==> ๐ https://rubyonrails.org
|
276
|
+
==> ๐ https://github.com/rails/rails/tree/v6.1.3.2
|
277
|
+
==> ๐ https://github.com/rails/rails/releases/tag/v6.1.3.2
|
278
|
+
=> ๐ lockbox is at 0.6.4
|
279
|
+
==> ๐
April 6, 2021
|
280
|
+
==> ๐ https://github.com/ankane/lockbox
|
281
|
+
==> ๐ No changelog
|
282
|
+
=> ๐ aasm is at 5.2.0
|
283
|
+
==> ๐
May 1, 2021
|
284
|
+
==> ๐ https://github.com/aasm/aasm
|
285
|
+
==> ๐ https://github.com/aasm/aasm
|
286
|
+
==> ๐ No changelog
|
287
|
+
=> ๐งบ Batch: 3 of 3
|
288
|
+
=> ๐ Looking up: faker, site_prism, nokogiri, simplecov
|
289
|
+
=> ๐ faker is at 2.18.0
|
290
|
+
==> ๐
May 15, 2021
|
291
|
+
==> ๐ https://github.com/faker-ruby/faker
|
292
|
+
==> ๐ https://github.com/faker-ruby/faker
|
293
|
+
==> ๐ https://github.com/faker-ruby/faker/blob/master/CHANGELOG.md
|
294
|
+
=> ๐ site_prism is at 3.7.1
|
295
|
+
==> ๐
February 19, 2021
|
296
|
+
==> ๐ https://github.com/site-prism/site_prism
|
297
|
+
==> ๐ https://github.com/site-prism/site_prism
|
298
|
+
==> ๐ https://github.com/site-prism/site_prism/blob/main/CHANGELOG.md
|
299
|
+
=> ๐ nokogiri is at 1.11.7
|
300
|
+
==> ๐
June 3, 2021
|
301
|
+
==> ๐ https://nokogiri.org
|
302
|
+
==> ๐ https://github.com/sparklemotion/nokogiri
|
303
|
+
==> ๐ https://nokogiri.org/CHANGELOG.html
|
304
|
+
=> ๐ simplecov is at 0.21.2
|
305
|
+
==> ๐
January 9, 2021
|
306
|
+
==> ๐ https://github.com/simplecov-ruby/simplecov
|
307
|
+
==> ๐ https://github.com/simplecov-ruby/simplecov/tree/v0.21.2
|
308
|
+
==> ๐ https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md
|
309
|
+
```
|
310
|
+
|
311
|
+
#### Non-Existent Gems
|
312
|
+
|
313
|
+
If a gem isn't found, the output will be a little bit different: that particular line will be
|
314
|
+
red. It's also important to know that not finding a gem doesn't block other gems from being looked
|
315
|
+
up.
|
316
|
+
|
317
|
+
```sh
|
318
|
+
$ gems non-existent rails
|
319
|
+
=> โจ Gems: 2
|
320
|
+
=> ๐ Looking up: non-existent, rails
|
321
|
+
=> ๐ non-existent not found
|
322
|
+
=> ๐ rails is at 6.1.3.2
|
323
|
+
==> ๐
May 5, 2021
|
324
|
+
==> ๐ https://rubyonrails.org
|
325
|
+
==> ๐ https://github.com/rails/rails/tree/v6.1.3.2
|
326
|
+
==> ๐ https://github.com/rails/rails/releases/tag/v6.1.3.2
|
327
|
+
```
|
328
|
+
|
329
|
+
#### Timing Out
|
330
|
+
|
331
|
+
If a gem lookup times out, the output will let you know.
|
332
|
+
|
333
|
+
```sh
|
334
|
+
$ gems rails
|
335
|
+
=> ๐ Looking up: rails
|
336
|
+
=> ๐ rails lookup timed out
|
337
|
+
```
|
338
|
+
|
339
|
+
## Rate Limit
|
340
|
+
|
341
|
+
Please be aware there is a [rate limit][rate limit] to be mindful of.
|
342
|
+
|
343
|
+
As of June 10th, 2021: `API and website: 10 requests per second`.
|
344
|
+
|
345
|
+
## Development
|
346
|
+
|
347
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
|
348
|
+
the tests. You can also run `bin/console` for an interactive prompt that will allow you to
|
349
|
+
experiment.
|
350
|
+
|
351
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new
|
352
|
+
version, update the version number in `version.rb`, and then run `bundle exec rake release`, which
|
353
|
+
will create a git tag for the version, push git commits and the created tag, and push the
|
354
|
+
`gem_lookup.gem_spec` file to [rubygems.org][rubygems site].
|
355
|
+
|
356
|
+
## Contributing
|
357
|
+
|
358
|
+
Bug reports and pull requests are welcome [on GitHub][git] This project is intended to be a safe,
|
359
|
+
welcoming space for collaboration, and contributors are expected to adhere to the
|
360
|
+
[code of conduct][coc].
|
361
|
+
|
362
|
+
## License
|
363
|
+
|
364
|
+
The gem is available as open source under the terms of the [MIT License][mit].
|
365
|
+
|
366
|
+
## Code of Conduct
|
367
|
+
|
368
|
+
Everyone interacting in the GemLookup project's codebases, issue trackers, chat rooms and
|
369
|
+
mailing lists is expected to follow the [code of conduct][coc].
|
370
|
+
|
371
|
+
[ci badge]: https://github.com/trueheart78/gem_lookup/actions/workflows/tests.yml/badge.svg
|
372
|
+
[typhoeus]: https://github.com/typhoeus/typhoeus/
|
373
|
+
[rubygems site]: https://rubygems.org/
|
374
|
+
[rubygems api]: https://guides.rubygems.org/rubygems-org-api/#gem-methods
|
375
|
+
[rate limit]: https://guides.rubygems.org/rubygems-org-rate-limits/
|
376
|
+
[git]: https://github.com/trueheart78/gem_lookup/
|
377
|
+
[coc]: https://github.com/trueheart78/gem_lookup/blob/master/CODE_OF_CONDUCT.md
|
378
|
+
[mit]: https://opensource.org/licenses/MIT
|