Class: GemsBond::Spy::One
- Inherits:
-
Object
- Object
- GemsBond::Spy::One
- 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
-
#call ⇒ void
Fetches gem then prints information.
-
#initialize(name) ⇒ GemsBond::Spy::One
constructor
Initializes an instance.
Constructor Details
#initialize(name) ⇒ GemsBond::Spy::One
Initializes an instance
24 25 26 |
# File 'lib/gems_bond/spy/one.rb', line 24 def initialize(name) @name = name end |
Instance Method Details
#call ⇒ void
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 |