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, #to_s, #type, #type_list
Instance Method Details
#apply(variables_source, target_path) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/eac_templates/modules/base/directory.rb', line 14
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
|
26
|
# File 'lib/eac_templates/modules/base/directory.rb', line 26
delegate :build_child, to: :owner
|
#children_basenames ⇒ Hash<Pathname, Symbol>
29
30
31
32
33
|
# File 'lib/eac_templates/modules/base/directory.rb', line 29
def children_basenames
owner.ancestors.select(&:directory?).each_with_object({}) do |e, a|
ancestor_children_names(e, a)
end
end
|
#found? ⇒ Boolean
36
37
38
|
# File 'lib/eac_templates/modules/base/directory.rb', line 36
def found?
children.any?
end
|