Class: EacRubyUtils::GemsRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/gems_registry.rb,
lib/eac_ruby_utils/gems_registry/gem.rb

Overview

Search in each gem for a class determined by registry and run the method “register” on each found.

Example:

  • The module suffix is ‘TheClass`;

  • A gem with name “my-lib” is being analyzed

  • If a require for “my/lib/the_class” is succesful the class/module ‘My::Lib::TheClass` will be collected.

Defined Under Namespace

Classes: Gem

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_suffix) ⇒ GemsRegistry

Returns a new instance of GemsRegistry.



18
19
20
# File 'lib/eac_ruby_utils/gems_registry.rb', line 18

def initialize(module_suffix)
  @module_suffix = module_suffix
end

Instance Attribute Details

#module_suffixObject (readonly)

Returns the value of attribute module_suffix.



16
17
18
# File 'lib/eac_ruby_utils/gems_registry.rb', line 16

def module_suffix
  @module_suffix
end

Instance Method Details

#registeredArray<EacRubyUtils::GemsRegistry::Gem>



23
24
25
# File 'lib/eac_ruby_utils/gems_registry.rb', line 23

def registered
  @registered ||= all_gems.select(&:found?).sort
end