Class: WhatTheGem::Info

Inherits:
Command show all
Defined in:
lib/whatthegem/info.rb

Constant Summary collapse

TEMPLATE =

About info shortening: It is because minitest pastes their whole README there, including a quotations of how they are better than RSpec. (At the same time, RSpec’s info reads “BDD for Ruby”.)

Template.parse(<<~INFO)
            Latest version: {{info.version}} ({{age}})
        Installed versions: {% if specs %}{{ specs | map:"version" | join: ", "}}{% else %}—{% endif %}
  {% if current %}
  Most recent installed at: {{current.dir}}
  {% endif %}
  {% unless bundled.type == 'nobundle' %}
            In your bundle: {% if bundled.type == 'notbundled' %}—{% else
  %}{{ bundled.version }} at {{ bundled.dir }}{% endif %}
  {% endunless %}

  Try also:
  {% for command in commands %}
    `whatthegem {{info.name}} {{command.handle}}` -- {{command.description}}{% endfor %}
INFO

Constants inherited from Command

Command::HEADER_TEMPLATE

Instance Attribute Summary

Attributes inherited from Command

#gem

Instance Method Summary collapse

Methods inherited from Command

call, #call, get, #initialize, #meta, register

Constructor Details

This class inherits a constructor from WhatTheGem::Command

Instance Method Details

#localsObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/whatthegem/info.rb', line 25

def locals
  {
    info: gem.rubygems.info,
    age: age,
    specs: specs,
    current: specs.last,
    bundled: gem.bundled.to_h,
    commands: commands
  }
end