0.0
No commit activity in last 3 years
No release in over 3 years
Access Libvirt's C Library through ruby bindings defined on the fly!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
> 2.5.0

Runtime

> 1.0.0
 Project Readme

Libvirt::Ruby

Gem Version Build Status Dependency Status Coverage Status Code Climate

Installation

Add this line to your application's Gemfile:

gem 'libvirt-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install libvirt-ruby

Dependencies

This gem has as a dependency the libvirt package. Google it and u will find how to install it on your distro.

Usage

You may define pointers, callbacks and enums using the FFI gem. Since the main module of this gem extend it, you can call directly on it, just like:

Libvirt::Base.new.typedef :pointer, :pointer
Libvirt::Base.new.callback :virFreeCallback, [:pointer], :void
Libvirt::Base.new.enum :virStorageVolType, [:file, :block]

You should call the c function directly with the same name to attach it to the module:

Libvirt::Base.new.virConnectClose([:int])

The only parameter of the function should be an array passing as arguments all the variables that the c function needs and the return of the C function. After call the first time to attach, you can call the method on Libvirt::Ruby, passing this time the real values if needed.

Libvirt::Base.new.virConnectClose

Migrating to 2.0

To make easy developing on libvirt-ruby-mapping, the module ruby was changed to a class. And a class can't be named ruby, so it is necessary to replace all your calls from Libvirt::Ruby to Libvirt::Base.new.

Mantainers

@plribeiro3000

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request