class EacRubyUtils::GemsRegistry
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.
Attributes
module_suffix[R]
Public Class Methods
new(module_suffix)
click to toggle source
# File lib/eac_ruby_utils/gems_registry.rb, line 18 def initialize(module_suffix) @module_suffix = module_suffix end
Public Instance Methods
registered()
click to toggle source
@return [Array<EacRubyUtils::GemsRegistry::Gem>]
# File lib/eac_ruby_utils/gems_registry.rb, line 23 def registered @registered ||= all_gems.select(&:found?) end
Private Instance Methods
all_gems()
click to toggle source
@return [Array<EacRubyUtils::GemsRegistry::Gem>]
# File lib/eac_ruby_utils/gems_registry.rb, line 30 def all_gems ::Gem::Specification.map { |gemspec| ::EacRubyUtils::GemsRegistry::Gem.new(self, gemspec) } .sort end