Sha256: 0b7dd7dba981756e332b04cf0b44e7777f8d4dfda1fbac67b055e6b61d19db34
Contents?: true
Size: 729 Bytes
Versions: 50
Compression:
Stored size: 729 Bytes
Contents
# frozen_string_literal: true require 'eac_templates/searcher' module EacTemplates 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::Searcher.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
Version data entries
50 entries across 50 versions & 3 rubygems