lib/cfa/augeas_parser/writer.rb
# Adds new subtree. Simplified version of common write as it is known
# that all entries will be just added.
# @param tree [CFA::AugeasTree] to add
# @param prefix [String] prefix where to place *tree*
Adds new subtree. Simplified version of common write as it is known
that all entries will be just added.
Adds new subtree . Simplified version of common write as it is known that all entries will be just added .
def add_subtree(tree, prefix)
        tree.all_data.each do |entry|
          located_entry = LocatedEntry.new(tree, entry, prefix)
          path = "#{prefix}/#{located_entry.key}[last()+1]"
          set_new_value(path, located_entry)
        end
      end
def add_subtree ( tree , prefix ) tree . all_data . each do | entry | located_entry = LocatedEntry . new ( tree , entry , prefix ) path = "#{prefix}/#{located_entry.key}[last()+1]" set_new_value ( path , located_entry ) end end
Adds new subtree.
Adds new subtree .
# universal path that handles also new elements for arrays
tree
None
prefix
prefix where to place *tree
prefix where to place * tree