Class: EacTemplates::Modules::Base::Directory
Instance Method Summary
collapse
Methods included from FsObject
#self_ancestor
#child, #children
#applier, #applier_class, assert, by_subpath, #category_module, #path_for_search, #path_for_search_prefix, #raise_not_found, #source_set, #type, #type_list
Instance Method Details
#apply(variables_source, target_path) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/eac_templates/modules/base/directory.rb', line 18
def apply(variables_source, target_path)
target_path = target_path.to_pathname
target_path.mkpath
children.each do |child|
child_apply(child, variables_source, target_path.join(child.basename))
end
end
|
30
|
# File 'lib/eac_templates/modules/base/directory.rb', line 30
delegate :build_child, to: :owner
|
#children_basenames ⇒ Hash<Pathname, Symbol>
33
34
35
36
37
|
# File 'lib/eac_templates/modules/base/directory.rb', line 33
def children_basenames
owner.ancestors.select(&:directory?).each_with_object({}) do |e, a|
ancestor_children_names(e, a)
end
end
|
#found? ⇒ Boolean
40
41
42
|
# File 'lib/eac_templates/modules/base/directory.rb', line 40
def found?
children.any?
end
|