Class: EacTemplates::Sources::FromGem

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_templates/sources/from_gem.rb

Constant Summary collapse

TEMPLATES_DIR_SUBPATH =
'template'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.include_all(searcher = nil) ⇒ Object



7
8
9
# File 'lib/eac_templates/sources/from_gem.rb', line 7

def include_all(searcher = nil)
  ::Gem::Specification.each { |gemspec| new(gemspec, searcher).include }
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


19
# File 'lib/eac_templates/sources/from_gem.rb', line 19

delegate :exist?, to: :path

#includePathname

Returns:

  • (Pathname)


22
23
24
25
26
27
# File 'lib/eac_templates/sources/from_gem.rb', line 22

def include
  return nil unless exist?

  searcher.included_paths << path
  path
end

#pathPathname

Returns:

  • (Pathname)


30
31
32
# File 'lib/eac_templates/sources/from_gem.rb', line 30

def path
  gemspec.gem_dir.to_pathname.join(TEMPLATES_DIR_SUBPATH)
end