Compare commits

..

4 Commits

Author SHA1 Message Date
David Vargas b6eec80060 [U] . 2022-12-01 15:24:01 +00:00
David Vargas 0f52a74581 [U] . 2022-12-01 15:09:22 +00:00
David Vargas 45017910e8 [U] . 2022-12-01 15:09:11 +00:00
David Vargas 28e3300912 [D] . 2022-12-01 15:08:56 +00:00
9 changed files with 15 additions and 37 deletions

View File

@ -1 +1 @@
3.0.4
3.1.2

View File

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

View File

@ -2,4 +2,5 @@
require "dotenv"
settings = Dotenv.load
puts "Comprobando el fichero de configuración:"
puts settings

View File

@ -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)}"

View File

@ -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)

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

@ -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

View File

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

View File

@ -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"],