Class: GemsBond::Spy::One

Inherits:
Object
  • Object
show all
Defined in:
lib/gems_bond/spy/one.rb

Overview

Inspects gem and outputs the result in terminal

Constant Summary collapse

PRELOAD_KEYS =
%i[
  contributors_count
  days_since_last_commit
  days_since_last_version
  downloads_count
  forks_count
  source_code_uri
  stars_count
  versions
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ GemsBond::Spy::One

Initializes an instance

Parameters:

  • name (String)


24
25
26
# File 'lib/gems_bond/spy/one.rb', line 24

def initialize(name)
  @name = name
end

Instance Method Details

#callvoid

This method returns an undefined value.

Fetches gem then prints information



30
31
32
33
34
35
36
37
# File 'lib/gems_bond/spy/one.rb', line 30

def call
  if gem.exist?
    gem.prepare_data(keys: PRELOAD_KEYS, concurrency: false)
    GemsBond::Printers::Stdout.new(gem).call
  else
    puts "Sorry, this gem could not be found!"
  end
end