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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d01a076408322792817a9e2ff8ddd8fa96d496e0
4
- data.tar.gz: 11bf0f355333ce064e592b4371c1febd9a21c1c0
3
+ metadata.gz: ce47f2555fb63a896446215d069e982e755e4507
4
+ data.tar.gz: d3aed6968ac464e05efe15c39e6b1b6ece73f4cf
5
5
  SHA512:
6
- metadata.gz: 5a1bdbeea1d77d6ae31b48f8dd5d5a115586fc32babe29328183951a17eaafdf552ff37a0fd3b234064938a2fab382269ee39eb05c255ba43f3c7f5bb60d9cc6
7
- data.tar.gz: 776ba744c62c05706161a81a5087dfa1e6d8157d2f35536db7a0208516d9d2dab356dab5432bf70c17d12f521647ee149df455b7ac902b13a2dc6aa1bfe9c12a
6
+ metadata.gz: 7e7ebc4b0cbe06f51c1d35082feb2048eaa0cda6b12e6630fce033100def55cff2d174e4a583afe491f149e75fae5dd688234fbfd9509406a76a7507702be763
7
+ data.tar.gz: 30ec8fa275efa5f47e91db25cf5cc8f81dbb5f385216ca941f386793142a73b2226bd8831816aa63d0416db3985bd9f2c88d53862a4a615674af3d1cbd5894b2
@@ -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
- def initialize(id, manager = DBus::Systemd::Manager.new)
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
@@ -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 = DBus::Systemd.system_bus)
35
- @service = bus.service(DBus::Systemd::INTERFACE)
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
@@ -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 = DBus::Systemd::Manager.new)
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
@@ -1,5 +1,5 @@
1
1
  module DBus
2
2
  module Systemd
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
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.1
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