Module: DBus
- Defined in:
- lib/dbus.rb,
lib/dbus/bus.rb,
lib/dbus/xml.rb,
lib/dbus/auth.rb,
lib/dbus/type.rb,
lib/dbus/error.rb,
lib/dbus/export.rb,
lib/dbus/logger.rb,
lib/dbus/message.rb,
lib/dbus/marshall.rb,
lib/dbus/matchrule.rb,
lib/dbus/introspect.rb,
lib/dbus/api_options.rb,
lib/dbus/proxy_object.rb,
lib/dbus/message_queue.rb,
lib/dbus/proxy_object_factory.rb,
lib/dbus/proxy_object_interface.rb
Overview
This file is part of the ruby-dbus project Copyright © 2007 Arnaud Cornet and Paul van Tilburg Copyright © 2009-2014 Martin Vidner
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software Foundation. See the file “COPYING” for the exact licensing terms.
Defined Under Namespace
Modules: Type Classes: ASessionBus, ASystemBus, Anonymous, ApiOptions, AuthenticationFailed, Authenticator, Client, Connection, DBusCookieSHA1, Error, ErrorMessage, External, FormalParameter, IncompleteBufferException, Interface, InterfaceElement, IntrospectXMLParser, InvalidClassDefinition, InvalidDestinationName, InvalidIntrospectionData, InvalidMethodName, InvalidPacketException, Main, MatchRule, MatchRuleException, Message, MessageQueue, Method, MethodReturnMessage, Node, Object, PacketMarshaller, PacketUnmarshaller, ProxyObject, ProxyObjectFactory, ProxyObjectInterface, RemoteBus, Service, SessionBus, Signal, SystemBus, TypeException, UnknownSignal
Constant Summary collapse
- SystemSocketName =
Default socket name for the system bus.
"unix:path=/var/run/dbus/system_bus_socket".freeze
- BIG_END =
Byte signifying big endianness.
"B".freeze
- LIL_END =
Byte signifying little endianness.
"l".freeze
- HOST_END =
Byte signifying the host’s endianness.
if [0x01020304].pack("L").unpack("V")[0] == 0x01020304 LIL_END else BIG_END end
- METHOD_SIGNAL_RE =
Regular expressions that should match all method names.
/^[A-Za-z][A-Za-z0-9_]*$/
- INTERFACE_ELEMENT_RE =
Regular expressions that should match all interface names.
/^[A-Za-z][A-Za-z0-9_]*$/
Class Method Summary collapse
- .error(name = "org.freedesktop.DBus.Error.Failed") ⇒ Object
-
.logger ⇒ Object
Get the logger for the DBus module.
-
.logger=(logger) ⇒ Object
Set the logger for the DBus module.
-
.session_bus ⇒ Connection
Shortcut for the SessionBus instance.
-
.system_bus ⇒ Connection
Shortcut for the SystemBus instance.
-
.type(string_type) ⇒ Object
Parse a String to a DBus::Type::Type.
-
.variant(string_type, value) ⇒ Object
Make an explicit [Type, value] pair.
Class Method Details
.error(name = "org.freedesktop.DBus.Error.Failed") ⇒ Object
41 42 43 44 |
# File 'lib/dbus/error.rb', line 41 def error(name = "org.freedesktop.DBus.Error.Failed") # message will be set by Kernel.raise DBus::Error.new(nil, name) end |
.logger ⇒ Object
Get the logger for the DBus module. The default one logs to STDERR, with DEBUG if $DEBUG is set, otherwise INFO.
17 18 19 20 21 22 23 |
# File 'lib/dbus/logger.rb', line 17 def logger unless defined? @logger @logger = Logger.new(STDERR) @logger.level = $DEBUG ? Logger::DEBUG : Logger::INFO end @logger end |
.logger=(logger) ⇒ Object
Set the logger for the DBus module
27 28 29 |
# File 'lib/dbus/logger.rb', line 27 def logger=(logger) @logger = logger end |
.session_bus ⇒ Connection
Shortcut for the SessionBus instance
690 691 692 |
# File 'lib/dbus/bus.rb', line 690 def self.session_bus SessionBus.instance end |
.system_bus ⇒ Connection
Shortcut for the SystemBus instance
684 685 686 |
# File 'lib/dbus/bus.rb', line 684 def self.system_bus SystemBus.instance end |
.type(string_type) ⇒ Object
Parse a String to a DBus::Type::Type
181 182 183 |
# File 'lib/dbus/type.rb', line 181 def type(string_type) Type::Parser.new(string_type).parse[0] end |
.variant(string_type, value) ⇒ Object
Make an explicit [Type, value] pair
187 188 189 |
# File 'lib/dbus/type.rb', line 187 def variant(string_type, value) [type(string_type), value] end |