class Augeas

Overview

This is the main Augeas class, the entrypoint to all Augeas operations

Defined in:

augeas.cr

Constant Summary

VERSION = "0.1.0"

Constructors

Instance Method Summary

Constructor Detail

def self.new(root : String, loadpath : String? = nil, flags : UInt32 = 0) #

Initiale the class specifying your root, the lens loadpath and any flags Right now we are only forwaring the flags to LibAugeas, maybe in the future we can handle it more the crystal way™

Augeas.new(root: "/path/to/root", loadpath: "/path/to/leans", flags: 2)

[View source]

Instance Method Detail

def check_aug_error #

Check error on augeas C struct

The main idea is to keep here all possible errors that can happen

Initially check augeas for an error, if not returns true, otherwise Fetch the error_message, error_minor_message and error_details

After that checks the error_message against known values, if any is found method raises an an exception passing error details as its message


[View source]
def finalize #

Close Augeas C Struct (to free everything related to it)


[View source]
def flags : UInt32 #

Augeas control flags specified on the .new


[View source]
def load_file(path : String) #

Load a file into the Augeas tree

load_file("/path/to/my-config-file")

[View source]
def loadpath : String? #

Load path for augeas lens specified on the `.new


[View source]
def root : String #

Root specified on the .new


[View source]
def save #

Save all changes in the augeas tree to the respective files ps: Only modified files are written

tip: Do not forget to call this method after performing changes


[View source]
def to_unsafe : Pointer(LibAugeas::Augeas) #

Pointer to C Struct


[View source]