Top Level Namespace

Defined Under Namespace

Modules: DavClient, Hpricot, WebDAV Classes: DavCLI, LsCLI, PropfindCLI, PutCLI, TermUtil

Constant Summary collapse

CURL_PROPFIND =
remove_newlines(curl_propfind_cmd)
CURL_PROPPATCH =
remove_newlines(curl_proppatch_cmd)
CURL_DELETE =
remove_newlines(curl_delete_cmd)
CURL_MKCOL =
remove_newlines(curl_mkcol_cmd)
CURL_OPTIONS =
"-i -X OPTIONS "
CURL_COPY =
remove_newlines(curl_copy)
CURL_MOVE =
remove_newlines(curl_move)
CURL_UPLOAD =
"--upload-file"

Instance Method Summary collapse

Instance Method Details

#cd(args) ⇒ Object

Change working directory.

Examples:

require 'davclient/simple'

cd("https://example.webdav.org/collection/")
content = get("index.html")
print content


21
22
23
# File 'lib/davclient/simple.rb', line 21

def cd(args)
  WebDAV.cd(args)
end

#find(*args, &block) ⇒ Object



29
30
31
# File 'lib/davclient/simple.rb', line 29

def find(*args, &block)
  WebDAV.find(*args, &block)
end

#get(args) ⇒ Object



41
42
43
# File 'lib/davclient/simple.rb', line 41

def get(args)
  WebDAV.get(args)
end

#ls(*args) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/davclient/simple.rb', line 33

def ls(*args)
  if(args == [])
    LsCLI.ls([WebDAV.CWURL])
  else
    LsCLI.ls(*args)
  end
end

#pwdObject



25
26
27
# File 'lib/davclient/simple.rb', line 25

def pwd
  WebDAV.CWURL
end

#remove_newlines(string) ⇒ Object

Used to improve readability of curl commands that always needs to be on one line



9
10
11
# File 'lib/davclient/curl_commands.rb', line 9

def remove_newlines(string)
  string.gsub("\n","").gsub(/ +/," ") + " "
end