ruby-dbus 0.11.1 → 0.11.2
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 +8 -0
- data/VERSION +1 -1
- data/lib/dbus/bus.rb +2 -1
- data/spec/session_bus_spec.rb +70 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12bb637315162a316a583bcbd48c77eb7904fdc1
|
|
4
|
+
data.tar.gz: 93baea47e50c7f48fad776508949dea27ab9c6e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fc62a23577d52c11d8496090e9740e09a8be730ac115e08796568eb055c4282ddba09dafb66527272d25e7f8a50fd8f447a9876df377691b23e364a9c230b07
|
|
7
|
+
data.tar.gz: 41d4b093c212b6e5854060dd314274ef7847db14c3cb287f7e35e6703a090ab77d5c9bda1b3061da26c6a8d89c461642815a95e74a7f0862d27a34a198680585
|
data/NEWS
CHANGED
|
@@ -5,6 +5,14 @@ Note about bug numbers:
|
|
|
5
5
|
Issue#1 - http://github.com/mvidner/ruby-dbus/issues#issue/1
|
|
6
6
|
bnc#1 - https://bugzilla.novell.com/show_bug.cgi?id=1
|
|
7
7
|
|
|
8
|
+
== Unreleased
|
|
9
|
+
|
|
10
|
+
== Ruby D-Bus 0.11.2 - 2016-09-11
|
|
11
|
+
|
|
12
|
+
Bug fixes:
|
|
13
|
+
* Fixed reading a quoted session bus address, as written by dbus-1.10.10
|
|
14
|
+
(Yasuhiro Asaka)
|
|
15
|
+
|
|
8
16
|
== Ruby D-Bus 0.11.1 - 2016-05-12
|
|
9
17
|
|
|
10
18
|
Bug fixes:
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.11.
|
|
1
|
+
0.11.2
|
data/lib/dbus/bus.rb
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env rspec
|
|
2
|
+
require_relative "spec_helper"
|
|
3
|
+
require "dbus"
|
|
4
|
+
|
|
5
|
+
describe DBus::ASessionBus do
|
|
6
|
+
subject(:dbus_session_bus_address) { "unix:abstract=/tmp/dbus-foo,guid=123" }
|
|
7
|
+
|
|
8
|
+
describe "#session_bus_address" do
|
|
9
|
+
around(:each) do |example|
|
|
10
|
+
@original_dbus_session_bus_address = ENV["DBUS_SESSION_BUS_ADDRESS"]
|
|
11
|
+
example.call
|
|
12
|
+
ENV["DBUS_SESSION_BUS_ADDRESS"] = @original_dbus_session_bus_address
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "returns DBUS_SESSION_BUS_ADDRESS as it is" do
|
|
16
|
+
ENV["DBUS_SESSION_BUS_ADDRESS"] = dbus_session_bus_address
|
|
17
|
+
expect(DBus::ASessionBus.session_bus_address).to eq(dbus_session_bus_address)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe "#address_from_file" do
|
|
22
|
+
let(:session_bus_file_path) { /\.dbus\/session-bus\/baz-\d/ }
|
|
23
|
+
|
|
24
|
+
before do
|
|
25
|
+
# mocks of files for address_from_file method
|
|
26
|
+
machine_id_path = File.expand_path("/etc/machine-id", __FILE__)
|
|
27
|
+
expect(Dir).to receive(:[]).with(any_args) {[machine_id_path] }
|
|
28
|
+
expect(File).to receive(:read).with(machine_id_path) { "baz" }
|
|
29
|
+
expect(File).to receive(:exists?).with(session_bus_file_path) { true }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
around(:each) do |example|
|
|
33
|
+
with_env("DISPLAY", ":0.0") do
|
|
34
|
+
example.call
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
context "when DBUS_SESSION_BUS_ADDRESS from file is surrounded by quotation marks" do
|
|
39
|
+
|
|
40
|
+
it "returns session bus address without single quotation marks" do
|
|
41
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-EOS.gsub(/^\s*/, '') }
|
|
42
|
+
DBUS_SESSION_BUS_ADDRESS='#{dbus_session_bus_address}'
|
|
43
|
+
DBUS_SESSION_BUS_PID=12345
|
|
44
|
+
DBUS_SESSION_BUS_WINDOWID=12345678
|
|
45
|
+
EOS
|
|
46
|
+
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "returns session bus address without double quotation marks" do
|
|
50
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-EOS.gsub(/^\s*/, '') }
|
|
51
|
+
DBUS_SESSION_BUS_ADDRESS="#{dbus_session_bus_address}"
|
|
52
|
+
DBUS_SESSION_BUS_PID=12345
|
|
53
|
+
DBUS_SESSION_BUS_WINDOWID=12345678
|
|
54
|
+
EOS
|
|
55
|
+
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
context "when DBUS_SESSION_BUS_ADDRESS from file is not surrounded by any quotation marks" do
|
|
60
|
+
it "returns session bus address as it is" do
|
|
61
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-EOS.gsub(/^\s*/, '') }
|
|
62
|
+
DBUS_SESSION_BUS_ADDRESS=#{dbus_session_bus_address}
|
|
63
|
+
DBUS_SESSION_BUS_PID=12345
|
|
64
|
+
DBUS_SESSION_BUS_WINDOWID=12345678
|
|
65
|
+
EOS
|
|
66
|
+
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
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.11.
|
|
4
|
+
version: 0.11.2
|
|
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: 2016-
|
|
11
|
+
date: 2016-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: packaging_rake_tasks
|
|
@@ -101,6 +101,7 @@ files:
|
|
|
101
101
|
- spec/server_robustness_spec.rb
|
|
102
102
|
- spec/server_spec.rb
|
|
103
103
|
- spec/service_newapi.rb
|
|
104
|
+
- spec/session_bus_spec.rb
|
|
104
105
|
- spec/session_bus_spec_manual.rb
|
|
105
106
|
- spec/signal_spec.rb
|
|
106
107
|
- spec/spec_helper.rb
|