Class Augeas
In: lib/augeas.rb
Parent: Object

Wrapper class for the augeas library.

Methods

clear   clear_transforms   load!   open   save!   set   set!   transform  

Classes and Modules

Class Augeas::Error

Public Class methods

Create a new Augeas instance and return it.

Use root as the filesystem root. If root is nil, use the value of the environment variable AUGEAS_ROOT. If that doesn‘t exist either, use "/".

loadpath is a colon-spearated list of directories that modules should be searched in. This is in addition to the standard load path and the directories in AUGEAS_LENS_LIB

flags is a bitmask (see enum aug_flags)

When a block is given, the Augeas instance is passed as the only argument into the block and closed when the block exits. In that case, the return value of the block is the return value of open. With no block, the Augeas instance is returned.

Public Instance methods

Clear the path, i.e. make its value nil

Clear all transforms under /augeas/load. If load is called right after this, there will be no files under +/files+

The same as load, but raises Augeas::Error if loading fails

The same as save, but raises Augeas::Error if saving fails

Set one or multiple elemens to path. Multiple elements are mainly sensible with a path like …/array[last()+1], since this will append all elements.

The same as set, but raises Augeas::Error if setting fails

Add a transform under /augeas/load

The HASH can contain the following entries

  • :lens - the name of the lens to use
  • :name - a unique name; use the module name of the LENS when omitted
  • :incl - a list of glob patterns for the files to transform
  • :excl - a list of the glob patterns to remove from the list that matches :INCL

[Validate]