[U] .
parent
0f52a74581
commit
b6eec80060
|
@ -11,7 +11,5 @@ nextcloud = Nextcloud.new(
|
|||
password: settings["PASSWORD"]
|
||||
)
|
||||
|
||||
ocs = nextcloud.ocs
|
||||
puts "* ocs.webdav.directory: #{ocs.webdav.directory}"
|
||||
webdav = nextcloud.webdav
|
||||
puts "* webdav.directory(@path): #{webdav.directory.instance_variable_get(:@path)}"
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env ruby
|
||||
require_relative "lib"
|
||||
|
||||
settings = get_settings()
|
||||
nextcloud = get_nextcloud_object()
|
||||
ocs = nextcloud.ocs
|
||||
user = ocs.user.find("dvarrui")
|
||||
user = ocs.user.find(settings["USERNAME"])
|
||||
|
||||
tags = %i(enabled id quota email displayname phone address website twitter groups language meta)
|
||||
|
|
@ -10,9 +10,14 @@ webdav = nextcloud.webdav
|
|||
path = webdav.directory.instance_variable_get(:@path)
|
||||
puts "* webdav.directory(@path): #{path}"
|
||||
|
||||
|
||||
dir = "files_from_git"
|
||||
binding.break
|
||||
result = webdav.directory.create(dir)
|
||||
puts result
|
||||
|
||||
result = webdav.directory.put("lib.rb", File.join(dir, "lib.rb"))
|
||||
puts result
|
||||
|
||||
dir = webdav.directory.find
|
||||
puts dir.contents
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
require "dotenv"
|
||||
require "nextcloud"
|
||||
require "debug"
|
||||
|
||||
def get_settings()
|
||||
Dotenv.load
|
||||
end
|
||||
|
||||
def get_nextcloud_object
|
||||
settings = Dotenv.load
|
||||
settings = get_settings
|
||||
nextcloud = Nextcloud.new(
|
||||
url: settings["URL"],
|
||||
username: settings["USERNAME"],
|
||||
|
|
Loading…
Reference in New Issue