module EacRubyUtils::GemsRegistry::Gem::PathsToRequire
def absolute_require_paths(lib_relative_path)
-
(Enumerable
-)
def absolute_require_paths(lib_relative_path) gemspec.require_paths.lazy.map do |e| ::Pathname.new(e).expand_path(gemspec.gem_dir) .join("#{lib_relative_path}.rb") end end
def direct_path_to_require
-
(String)
-
def direct_path_to_require "#{root_module_path_to_require}/#{registry.module_suffix.underscore}" end
def path_to_require
-
(String)
-
def path_to_require require_root_module? ? root_module_path_to_require : direct_path_to_require end
def require_root_module?
-
(Boolean)
-
def require_root_module? absolute_require_paths(root_module_path_to_require).find do |e| next false unless e.file? content = e.read ROOT_MODULE_REQUIRE_PATTERNS.any? { |e| content.include?(e) } end end
def root_module_path_to_require
-
(String)
-
def root_module_path_to_require gemspec.name.gsub('-', '/') end
def to_s
-
(String)
-
def to_s "#{self.class.name}[#{gemspec.name}]" end