Git Product home page Git Product logo

ruby-dbus's Introduction

Ruby D-Bus

D-Bus is an interprocess communication mechanism for Linux. Ruby D-Bus is a pure Ruby library for writing clients and services for D-Bus.

Gem Version Build Status Dependency Status Code Climate Coverage Status

Example

Check whether the system is on battery power via UPower

require "dbus"
sysbus = DBus.system_bus
upower_service   = sysbus["org.freedesktop.UPower"]
upower_object    = upower_service["/org/freedesktop/UPower"]
upower_interface = upower_object["org.freedesktop.UPower"]
on_battery       = upower_interface["OnBattery"]
if on_battery
  puts "The computer IS on battery power."
else
  puts "The computer IS NOT on battery power."
end

Requirements

  • Ruby 2.4 or newer.

Installation

  • gem install ruby-dbus

Features

Ruby D-Bus currently supports the following features:

  • Connecting to local buses.
  • Accessing remote services, objects and interfaces.
  • Invoking methods on remote objects synchronously and asynchronously.
  • Catch signals on remote objects and handle them via callbacks.
  • Remote object introspection.
  • Walking object trees.
  • Creating services and registering them on the bus.
  • Exporting objects with interfaces on a bus for remote use.
  • Rubyish D-Bus object and interface syntax support that automatically allows for introspection.
  • Emitting signals on exported objects.

Usage

See some of the examples in the examples/ subdirectory of the tarball. Also, check out the included tutorial (in Markdown format) in doc/Tutorial.md or view it online on https://github.com/mvidner/ruby-dbus/blob/master/doc/Tutorial.md .

License

Ruby D-Bus is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.