trueheart78 / gem_lookup

Looks up gems using the public RubyGems API.
MIT License
2 stars 0 forks source link

Support a dependencies flag. #16

Open trueheart78 opened 3 years ago

trueheart78 commented 3 years ago

Just show the runtime dependencies. They are listed in the JSON under dependencies: { runtime: [ ] }, so a hash with runtime as the key, and it is an array that can be empty or have content.

Example:

"dependencies": {
  "runtime": [
    {
      "name": "colorize",
      "requirements": "~> 0.8.1"
    },
    {
      "name": "typhoeus",
      "requirements": "~> 1.4"
    },
    {
      "name": "zeitwerk",
      "requirements": "~> 2.4.2"
    }
  ]

As for the flag, probably -d / --dependencies.

Now, how to output them... that's the question. I suspect we would add them to the end of the output per gem, and then just do indented newlines with the name and requirementsexample:

Example:

🗃   colorize, '~> 0.8.1'
     typhoeus, '~> 1.4'
     zeitwerk, '~> 2.4.2'

The emoji could be 🗃️ [Emojipedia Link]. It may need to be repeated if separate lines are used, otherwise spacing could be an issue. Will play that by ear.

trueheart78 commented 3 years ago

Emoji Ideas

Reminders

  1. Check the emoji support in iTerm, Kitty, and the Terminal app. They all need to be single-spaced, NOT double-wide.
  2. Check it using light and dark backgrounds.