educatic-info/bin/nextcloud/lib.rb

28 lines
509 B
Ruby
Raw Normal View History

2022-12-01 15:22:21 +01:00
require "dotenv"
require "nextcloud"
2022-12-01 16:24:01 +01:00
require "debug"
def get_settings()
Dotenv.load
end
2022-12-01 15:22:21 +01:00
def get_nextcloud_object
2022-12-01 16:24:01 +01:00
settings = get_settings
2022-12-01 15:22:21 +01:00
nextcloud = Nextcloud.new(
url: settings["URL"],
username: settings["USERNAME"],
password: settings["PASSWORD"]
)
return nextcloud
end
def get_filesharing_object
settings = Dotenv.load
fs = Nextcloud::Ocs::FileSharingApi.new(
url: settings["URL"],
username: settings["USERNAME"],
password: settings["PASSWORD"]
)
return fs
end