ruby-dbus 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/NEWS.md +11 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/examples/gdbus/gdbus +1 -1
- data/lib/dbus.rb +0 -1
- data/lib/dbus/auth.rb +1 -1
- data/lib/dbus/bus.rb +1 -1
- data/lib/dbus/core_ext/class/attribute.rb +23 -41
- data/lib/dbus/core_ext/module/redefine_method.rb +51 -0
- data/lib/dbus/export.rb +2 -1
- data/lib/dbus/introspect.rb +2 -2
- data/lib/dbus/marshall.rb +1 -0
- data/lib/dbus/proxy_object.rb +3 -1
- data/lib/dbus/xml.rb +4 -8
- data/ruby-dbus.gemspec +2 -2
- data/spec/binding_spec.rb +6 -2
- data/spec/introspect_xml_parser_spec.rb +13 -13
- data/spec/proxy_object_spec.rb +9 -0
- data/spec/session_bus_spec.rb +6 -6
- data/spec/spec_helper.rb +5 -5
- data/spec/type_spec.rb +2 -2
- metadata +5 -7
- data/lib/dbus/core_ext/array/extract_options.rb +0 -31
- data/lib/dbus/core_ext/kernel/singleton_class.rb +0 -8
- data/lib/dbus/core_ext/module/remove_method.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e7540fb8468a14731fd8d988828dfe349e687a
|
4
|
+
data.tar.gz: 86dbf9d6e8c1947bb87ef4f1ef1a4aefa337f1f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9347931528a1e83c9b4747b232c3f6e9f8da3968efa7f5fe4a473d6333783a0643823973e91efb35f1c7676a6da0ee6a16eade4176842de6fb4e7aa58c6d5304
|
7
|
+
data.tar.gz: c814265c6472dc3b715a0f99ca5c6ea920d26a08dcde3eff573a889779320dc00292d637f976067ba3f6e5ae86cbccc099e56430adf8109147e910169f59e44a
|
data/NEWS.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## Ruby D-Bus 0.15.0 - 2018-04-30
|
6
|
+
|
7
|
+
API:
|
8
|
+
* Accessing an unknown interface will raise instead of returning nil ([#74]).
|
9
|
+
|
10
|
+
Bug fixes:
|
11
|
+
* Fixed a conflict with activesupport 5.2 ([#71])
|
12
|
+
|
13
|
+
[#71]: https://github.com/mvidner/ruby-dbus/issues/71
|
14
|
+
[#74]: https://github.com/mvidner/ruby-dbus/pull/74
|
15
|
+
|
5
16
|
## Ruby D-Bus 0.14.1 - 2018-01-05
|
6
17
|
|
7
18
|
Bug fixes:
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Ruby D-Bus is a pure Ruby library for writing clients and services for D-Bus.
|
|
18
18
|
[Coverage Status]: https://coveralls.io/r/mvidner/ruby-dbus
|
19
19
|
|
20
20
|
[GV img]: https://badge.fury.io/rb/ruby-dbus.png
|
21
|
-
[BS img]: https://travis-ci.org/mvidner/ruby-dbus.png
|
21
|
+
[BS img]: https://travis-ci.org/mvidner/ruby-dbus.png?branch=master
|
22
22
|
[DS img]: https://gemnasium.com/mvidner/ruby-dbus.png
|
23
23
|
[CC img]: https://codeclimate.com/github/mvidner/ruby-dbus.png
|
24
24
|
[CS img]: https://coveralls.io/repos/mvidner/ruby-dbus/badge.png?branch=master
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.15.0
|
data/examples/gdbus/gdbus
CHANGED
data/lib/dbus.rb
CHANGED
data/lib/dbus/auth.rb
CHANGED
@@ -73,7 +73,7 @@ module DBus
|
|
73
73
|
path = File.join(ENV["HOME"], ".dbus-keyrings", context)
|
74
74
|
DBus.logger.debug "path: #{path.inspect}"
|
75
75
|
File.foreach(path) do |line|
|
76
|
-
if line.index(id)
|
76
|
+
if line.index(id).zero?
|
77
77
|
# Right line of file, read cookie
|
78
78
|
cookie = line.split(" ")[2].chomp
|
79
79
|
DBus.logger.debug "cookie: #{cookie.inspect}"
|
data/lib/dbus/bus.rb
CHANGED
@@ -387,7 +387,7 @@ module DBus
|
|
387
387
|
# introspect in synchronous !
|
388
388
|
data = introspect_data(dest, path)
|
389
389
|
pof = DBus::ProxyObjectFactory.new(data, self, dest, path)
|
390
|
-
|
390
|
+
pof.build
|
391
391
|
else
|
392
392
|
introspect_data(dest, path) do |async_data|
|
393
393
|
yield(DBus::ProxyObjectFactory.new(async_data, self, dest, path).build)
|
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/
|
3
|
-
|
4
|
-
require
|
5
|
-
require 'dbus/core_ext/array/extract_options'
|
3
|
+
# https://github.com/rails/rails/tree/9794e85351243cac6d4e78adaba634b8e4ecad0a/activesupport/lib/active_support/core_ext
|
4
|
+
|
5
|
+
require "dbus/core_ext/module/redefine_method"
|
6
6
|
|
7
7
|
class Class
|
8
8
|
# Declare a class-level attribute whose value is inheritable by subclasses.
|
9
9
|
# Subclasses can change their own value and it will not impact parent class.
|
10
10
|
#
|
11
|
+
# ==== Examples
|
12
|
+
#
|
11
13
|
# class Base
|
12
|
-
#
|
14
|
+
# my_class_attribute :setting
|
13
15
|
# end
|
14
16
|
#
|
15
17
|
# class Subclass < Base
|
@@ -22,14 +24,14 @@ class Class
|
|
22
24
|
# Base.setting # => true
|
23
25
|
#
|
24
26
|
# In the above case as long as Subclass does not assign a value to setting
|
25
|
-
# by performing <tt>Subclass.setting = _something_
|
27
|
+
# by performing <tt>Subclass.setting = _something_</tt>, <tt>Subclass.setting</tt>
|
26
28
|
# would read value assigned to parent class. Once Subclass assigns a value then
|
27
29
|
# the value assigned by Subclass would be returned.
|
28
30
|
#
|
29
31
|
# This matches normal Ruby method inheritance: think of writing an attribute
|
30
32
|
# on a subclass as overriding the reader method. However, you need to be aware
|
31
33
|
# when using +class_attribute+ with mutable structures as +Array+ or +Hash+.
|
32
|
-
# In such cases, you don't want to do changes in
|
34
|
+
# In such cases, you don't want to do changes in place. Instead use setters:
|
33
35
|
#
|
34
36
|
# Base.setting = []
|
35
37
|
# Base.setting # => []
|
@@ -59,39 +61,25 @@ class Class
|
|
59
61
|
# object.setting = false
|
60
62
|
# object.setting # => false
|
61
63
|
# Base.setting # => true
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
# object.setting # => NoMethodError
|
66
|
-
# object.setting? # => NoMethodError
|
67
|
-
#
|
68
|
-
# To opt out of the instance writer method, pass <tt>instance_writer: false</tt>.
|
69
|
-
#
|
70
|
-
# object.setting = false # => NoMethodError
|
71
|
-
#
|
72
|
-
# To opt out of both instance methods, pass <tt>instance_accessor: false</tt>.
|
73
|
-
def class_attribute(*attrs)
|
74
|
-
options = attrs.extract_options!
|
75
|
-
instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true)
|
76
|
-
instance_writer = options.fetch(:instance_accessor, true) && options.fetch(:instance_writer, true)
|
77
|
-
instance_predicate = options.fetch(:instance_predicate, true)
|
64
|
+
def my_class_attribute(*attrs)
|
65
|
+
instance_reader = true
|
66
|
+
instance_writer = true
|
78
67
|
|
79
68
|
attrs.each do |name|
|
69
|
+
singleton_class.silence_redefinition_of_method(name)
|
80
70
|
define_singleton_method(name) { nil }
|
81
|
-
define_singleton_method("#{name}?") { !!public_send(name) } if instance_predicate
|
82
71
|
|
83
|
-
ivar = "@#{name}"
|
72
|
+
ivar = "@#{name}".to_sym
|
84
73
|
|
74
|
+
singleton_class.silence_redefinition_of_method("#{name}=")
|
85
75
|
define_singleton_method("#{name}=") do |val|
|
86
76
|
singleton_class.class_eval do
|
87
|
-
|
88
|
-
define_method(name) { val }
|
77
|
+
redefine_method(name) { val }
|
89
78
|
end
|
90
79
|
|
91
80
|
if singleton_class?
|
92
81
|
class_eval do
|
93
|
-
|
94
|
-
define_method(name) do
|
82
|
+
redefine_method(name) do
|
95
83
|
if instance_variable_defined? ivar
|
96
84
|
instance_variable_get ivar
|
97
85
|
else
|
@@ -104,26 +92,20 @@ class Class
|
|
104
92
|
end
|
105
93
|
|
106
94
|
if instance_reader
|
107
|
-
|
108
|
-
define_method(name) do
|
95
|
+
redefine_method(name) do
|
109
96
|
if instance_variable_defined?(ivar)
|
110
97
|
instance_variable_get ivar
|
111
98
|
else
|
112
99
|
self.class.public_send name
|
113
100
|
end
|
114
101
|
end
|
115
|
-
define_method("#{name}?") { !!public_send(name) } if instance_predicate
|
116
102
|
end
|
117
103
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
private
|
123
|
-
|
124
|
-
unless respond_to?(:singleton_class?)
|
125
|
-
def singleton_class?
|
126
|
-
ancestors.first != self
|
104
|
+
if instance_writer
|
105
|
+
redefine_method("#{name}=") do |val|
|
106
|
+
instance_variable_set ivar, val
|
107
|
+
end
|
127
108
|
end
|
128
109
|
end
|
110
|
+
end
|
129
111
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# copied from activesupport/core_ext from Rails, MIT license
|
3
|
+
# https://github.com/rails/rails/tree/a713fdae4eb4f7ccd34932edc61561a96b8d9f35/activesupport/lib/active_support/core_ext/module
|
4
|
+
|
5
|
+
class Module
|
6
|
+
if RUBY_VERSION >= "2.3"
|
7
|
+
# Marks the named method as intended to be redefined, if it exists.
|
8
|
+
# Suppresses the Ruby method redefinition warning. Prefer
|
9
|
+
# #redefine_method where possible.
|
10
|
+
def silence_redefinition_of_method(method)
|
11
|
+
if method_defined?(method) || private_method_defined?(method)
|
12
|
+
# This suppresses the "method redefined" warning; the self-alias
|
13
|
+
# looks odd, but means we don't need to generate a unique name
|
14
|
+
alias_method method, method
|
15
|
+
end
|
16
|
+
end
|
17
|
+
else
|
18
|
+
def silence_redefinition_of_method(method)
|
19
|
+
if method_defined?(method) || private_method_defined?(method)
|
20
|
+
alias_method :__rails_redefine, method
|
21
|
+
remove_method :__rails_redefine
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Replaces the existing method definition, if there is one, with the passed
|
27
|
+
# block as its body.
|
28
|
+
def redefine_method(method, &block)
|
29
|
+
visibility = method_visibility(method)
|
30
|
+
silence_redefinition_of_method(method)
|
31
|
+
define_method(method, &block)
|
32
|
+
send(visibility, method)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Replaces the existing singleton method definition, if there is one, with
|
36
|
+
# the passed block as its body.
|
37
|
+
def redefine_singleton_method(method, &block)
|
38
|
+
singleton_class.redefine_method(method, &block)
|
39
|
+
end
|
40
|
+
|
41
|
+
def method_visibility(method) # :nodoc:
|
42
|
+
case
|
43
|
+
when private_method_defined?(method)
|
44
|
+
:private
|
45
|
+
when protected_method_defined?(method)
|
46
|
+
:protected
|
47
|
+
else
|
48
|
+
:public
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/dbus/export.rb
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
# See the file "COPYING" for the exact licensing terms.
|
10
10
|
|
11
11
|
require "thread"
|
12
|
+
require "dbus/core_ext/class/attribute"
|
12
13
|
|
13
14
|
module DBus
|
14
15
|
# Exported object type
|
@@ -20,7 +21,7 @@ module DBus
|
|
20
21
|
# The path of the object.
|
21
22
|
attr_reader :path
|
22
23
|
# The interfaces that the object supports. Hash: String => Interface
|
23
|
-
|
24
|
+
my_class_attribute :intfs
|
24
25
|
self.intfs = {}
|
25
26
|
|
26
27
|
# The service that the object is exported by.
|
data/lib/dbus/introspect.rb
CHANGED
@@ -50,9 +50,9 @@ module DBus
|
|
50
50
|
raise InvalidIntrospectionData if name.bytesize > 255
|
51
51
|
raise InvalidIntrospectionData if name =~ /^\./ || name =~ /\.$/
|
52
52
|
raise InvalidIntrospectionData if name =~ /\.\./
|
53
|
-
raise InvalidIntrospectionData if
|
53
|
+
raise InvalidIntrospectionData if name !~ /\./
|
54
54
|
name.split(".").each do |element|
|
55
|
-
raise InvalidIntrospectionData if
|
55
|
+
raise InvalidIntrospectionData if element !~ INTERFACE_ELEMENT_RE
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
data/lib/dbus/marshall.rb
CHANGED
data/lib/dbus/proxy_object.rb
CHANGED
@@ -54,7 +54,9 @@ module DBus
|
|
54
54
|
# @return [ProxyObjectInterface]
|
55
55
|
def [](intfname)
|
56
56
|
introspect unless introspected
|
57
|
-
@interfaces[intfname]
|
57
|
+
ifc = @interfaces[intfname]
|
58
|
+
raise DBus::Error, "no such interface `#{intfname}' on object `#{@path}'" unless ifc
|
59
|
+
ifc
|
58
60
|
end
|
59
61
|
|
60
62
|
# Maps the given interface name _intfname_ to the given interface _intf.
|
data/lib/dbus/xml.rb
CHANGED
@@ -41,21 +41,17 @@ module DBus
|
|
41
41
|
|
42
42
|
# required methods
|
43
43
|
# returns node attribute value
|
44
|
-
def [](key)
|
45
|
-
end
|
44
|
+
def [](key); end
|
46
45
|
|
47
46
|
# yields child nodes which match xpath of type AbstractXML::Node
|
48
|
-
def each(xpath)
|
49
|
-
end
|
47
|
+
def each(xpath); end
|
50
48
|
end
|
51
49
|
# required methods
|
52
50
|
# initialize parser with xml string
|
53
|
-
def initialize(xml)
|
54
|
-
end
|
51
|
+
def initialize(xml); end
|
55
52
|
|
56
53
|
# yields nodes which match xpath of type AbstractXML::Node
|
57
|
-
def each(xpath)
|
58
|
-
end
|
54
|
+
def each(xpath); end
|
59
55
|
end
|
60
56
|
|
61
57
|
class NokogiriParser < AbstractXML
|
data/ruby-dbus.gemspec
CHANGED
@@ -9,8 +9,8 @@ GEMSPEC = Gem::Specification.new do |s|
|
|
9
9
|
s.version = File.read("VERSION").strip
|
10
10
|
s.license = "LGPL v2.1"
|
11
11
|
s.author = "Ruby DBus Team"
|
12
|
-
s.email = "
|
13
|
-
s.homepage = "https://
|
12
|
+
s.email = "martin.github@vidner.net"
|
13
|
+
s.homepage = "https://github.com/mvidner/ruby-dbus"
|
14
14
|
s.files = Dir[
|
15
15
|
"{doc,examples,lib,spec}/**/*",
|
16
16
|
"COPYING", "NEWS.md", "Rakefile", "README.md",
|
data/spec/binding_spec.rb
CHANGED
@@ -28,10 +28,14 @@ describe "BindingTest" do
|
|
28
28
|
# it should have its own interface
|
29
29
|
expect(test2["org.ruby.Test2"]).not_to be_nil
|
30
30
|
# but not an interface of the Test class
|
31
|
-
expect
|
31
|
+
expect { test2["org.ruby.SampleInterface"] }.to raise_error(DBus::Error) do |e|
|
32
|
+
expect(e.message).to match(/no such interface/)
|
33
|
+
end
|
32
34
|
|
33
35
|
# and the parent should not get polluted by the child
|
34
|
-
expect
|
36
|
+
expect { @base["org.ruby.Test2"] }.to raise_error(DBus::Error) do |e|
|
37
|
+
expect(e.message).to match(/no such interface/)
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
it "tests translating errors into exceptions" do
|
@@ -4,19 +4,19 @@ require "dbus"
|
|
4
4
|
|
5
5
|
describe "IntrospectXMLParserTest" do
|
6
6
|
it "tests split interfaces" do
|
7
|
-
xml =
|
8
|
-
<node>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
</node>
|
19
|
-
|
7
|
+
xml = <<-XML
|
8
|
+
<node>
|
9
|
+
<interface name="org.example.Foo">
|
10
|
+
<method name="Dwim"/>
|
11
|
+
</interface>
|
12
|
+
<interface name="org.example.Bar">
|
13
|
+
<method name="Drink"/>
|
14
|
+
</interface>
|
15
|
+
<interface name="org.example.Foo">
|
16
|
+
<method name="Smurf"/>
|
17
|
+
</interface>
|
18
|
+
</node>
|
19
|
+
XML
|
20
20
|
|
21
21
|
interfaces, _subnodes = DBus::IntrospectXMLParser.new(xml).parse
|
22
22
|
|
data/spec/proxy_object_spec.rb
CHANGED
@@ -38,5 +38,14 @@ describe DBus::ProxyObject do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
describe "#[]" do
|
43
|
+
it "raises when the interface is not found" do
|
44
|
+
obj = svc["/org/ruby/MyInstance"]
|
45
|
+
expect { obj["org.ruby.NoSuchInterface"] }.to raise_error(DBus::Error) do |e|
|
46
|
+
expect(e.message).to match(/no such interface/)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
41
50
|
end
|
42
51
|
end
|
data/spec/session_bus_spec.rb
CHANGED
@@ -37,31 +37,31 @@ describe DBus::ASessionBus do
|
|
37
37
|
|
38
38
|
context "when DBUS_SESSION_BUS_ADDRESS from file is surrounded by quotation marks" do
|
39
39
|
it "returns session bus address without single quotation marks" do
|
40
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
40
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
41
41
|
DBUS_SESSION_BUS_ADDRESS='#{dbus_session_bus_address}'
|
42
42
|
DBUS_SESSION_BUS_PID=12345
|
43
43
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
44
|
-
|
44
|
+
TEXT
|
45
45
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
46
46
|
end
|
47
47
|
|
48
48
|
it "returns session bus address without double quotation marks" do
|
49
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
49
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
50
50
|
DBUS_SESSION_BUS_ADDRESS="#{dbus_session_bus_address}"
|
51
51
|
DBUS_SESSION_BUS_PID=12345
|
52
52
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
53
|
-
|
53
|
+
TEXT
|
54
54
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
context "when DBUS_SESSION_BUS_ADDRESS from file is not surrounded by any quotation marks" do
|
59
59
|
it "returns session bus address as it is" do
|
60
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
60
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
61
61
|
DBUS_SESSION_BUS_ADDRESS=#{dbus_session_bus_address}
|
62
62
|
DBUS_SESSION_BUS_PID=12345
|
63
63
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
64
|
-
|
64
|
+
TEXT
|
65
65
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
66
66
|
end
|
67
67
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -92,11 +92,11 @@ def with_service_by_activation(&block)
|
|
92
92
|
FileUtils.mkdir_p service_dir
|
93
93
|
# file name actually does not need to match the service name
|
94
94
|
File.open("#{service_dir}/#{name}.service", "w") do |f|
|
95
|
-
s =
|
96
|
-
[D-BUS Service]
|
97
|
-
Name=#{name}
|
98
|
-
Exec=#{exec}
|
99
|
-
|
95
|
+
s = <<-TEXT.gsub(/^\s*/, "")
|
96
|
+
[D-BUS Service]
|
97
|
+
Name=#{name}
|
98
|
+
Exec=#{exec}
|
99
|
+
TEXT
|
100
100
|
f.write(s)
|
101
101
|
end
|
102
102
|
|
data/spec/type_spec.rb
CHANGED
@@ -4,13 +4,13 @@ require "dbus"
|
|
4
4
|
|
5
5
|
describe DBus do
|
6
6
|
describe ".type" do
|
7
|
-
|
7
|
+
["i", "ai", "a(ii)", "aai"].each do |s|
|
8
8
|
it "parses some type #{s}" do
|
9
9
|
expect(DBus.type(s).to_s).to be_eql s
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
["aa", "(ii", "ii)", "hrmp"].each do |s|
|
14
14
|
it "raises exception for invalid type #{s}" do
|
15
15
|
expect { DBus.type(s).to_s }.to raise_error DBus::Type::SignatureException
|
16
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-dbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruby DBus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Pure Ruby module for interaction with D-Bus IPC system
|
98
|
-
email:
|
98
|
+
email: martin.github@vidner.net
|
99
99
|
executables: []
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files: []
|
@@ -127,10 +127,8 @@ files:
|
|
127
127
|
- lib/dbus/api_options.rb
|
128
128
|
- lib/dbus/auth.rb
|
129
129
|
- lib/dbus/bus.rb
|
130
|
-
- lib/dbus/core_ext/array/extract_options.rb
|
131
130
|
- lib/dbus/core_ext/class/attribute.rb
|
132
|
-
- lib/dbus/core_ext/
|
133
|
-
- lib/dbus/core_ext/module/remove_method.rb
|
131
|
+
- lib/dbus/core_ext/module/redefine_method.rb
|
134
132
|
- lib/dbus/error.rb
|
135
133
|
- lib/dbus/export.rb
|
136
134
|
- lib/dbus/introspect.rb
|
@@ -172,7 +170,7 @@ files:
|
|
172
170
|
- spec/type_spec.rb
|
173
171
|
- spec/value_spec.rb
|
174
172
|
- spec/variant_spec.rb
|
175
|
-
homepage: https://
|
173
|
+
homepage: https://github.com/mvidner/ruby-dbus
|
176
174
|
licenses:
|
177
175
|
- LGPL v2.1
|
178
176
|
metadata: {}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
class Hash
|
4
|
-
# By default, only instances of Hash itself are extractable.
|
5
|
-
# Subclasses of Hash may implement this method and return
|
6
|
-
# true to declare themselves as extractable. If a Hash
|
7
|
-
# is extractable, Array#extract_options! pops it from
|
8
|
-
# the Array when it is the last element of the Array.
|
9
|
-
def extractable_options?
|
10
|
-
instance_of?(Hash)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Array
|
15
|
-
# Extracts options from a set of arguments. Removes and returns the last
|
16
|
-
# element in the array if it's a hash, otherwise returns a blank hash.
|
17
|
-
#
|
18
|
-
# def options(*args)
|
19
|
-
# args.extract_options!
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# options(1, 2) # => {}
|
23
|
-
# options(1, 2, a: :b) # => {:a=>:b}
|
24
|
-
def extract_options!
|
25
|
-
if last.is_a?(Hash) && last.extractable_options?
|
26
|
-
pop
|
27
|
-
else
|
28
|
-
{}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
module Kernel
|
4
|
-
# class_eval on an object acts like singleton_class.class_eval.
|
5
|
-
def class_eval(*args, &block)
|
6
|
-
singleton_class.class_eval(*args, &block)
|
7
|
-
end
|
8
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
class Module
|
4
|
-
def remove_possible_method(method)
|
5
|
-
if method_defined?(method) || private_method_defined?(method)
|
6
|
-
undef_method(method)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def redefine_method(method, &block)
|
11
|
-
remove_possible_method(method)
|
12
|
-
define_method(method, &block)
|
13
|
-
end
|
14
|
-
end
|