ocman 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/ocman/dav.rb +6 -4
- data/lib/ocman/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2f629736d36a0df291ad884200af7b9467a2adf1dee039f0d9e2aa344bc49dc2
|
4
|
+
data.tar.gz: 03c847f40bc76577dc7b99654e8562e203f419dca75d3ec664e9297517840867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746d95913b6985f64596f58a3b360c420dc1b1d48a88759e484ecc456daaa3b52992ee42c605b0c281cec958cb4127291c2cf9a04da302a2d3183995c238895c
|
7
|
+
data.tar.gz: 86021fa8cd483a213563ce11ec5d2c44b0dca41b69dac5792a1d8f9110469de2730240769e3a66f840143f97e4d30576b64992c192f41c3f6174d91d24106b37
|
data/lib/ocman/dav.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'net/dav'
|
2
|
+
require 'cgi'
|
2
3
|
|
3
4
|
module Ocman
|
4
5
|
class Dav
|
5
6
|
attr_writer :connection
|
6
7
|
|
7
8
|
def mkdir(path)
|
8
|
-
connection.mkdir(
|
9
|
+
connection.mkdir(uri(path) )
|
9
10
|
end
|
10
11
|
|
11
12
|
def ls(path, options={})
|
12
|
-
connection.find(
|
13
|
+
connection.find(uri(path), options ) do |item|
|
13
14
|
yield(item)
|
14
15
|
end
|
15
16
|
end
|
@@ -17,7 +18,7 @@ module Ocman
|
|
17
18
|
def put(file_path, path, options={})
|
18
19
|
filename = options[:filename] || File.basename(file_path)
|
19
20
|
File.open(file_path, 'r') do |stream|
|
20
|
-
connection.put(
|
21
|
+
connection.put(uri(path, filename), stream, File.size(file_path))
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -26,7 +27,7 @@ module Ocman
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def move(source_path, destination_path)
|
29
|
-
connection.move(
|
30
|
+
connection.move(uri(source_path), uri(destination_path) )
|
30
31
|
end
|
31
32
|
|
32
33
|
def self.base_uri
|
@@ -48,6 +49,7 @@ module Ocman
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def uri(path, filename=nil)
|
52
|
+
filename = CGI.escape(filename) if filename
|
51
53
|
[Ocman::Dav.base_uri, path, filename].compact.join('/').gsub(/\/+/, '/')
|
52
54
|
end
|
53
55
|
|
data/lib/ocman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Waldemar Gribele
|
@@ -113,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
|
-
|
117
|
-
rubygems_version: 2.5.1
|
116
|
+
rubygems_version: 3.1.2
|
118
117
|
signing_key:
|
119
118
|
specification_version: 4
|
120
119
|
summary: Ocman - Manages files and shares in nextcloud/owncloud
|