educatic-info/bin/nextcloud/06-webdav.rb

24 lines
518 B
Ruby
Raw Normal View History

2022-12-01 15:22:21 +01:00
#!/usr/bin/env ruby
require_relative "lib"
nextcloud = get_nextcloud_object()
webdav = nextcloud.webdav
ocs = nextcloud.ocs
puts "* ocs.webdav.directory: #{ocs.webdav.directory}"
webdav = nextcloud.webdav
path = webdav.directory.instance_variable_get(:@path)
puts "* webdav.directory(@path): #{path}"
2022-12-01 16:24:01 +01:00
2022-12-01 15:22:21 +01:00
dir = "files_from_git"
2022-12-01 16:24:01 +01:00
binding.break
2022-12-01 15:22:21 +01:00
result = webdav.directory.create(dir)
puts result
2022-12-01 16:24:01 +01:00
result = webdav.directory.put("lib.rb", File.join(dir, "lib.rb"))
puts result
2022-12-01 15:22:21 +01:00
dir = webdav.directory.find
puts dir.contents