gem_lookup

Simple but effective command line interface that looks up gems using RubyGems.org's public API and displays results in an emoji-filled fashion.


License
MIT
Install
gem install gem_lookup -v 1.2.1

Documentation

GemLookup ๐Ÿ•ต๏ธ workflow ci badge

Uses the typhoeus ๐Ÿ’Ž to make parallel requests to the public RubyGems API.

Installation

$ gem install gem_lookup

Design

The idea behind gem_lookup is that you'll call the it using the gems executable command. It should be used when you are doing maintenance and project upgrades. It will be able to answer questions the RubyGems website can.

gems

This will be made available when the gem is installed.

Flags

Help

Pass -h or --help to get help.

$ gems --help

Version

Pass -v or --version to get the installed version.

$ gems --version

Pass It Some Gems

Since it sends requests in parallel, the order you pass gems in may not be the order in which you see the results.

Formatting

The list of gems are lowercased, and then de-duped. So don't worry if you pass in any capitalization or duplicate gems; It's got you covered. ๐Ÿ’–

Output

By default, there will be many emojis to identify info, and a small variety of colors depending on whether certain criteria are met for the line. It also looks even better with font ligatures enabled, so if your font and/or terminal support them, it is recommended that they be enabled.

The Basics

Default Output

Just pass it a gem name.

$ gems pry
=> ๐Ÿ”Ž Looking up: pry
=> ๐Ÿ’Ž pry is at 0.14.1
==> ๐Ÿ“… April 12, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/pry
==> ๐Ÿ  http://pry.github.io
==> ๐Ÿ”— https://github.com/pry/pry
==> ๐Ÿ“‘ https://github.com/pry/pry/blob/master/CHANGELOG.md
Wordy Output

Use the -w or --wordy flags for emoji-less output.

$ gems --wordy pry
=> Looking up: pry
=> Gem: pry is at 0.14.1
==> Updated:      April 12, 2021
==> License:      MIT
==> Location:     https://rubygems.org/gems/pry
==> Homepage:     http://pry.github.io
==> Source Code:  https://github.com/pry/pry
==> Changelog:    https://github.com/pry/pry/blob/master/CHANGELOG.md
==> Mailing List: Unavailable
JSON Output

Use the -j or --json flags for JSON-based output. Two entries are added to each gem queried:

  1. exists is whether or not the gem was found.
  2. timeout is whether or not the request to the server for the gem timed out.
$ gems --json pry
{
  "gems": [
    {
      "name": "pry",
      "downloads": 212107466,
      "version": "0.14.1",
      "version_created_at": "2021-04-12T10:37:24.934Z",
      "version_downloads": 1719287,
      "platform": "ruby",
      "authors": "John Mair (banisterfiend), Conrad Irwin, Ryan Fitzgerald, Kyrylo Silin",
      "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",
      "licenses": [
        "MIT"
      ],
      "metadata": {
        "changelog_uri": "https://github.com/pry/pry/blob/master/CHANGELOG.md",
        "bug_tracker_uri": "https://github.com/pry/pry/issues",
        "source_code_uri": "https://github.com/pry/pry"
      },
      "yanked": false,
      "sha": "99b6df0665875dd5a39d85e0150aa5a12e2bb4fef401b6c4f64d32ee502f8454",
      "project_uri": "https://rubygems.org/gems/pry",
      "gem_uri": "https://rubygems.org/gemspry-0.14.1.gem",
      "homepage_uri": "http://pry.github.io",
      "wiki_uri": null,
      "documentation_uri": null,
      "mailing_list_uri": null,
      "source_code_uri": "https://github.com/pry/pry",
      "bug_tracker_uri": "https://github.com/pry/pry/issues",
      "changelog_uri": "https://github.com/pry/pry/blob/master/CHANGELOG.md",
      "funding_uri": null,
      "dependencies": {
        "development": [

        ],
        "runtime": [
          {
            "name": "coderay",
            "requirements": "~> 1.1"
          },
          {
            "name": "method_source",
            "requirements": "~> 1.0"
          }
        ]
      },
      "exists": true,
      "timeout": false
    }
  ]
}

Standard Mode

Since there is a rate limit, passing less gems than that will cause it to run in Standard mode:

$ gems pry rspec sentry-ruby rails
=> ๐Ÿค” 4 gems
=> ๐Ÿ”Ž pry, rspec, sentry-ruby, rails
=> ๐Ÿ’Ž pry is at 0.14.1
==> ๐Ÿ“… April 12, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/pry
==> ๐Ÿ  http://pry.github.io
==> ๐Ÿ”— https://github.com/pry/pry
==> ๐Ÿ“‘ https://github.com/pry/pry/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž rspec is at 3.10.0
==> ๐Ÿ“… October 30, 2020
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rspec
==> ๐Ÿ  http://github.com/rspec
==> ๐Ÿ”— https://github.com/rspec/rspec
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ https://groups.google.com/forum/#!forum/rspec
=> ๐Ÿ’Ž sentry-ruby is at 4.6.1
==> ๐Ÿ“… July 8, 2021
==> ๐Ÿ’ผ Apache-2.0
==> ๐Ÿงญ https://rubygems.org/gems/sentry-ruby
==> ๐Ÿ  https://github.com/getsentry/sentry-ruby
==> ๐Ÿ”— https://github.com/getsentry/sentry-ruby
==> ๐Ÿ“‘ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž rails is at 6.1.4
==> ๐Ÿ“… June 24, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rails
==> ๐Ÿ  https://rubyonrails.org
==> ๐Ÿ”— https://github.com/rails/rails/tree/v6.1.4
==> ๐Ÿ“‘ https://github.com/rails/rails/releases/tag/v6.1.4
==> ๐Ÿ’Œ https://discuss.rubyonrails.org/c/rubyonrails-talk

Batch Mode

When more gems are passed in than the rate limit supports, the script will enter Batch mode. In this mode, the output is slightly different, and there is a one second pause between batches, so as to respect the rate limit.

$ 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
=> ๐Ÿค” 24 gems
=> ๐Ÿงบ 1 of 3
=> ๐Ÿ”Ž byebug, pinglish, rspec, rubocop, rubocop-rspec, rubocop-rails, sentry-ruby, sentry-rails, pry, typhoeus
=> ๐Ÿ’Ž rspec is at 3.10.0
==> ๐Ÿ“… October 30, 2020
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rspec
==> ๐Ÿ  http://github.com/rspec
==> ๐Ÿ”— https://github.com/rspec/rspec
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ https://groups.google.com/forum/#!forum/rspec
=> ๐Ÿ’Ž rubocop-rspec is at 2.4.0
==> ๐Ÿ“… June 9, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rubocop-rspec
==> ๐Ÿ  https://github.com/rubocop/rubocop-rspec
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž rubocop is at 1.18.3
==> ๐Ÿ“… July 6, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rubocop
==> ๐Ÿ  https://rubocop.org/
==> ๐Ÿ”— https://github.com/rubocop/rubocop/
==> ๐Ÿ“‘ https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž sentry-rails is at 4.6.1
==> ๐Ÿ“… July 8, 2021
==> ๐Ÿ’ผ Apache-2.0
==> ๐Ÿงญ https://rubygems.org/gems/sentry-rails
==> ๐Ÿ  https://github.com/getsentry/sentry-ruby
==> ๐Ÿ”— https://github.com/getsentry/sentry-ruby
==> ๐Ÿ“‘ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž byebug is at 11.1.3
==> ๐Ÿ“… April 23, 2020
==> ๐Ÿ’ผ BSD-2-Clause
==> ๐Ÿงญ https://rubygems.org/gems/byebug
==> ๐Ÿ  https://github.com/deivid-rodriguez/byebug
==> ๐Ÿ”— https://github.com/deivid-rodriguez/byebug
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž pinglish is at 0.2.1
==> ๐Ÿ“… November 13, 2014
==> ๐Ÿ’ผ None
==> ๐Ÿงญ https://rubygems.org/gems/pinglish
==> ๐Ÿ  https://github.com/jbarnette/pinglish
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž sentry-ruby is at 4.6.1
==> ๐Ÿ“… July 8, 2021
==> ๐Ÿ’ผ Apache-2.0
==> ๐Ÿงญ https://rubygems.org/gems/sentry-ruby
==> ๐Ÿ  https://github.com/getsentry/sentry-ruby
==> ๐Ÿ”— https://github.com/getsentry/sentry-ruby
==> ๐Ÿ“‘ https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž rubocop-rails is at 2.11.3
==> ๐Ÿ“… July 11, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rubocop-rails
==> ๐Ÿ  https://docs.rubocop.org/rubocop-rails/
==> ๐Ÿ”— https://github.com/rubocop/rubocop-rails/
==> ๐Ÿ“‘ https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž pry is at 0.14.1
==> ๐Ÿ“… April 12, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/pry
==> ๐Ÿ  http://pry.github.io
==> ๐Ÿ”— https://github.com/pry/pry
==> ๐Ÿ“‘ https://github.com/pry/pry/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž typhoeus is at 1.4.0
==> ๐Ÿ“… May 8, 2020
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/typhoeus
==> ๐Ÿ  https://github.com/typhoeus/typhoeus
==> ๐Ÿ”— https://github.com/typhoeus/typhoeus
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ http://groups.google.com/group/typhoeus
=> ๐Ÿงบ 2 of 3
=> ๐Ÿ”Ž faraday, rails, pagy, clowne, discard, aasm, logidze, globalize, lockbox, factory_bot
=> ๐Ÿ’Ž discard is at 1.2.0
==> ๐Ÿ“… February 17, 2020
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/discard
==> ๐Ÿ  https://github.com/jhawthorn/discard
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž rails is at 6.1.4
==> ๐Ÿ“… June 24, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rails
==> ๐Ÿ  https://rubyonrails.org
==> ๐Ÿ”— https://github.com/rails/rails/tree/v6.1.4
==> ๐Ÿ“‘ https://github.com/rails/rails/releases/tag/v6.1.4
==> ๐Ÿ’Œ https://discuss.rubyonrails.org/c/rubyonrails-talk
=> ๐Ÿ’Ž pagy is at 4.10.1
==> ๐Ÿ“… June 24, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/pagy
==> ๐Ÿ  https://github.com/ddnexus/pagy
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž clowne is at 1.3.0
==> ๐Ÿ“… May 12, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/clowne
==> ๐Ÿ  https://clowne.evilmartians.io/
==> ๐Ÿ”— http://github.com/clowne-rb/clowne
==> ๐Ÿ“‘ https://github.com/clowne-rb/clowne/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž logidze is at 1.2.0
==> ๐Ÿ“… June 11, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/logidze
==> ๐Ÿ  http://github.com/palkan/logidze
==> ๐Ÿ”— http://github.com/palkan/logidze
==> ๐Ÿ“‘ https://github.com/palkan/logidze/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž aasm is at 5.2.0
==> ๐Ÿ“… May 1, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/aasm
==> ๐Ÿ  https://github.com/aasm/aasm
==> ๐Ÿ”— https://github.com/aasm/aasm
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž lockbox is at 0.6.5
==> ๐Ÿ“… July 7, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/lockbox
==> ๐Ÿ  https://github.com/ankane/lockbox
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž factory_bot is at 6.2.0
==> ๐Ÿ“… May 7, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/factory_bot
==> ๐Ÿ  https://github.com/thoughtbot/factory_bot
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž globalize is at 6.0.1
==> ๐Ÿ“… June 23, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/globalize
==> ๐Ÿ  http://github.com/globalize/globalize
==> ๐Ÿ”— Unavailable
==> ๐Ÿ“‘ Unavailable
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž faraday is at 1.5.1
==> ๐Ÿ“… July 11, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/faraday
==> ๐Ÿ  https://lostisland.github.io/faraday
==> ๐Ÿ”— https://github.com/lostisland/faraday
==> ๐Ÿ“‘ https://github.com/lostisland/faraday/releases/tag/v1.5.1
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿงบ 3 of 3
=> ๐Ÿ”Ž faker, site_prism, nokogiri, simplecov
=> ๐Ÿ’Ž site_prism is at 3.7.1
==> ๐Ÿ“… February 19, 2021
==> ๐Ÿ’ผ BSD-3-Clause
==> ๐Ÿงญ https://rubygems.org/gems/site_prism
==> ๐Ÿ  https://github.com/site-prism/site_prism
==> ๐Ÿ”— https://github.com/site-prism/site_prism
==> ๐Ÿ“‘ https://github.com/site-prism/site_prism/blob/main/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž simplecov is at 0.21.2
==> ๐Ÿ“… January 9, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/simplecov
==> ๐Ÿ  https://github.com/simplecov-ruby/simplecov
==> ๐Ÿ”— https://github.com/simplecov-ruby/simplecov/tree/v0.21.2
==> ๐Ÿ“‘ https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md
==> ๐Ÿ’Œ https://groups.google.com/forum/#!forum/simplecov
=> ๐Ÿ’Ž faker is at 2.18.0
==> ๐Ÿ“… May 15, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/faker
==> ๐Ÿ  https://github.com/faker-ruby/faker
==> ๐Ÿ”— https://github.com/faker-ruby/faker
==> ๐Ÿ“‘ https://github.com/faker-ruby/faker/blob/master/CHANGELOG.md
==> ๐Ÿ’Œ Unavailable
=> ๐Ÿ’Ž nokogiri is at 1.11.7
==> ๐Ÿ“… June 3, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/nokogiri
==> ๐Ÿ  https://nokogiri.org
==> ๐Ÿ”— https://github.com/sparklemotion/nokogiri
==> ๐Ÿ“‘ https://nokogiri.org/CHANGELOG.html
==> ๐Ÿ’Œ Unavailable

Non-Existent Gems

If a gem isn't found, the output will be a little bit different: that particular line will be red. It's also important to know that not finding a gem doesn't block other gems from being looked up.

$ gems non-existent rails
=> ๐Ÿค” 2 gems
=> ๐Ÿ”Ž non-existent, rails
=> ๐Ÿ’Ž non-existent not found
=> ๐Ÿ’Ž rails is at 6.1.4
==> ๐Ÿ“… June 24, 2021
==> ๐Ÿ’ผ MIT
==> ๐Ÿงญ https://rubygems.org/gems/rails
==> ๐Ÿ  https://rubyonrails.org
==> ๐Ÿ”— https://github.com/rails/rails/tree/v6.1.4
==> ๐Ÿ“‘ https://github.com/rails/rails/releases/tag/v6.1.4
==> ๐Ÿ’Œ https://discuss.rubyonrails.org/c/rubyonrails-talk

Timing Out

If a gem lookup times out, the output will let you know.

$ gems rails
=> ๐Ÿ”Ž Looking up: rails
=> ๐Ÿ’Ž rails lookup timed out

Rate Limit

Please be aware there is a rate limit to be mindful of.

As of June 10th, 2021: API and website: 10 requests per second.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the gem_lookup.gem_spec file to rubygems.org.

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the GemLookup project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.