Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby bindings for Augeas
Ruby C
Failed to load latest commit information.
ext/augeas Expose changes in Augeas 1.0.0 release
lib
tests Expose changes in Augeas 1.0.0 release
.gitignore * .gitignore: ignore build files
.travis.yml Add Travis CI settings
AUTHORS Prepare NEWS, AUTHORS and Rakefile for 0.5.0
COPYING
NEWS * NEWS: correct date for 0.5.0 release
README.rdoc * README.rdoc: better examples
Rakefile Prepare NEWS, AUTHORS and Rakefile for 0.5.0
ruby-augeas.spec * ext/augeas/extconf.rb: add libxml2 headers and library to Makefile

README.rdoc

Ruby bindings for augeas

The class Augeas provides bindings to augeas [augeas.net] library.

Usage: Setting Data

Augeas::open do |aug|
  aug.set("/files/etc/sysconfig/firstboot/RUN_FIRSTBOOT", "YES")
  unless aug.save
    raise IOError, "Failed to save changes"
  end
end

Usage: Accessing Data

firstboot = Augeas::open { |aug| aug.get("/files/etc/sysconfig/firstboot/RUN_FIRSTBOOT") }

Usage: Removing Data

Augeas::open do |aug|
  aug.rm("/files/etc/sysconfig/firstboot/RUN_FIRSTBOOT")
  unless aug.save
    raise IOError, "Failed to save changes"
  end
end

Usage: Minimal Setup with a Custom Root

By passing NO_MODL_AUTOLOAD, no files are read on startup; that allows setting up a custom transform.

Augeas::open("/var/tmp/augeas-root", "/usr/local/share/mylenses",
              Augeas::NO_MODL_AUTOLOAD) do |aug|
  aug.transform(:lens => "Aliases.lns", :incl => "/etc/aliases")
  aug.load
  aug.get("/files/etc/aliases/*[name = 'postmaster']/value")
end
Something went wrong with that request. Please try again.