Compare commits

..

No commits in common. "71a283513cacfc3383020e9b450b3515ba28908f" and "3f512bf9cf514863cb55c9ff2be4761896cf639c" have entirely different histories.

10 changed files with 0 additions and 139 deletions

View File

@ -3,9 +3,3 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "colorize" gem "colorize"
# frozen_string_literal: true
source "https://rubygems.org"
gem "dotenv"
gem "nextcloud"

View File

@ -1,3 +0,0 @@
.env
private*
*.lock

View File

@ -1,5 +0,0 @@
#!/usr/bin/env ruby
require "dotenv"
settings = Dotenv.load
puts settings

View File

@ -1,17 +0,0 @@
#!/usr/bin/env ruby
require "debug"
require "dotenv"
require "nextcloud"
settings = Dotenv.load
nextcloud = Nextcloud.new(
url: settings["URL"],
username: settings["USERNAME"],
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)}"

View File

@ -1,22 +0,0 @@
#!/usr/bin/env ruby
require "debug"
require "dotenv"
require "nextcloud"
settings = Dotenv.load
nextcloud = Nextcloud.new(
url: settings["URL"],
username: settings["USERNAME"],
password: settings["PASSWORD"]
)
ocs = nextcloud.ocs
user = ocs.user.find("dvarrui")
tags = %i(enabled id quota email displayname phone address website twitter groups language meta)
tags.each do |tag|
label = "user.#{tag}"
puts "#{label.rjust(16)} = #{user.send(tag)}"
end

View File

@ -1,22 +0,0 @@
#!/usr/bin/env ruby
require_relative "lib"
nextcloud = get_nextcloud_object()
ocs = nextcloud.ocs
user = ocs.user.find("dvarrui")
tags = %i(enabled id quota email displayname phone address website twitter groups language meta)
puts "User:"
tags.each do |tag|
value = user.send(tag)
puts "#{tag.to_s.rjust(12)} = #{value.to_s}"
end
puts "\nAdmin:"
groups = ocs.group.all
puts " groups : #{groups}"
# => ["admin", "group1", "group2"]
meta = groups.meta
puts " meta : #{meta}"
# => {"status"=>"ok", "statuscode"=>"200", "message"=>"OK"}

View File

@ -1,18 +0,0 @@
#!/usr/bin/env ruby
require_relative "lib"
fs = get_filesharing_object()
puts "Retrieve all shares of an (authenticated) user"
all_shares = fs.all
meta = all_shares.meta
puts all_shares
puts meta
puts "Retrieve a single share"
share = fs.find(11)
meta = share.meta
puts share
puts meta

View File

@ -1,18 +0,0 @@
#!/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}"
dir = "files_from_git"
result = webdav.directory.create(dir)
puts result
dir = webdav.directory.find
puts dir.contents

View File

@ -1,6 +0,0 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "dotenv"
gem "nextcloud"

View File

@ -1,22 +0,0 @@
require "dotenv"
require "nextcloud"
def get_nextcloud_object
settings = Dotenv.load
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