dbus-systemd 0.1.0 → 0.2.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/.gitignore +1 -0
- data/README.md +8 -4
- data/lib/dbus/systemd/job.rb +6 -1
- data/lib/dbus/systemd/manager.rb +8 -2
- data/lib/dbus/systemd/unit.rb +6 -1
- data/lib/dbus/systemd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86b09b232eb8227a3e939d3c077a52b7afa52e6b
|
4
|
+
data.tar.gz: 7b4e6154f9f0a876baecf9d949f319e7f93efb58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fc7fffe7050ba5820d2a7302ac37225141812ab28e215c22c82caa995f7605a2b63fa4fd0c23ac542939e711246e57c31597ddcfc9ff011e1135ec9dea85024
|
7
|
+
data.tar.gz: f1a241c43b86de4358d621418ead40c76609d24ed040084cc9982ce534e4c0475e8823a621381c0b1b4ccefd119390ae3510db639ba297fabfb16d75d777ccdd
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Dbus::Systemd
|
2
2
|
|
3
|
-
|
3
|
+
Ruby library for simplifying access to systemd dbus interfaces.
|
4
4
|
|
5
|
-
|
5
|
+
Recommended Reading
|
6
|
+
|
7
|
+
- [systemd D-Bus specification](https://www.freedesktop.org/wiki/Software/systemd/dbus/)
|
8
|
+
- [D-Bus specification](https://dbus.freedesktop.org/doc/dbus-specification.html)
|
6
9
|
|
7
10
|
## Installation
|
8
11
|
|
@@ -22,7 +25,7 @@ Or install it yourself as:
|
|
22
25
|
|
23
26
|
## Usage
|
24
27
|
|
25
|
-
|
28
|
+
|
26
29
|
|
27
30
|
## Development
|
28
31
|
|
@@ -30,11 +33,12 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
30
33
|
|
31
34
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
35
|
|
36
|
+
A Vagrantfile is provided in the VCS root that creates a Fedora vagrant box, with which library can be tested and D-Bus interfaces explored.
|
37
|
+
|
33
38
|
## Contributing
|
34
39
|
|
35
40
|
Bug reports and pull requests are welcome on GitHub at https://github.com/nathwill/ruby-dbus-systemd.
|
36
41
|
|
37
|
-
|
38
42
|
## License
|
39
43
|
|
40
44
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/dbus/systemd/job.rb
CHANGED
@@ -5,7 +5,12 @@ module DBus
|
|
5
5
|
|
6
6
|
def initialize(id, manager = DBus::Systemd::Manager.new)
|
7
7
|
job_path = manager.object.GetJob(id).first
|
8
|
-
@object = manager.service.object(job_path)
|
8
|
+
@object = manager.service.object(job_path)
|
9
|
+
.tap(&:introspect)
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing(name, *args, &blk)
|
13
|
+
@object.send(name, *args, &blk) if @object.respond_to?(name)
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
data/lib/dbus/systemd/manager.rb
CHANGED
@@ -46,7 +46,8 @@ module DBus
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def get_unit_by_object_path(path)
|
49
|
-
obj = @service.object(path)
|
49
|
+
obj = @service.object(path)
|
50
|
+
.tap(&:introspect)
|
50
51
|
Unit.new(obj.Get(Unit::INTERFACE, 'Id').first, self)
|
51
52
|
end
|
52
53
|
|
@@ -65,7 +66,8 @@ module DBus
|
|
65
66
|
end
|
66
67
|
|
67
68
|
def get_job_by_object_path(path)
|
68
|
-
obj = @service.object(path)
|
69
|
+
obj = @service.object(path)
|
70
|
+
.tap(&:introspect)
|
69
71
|
Job.new(obj.Get(Job::INTERFACE, 'Id').first, self)
|
70
72
|
end
|
71
73
|
|
@@ -78,6 +80,10 @@ module DBus
|
|
78
80
|
|
79
81
|
mapped
|
80
82
|
end
|
83
|
+
|
84
|
+
def method_missing(name, *args, &blk)
|
85
|
+
@object.send(name, *args, &blk) if @object.respond_to?(name)
|
86
|
+
end
|
81
87
|
end
|
82
88
|
end
|
83
89
|
end
|
data/lib/dbus/systemd/unit.rb
CHANGED
@@ -9,7 +9,12 @@ module DBus
|
|
9
9
|
|
10
10
|
def initialize(name, manager = DBus::Systemd::Manager.new)
|
11
11
|
unit_path = manager.object.GetUnit(name).first
|
12
|
-
@object = manager.service.object(unit_path)
|
12
|
+
@object = manager.service.object(unit_path)
|
13
|
+
.tap(&:introspect)
|
14
|
+
end
|
15
|
+
|
16
|
+
def method_missing(name, *args, &blk)
|
17
|
+
@object.send(name, *args, &blk) if @object.respond_to?(name)
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
data/lib/dbus/systemd/version.rb
CHANGED