File: get-files.rb

package info (click to toggle)
snapper 0.10.6-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,072 kB
  • sloc: cpp: 24,846; ansic: 1,466; sh: 1,410; makefile: 514; python: 127; ruby: 90
file content (20 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/ruby

require "dbus"

system_bus = DBus::SystemBus.instance

service = system_bus.service("org.opensuse.Snapper")

dbus_object = service.object("/org/opensuse/Snapper")

dbus_object.introspect
dbus_object.default_iface = "org.opensuse.Snapper"

dbus_object.send("CreateComparison", "root", 1, 2)

files = dbus_object.send("GetFiles", "root", 1, 2)[0]

files.each do |file|
  print file[0], " ", file[1], "\n"
end