Sha256: 6904a58cd5a3ca525f43006b61753d60d189403202c29c60e81686d1371dacb3
Contents?: true
Size: 805 Bytes
Versions: 32
Compression:
Stored size: 805 Bytes
Contents
# frozen_string_literal: true require 'eac_templates/sources/set' module EacTemplates module Sources class FromGem class << self def include_all(searcher = nil) ::Gem::Specification.each { |gemspec| new(gemspec, searcher).include } end end TEMPLATES_DIR_SUBPATH = 'template' common_constructor :gemspec, :searcher, default: [nil] do self.searcher ||= ::EacTemplates::Sources::Set.default end # @return [Boolean] delegate :exist?, to: :path # @return [Pathname] def include return nil unless exist? searcher.included_paths << path path end # @return [Pathname] def path gemspec.gem_dir.to_pathname.join(TEMPLATES_DIR_SUBPATH) end end end end
Version data entries
32 entries across 32 versions & 2 rubygems