Compare commits
4 Commits
71a283513c
...
b6eec80060
Author | SHA1 | Date |
---|---|---|
David Vargas | b6eec80060 | |
David Vargas | 0f52a74581 | |
David Vargas | 45017910e8 | |
David Vargas | 28e3300912 |
|
@ -1 +1 @@
|
||||||
3.0.4
|
3.1.2
|
||||||
|
|
|
@ -3,9 +3,5 @@
|
||||||
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,4 +2,5 @@
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
|
|
||||||
settings = Dotenv.load
|
settings = Dotenv.load
|
||||||
|
puts "Comprobando el fichero de configuración:"
|
||||||
puts settings
|
puts settings
|
||||||
|
|
|
@ -11,7 +11,5 @@ 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)}"
|
|
@ -1,9 +1,10 @@
|
||||||
#!/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("dvarrui")
|
user = ocs.user.find(settings["USERNAME"])
|
||||||
|
|
||||||
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)
|
||||||
|
|
|
@ -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
|
|
|
@ -10,9 +10,14 @@ 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
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
source "https://rubygems.org"
|
|
||||||
|
|
||||||
gem "dotenv"
|
|
||||||
gem "nextcloud"
|
|
|
@ -1,8 +1,13 @@
|
||||||
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 = Dotenv.load
|
settings = get_settings
|
||||||
nextcloud = Nextcloud.new(
|
nextcloud = Nextcloud.new(
|
||||||
url: settings["URL"],
|
url: settings["URL"],
|
||||||
username: settings["USERNAME"],
|
username: settings["USERNAME"],
|
||||||
|
|
Loading…
Reference in New Issue