Compare commits
No commits in common. "b6eec80060bb80c2bcda1c22c890baad06831c64" and "71a283513cacfc3383020e9b450b3515ba28908f" have entirely different histories.
b6eec80060
...
71a283513c
|
@ -1 +1 @@
|
||||||
3.1.2
|
3.0.4
|
||||||
|
|
|
@ -3,5 +3,9 @@
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "colorize"
|
gem "colorize"
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "dotenv"
|
gem "dotenv"
|
||||||
gem "nextcloud"
|
gem "nextcloud"
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
|
|
||||||
settings = Dotenv.load
|
settings = Dotenv.load
|
||||||
puts "Comprobando el fichero de configuración:"
|
|
||||||
puts settings
|
puts settings
|
||||||
|
|
|
@ -11,5 +11,7 @@ nextcloud = Nextcloud.new(
|
||||||
password: settings["PASSWORD"]
|
password: settings["PASSWORD"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ocs = nextcloud.ocs
|
||||||
|
puts "* ocs.webdav.directory: #{ocs.webdav.directory}"
|
||||||
webdav = nextcloud.webdav
|
webdav = nextcloud.webdav
|
||||||
puts "* webdav.directory(@path): #{webdav.directory.instance_variable_get(:@path)}"
|
puts "* webdav.directory(@path): #{webdav.directory.instance_variable_get(:@path)}"
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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
|
|
@ -1,10 +1,9 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require_relative "lib"
|
require_relative "lib"
|
||||||
|
|
||||||
settings = get_settings()
|
|
||||||
nextcloud = get_nextcloud_object()
|
nextcloud = get_nextcloud_object()
|
||||||
ocs = nextcloud.ocs
|
ocs = nextcloud.ocs
|
||||||
user = ocs.user.find(settings["USERNAME"])
|
user = ocs.user.find("dvarrui")
|
||||||
|
|
||||||
tags = %i(enabled id quota email displayname phone address website twitter groups language meta)
|
tags = %i(enabled id quota email displayname phone address website twitter groups language meta)
|
||||||
|
|
|
@ -10,14 +10,9 @@ webdav = nextcloud.webdav
|
||||||
path = webdav.directory.instance_variable_get(:@path)
|
path = webdav.directory.instance_variable_get(:@path)
|
||||||
puts "* webdav.directory(@path): #{path}"
|
puts "* webdav.directory(@path): #{path}"
|
||||||
|
|
||||||
|
|
||||||
dir = "files_from_git"
|
dir = "files_from_git"
|
||||||
binding.break
|
|
||||||
result = webdav.directory.create(dir)
|
result = webdav.directory.create(dir)
|
||||||
puts result
|
puts result
|
||||||
|
|
||||||
result = webdav.directory.put("lib.rb", File.join(dir, "lib.rb"))
|
|
||||||
puts result
|
|
||||||
|
|
||||||
dir = webdav.directory.find
|
dir = webdav.directory.find
|
||||||
puts dir.contents
|
puts dir.contents
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
gem "dotenv"
|
||||||
|
gem "nextcloud"
|
|
@ -1,13 +1,8 @@
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
require "nextcloud"
|
require "nextcloud"
|
||||||
require "debug"
|
|
||||||
|
|
||||||
def get_settings()
|
|
||||||
Dotenv.load
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_nextcloud_object
|
def get_nextcloud_object
|
||||||
settings = get_settings
|
settings = Dotenv.load
|
||||||
nextcloud = Nextcloud.new(
|
nextcloud = Nextcloud.new(
|
||||||
url: settings["URL"],
|
url: settings["URL"],
|
||||||
username: settings["USERNAME"],
|
username: settings["USERNAME"],
|
||||||
|
|
Loading…
Reference in New Issue