Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

em-ruby-dbus

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

em-ruby-dbus

  • 0.11.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ruby D-Bus (with EventMachine support)

Note

This fork works in the same way as original Ruby D-Bus bindings but it supports EventMachine.

You can bind it to the EM by calling #eventmachinize:

@connection = DBus::SessionBus.instance
@connection.eventmachinize

(Original README)

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.object "/org/freedesktop/UPower"
upower_object.introspect
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 1.9.3 or 2.0

Installation

  • gem install em-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.

FAQs

Package last updated on 05 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc