class Augeas
- Augeas
- Reference
- Object
Overview
This is the main Augeas class, the entrypoint to all Augeas operations
Defined in:
augeas.crConstant Summary
-
VERSION =
"0.1.0"
Constructors
-
.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™
Instance Method Summary
-
#check_aug_error
Check error on augeas C struct
-
#finalize
Close Augeas C Struct (to free everything related to it)
-
#flags : UInt32
Augeas control flags specified on the
.new
-
#load_file(path : String)
Load a file into the Augeas tree
-
#loadpath : String?
Load path for augeas lens specified on the `.new
-
#root : String
Root specified on the
.new
-
#save
Save all changes in the augeas tree to the respective files ps: Only modified files are written
-
#to_unsafe : Pointer(LibAugeas::Augeas)
Pointer to C Struct
Constructor Detail
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)
Instance Method Detail
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
Load a file into the Augeas tree
load_file("/path/to/my-config-file")
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