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.