dbus-systemd 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dbus/systemd/job.rb +6 -13
- data/lib/dbus/systemd/manager.rb +5 -14
- data/lib/dbus/systemd/method_missing.rb +17 -0
- data/lib/dbus/systemd/unit.rb +4 -13
- data/lib/dbus/systemd/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce47f2555fb63a896446215d069e982e755e4507
|
4
|
+
data.tar.gz: d3aed6968ac464e05efe15c39e6b1b6ece73f4cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e7ebc4b0cbe06f51c1d35082feb2048eaa0cda6b12e6630fce033100def55cff2d174e4a583afe491f149e75fae5dd688234fbfd9509406a76a7507702be763
|
7
|
+
data.tar.gz: 30ec8fa275efa5f47e91db25cf5cc8f81dbb5f385216ca941f386793142a73b2226bd8831816aa63d0416db3985bd9f2c88d53862a4a615674af3d1cbd5894b2
|
data/lib/dbus/systemd/job.rb
CHANGED
@@ -1,25 +1,18 @@
|
|
1
|
+
require_relative 'method_missing'
|
2
|
+
require_relative 'manager'
|
3
|
+
|
1
4
|
module DBus
|
2
5
|
module Systemd
|
3
6
|
class Job
|
4
7
|
INTERFACE = 'org.freedesktop.systemd1.Job'
|
5
8
|
|
6
|
-
|
9
|
+
include MethodMissing
|
10
|
+
|
11
|
+
def initialize(id, manager = Manager.new)
|
7
12
|
job_path = manager.object.GetJob(id).first
|
8
13
|
@object = manager.service.object(job_path)
|
9
14
|
.tap(&:introspect)
|
10
15
|
end
|
11
|
-
|
12
|
-
def method_missing(name, *args, &blk)
|
13
|
-
if @object.respond_to?(name)
|
14
|
-
@object.send(name, *args, &blk)
|
15
|
-
else
|
16
|
-
super
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def respond_to_missing?(*args)
|
21
|
-
@object.respond_to?(*args) || super
|
22
|
-
end
|
23
16
|
end
|
24
17
|
end
|
25
18
|
end
|
data/lib/dbus/systemd/manager.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require_relative 'method_missing'
|
1
2
|
require_relative '../systemd'
|
2
3
|
require_relative 'unit'
|
3
4
|
|
@@ -29,10 +30,12 @@ module DBus
|
|
29
30
|
unit_object_path: 5
|
30
31
|
}
|
31
32
|
|
33
|
+
include MethodMissing
|
34
|
+
|
32
35
|
attr_accessor :service, :object
|
33
36
|
|
34
|
-
def initialize(bus =
|
35
|
-
@service = bus.service(
|
37
|
+
def initialize(bus = Systemd.system_bus)
|
38
|
+
@service = bus.service(Systemd::INTERFACE)
|
36
39
|
@object = @service.object(OBJECT)
|
37
40
|
.tap(&:introspect)
|
38
41
|
end
|
@@ -80,18 +83,6 @@ module DBus
|
|
80
83
|
|
81
84
|
mapped
|
82
85
|
end
|
83
|
-
|
84
|
-
def method_missing(name, *args, &blk)
|
85
|
-
if @object.respond_to?(name)
|
86
|
-
@object.send(name, *args, &blk)
|
87
|
-
else
|
88
|
-
super
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def respond_to_missing?(*args)
|
93
|
-
@object.respond_to?(*args) || super
|
94
|
-
end
|
95
86
|
end
|
96
87
|
end
|
97
88
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DBus
|
2
|
+
module Systemd
|
3
|
+
module MethodMissing
|
4
|
+
def method_missing(name, *args, &blk)
|
5
|
+
if @object.respond_to?(name)
|
6
|
+
@object.send(name, *args, &blk)
|
7
|
+
else
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def respond_to_missing?(*args)
|
13
|
+
@object.respond_to?(*args) || super
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/dbus/systemd/unit.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require_relative 'method_missing'
|
1
2
|
require_relative 'manager'
|
2
3
|
|
3
4
|
module DBus
|
@@ -5,25 +6,15 @@ module DBus
|
|
5
6
|
class Unit
|
6
7
|
INTERFACE = 'org.freedesktop.systemd1.Unit'
|
7
8
|
|
9
|
+
include MethodMissing
|
10
|
+
|
8
11
|
attr_accessor :object
|
9
12
|
|
10
|
-
def initialize(name, manager =
|
13
|
+
def initialize(name, manager = Manager.new)
|
11
14
|
unit_path = manager.object.GetUnit(name).first
|
12
15
|
@object = manager.service.object(unit_path)
|
13
16
|
.tap(&:introspect)
|
14
17
|
end
|
15
|
-
|
16
|
-
def method_missing(name, *args, &blk)
|
17
|
-
if @object.respond_to?(name)
|
18
|
-
@object.send(name, *args, &blk)
|
19
|
-
else
|
20
|
-
super
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def respond_to_missing?(*args)
|
25
|
-
@object.respond_to?(*args) || super
|
26
|
-
end
|
27
18
|
end
|
28
19
|
end
|
29
20
|
end
|
data/lib/dbus/systemd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbus-systemd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Williams
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/dbus/systemd.rb
|
88
88
|
- lib/dbus/systemd/job.rb
|
89
89
|
- lib/dbus/systemd/manager.rb
|
90
|
+
- lib/dbus/systemd/method_missing.rb
|
90
91
|
- lib/dbus/systemd/unit.rb
|
91
92
|
- lib/dbus/systemd/unit/automount.rb
|
92
93
|
- lib/dbus/systemd/unit/device.rb
|