zeitungen 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zeitungen/dropbox_client.rb +52 -55
- data/lib/zeitungen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55496c4d27ed68d4494f2d5ad6554d8b0c0671cc
|
4
|
+
data.tar.gz: 1a1a160dc3095df41d1e23a44f5d8b570a59d94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78a638902ad61202e8e517ea85e56798395bdd89f05d06fc266a451a3b8de95e524f9ebc1601a7573a8fb6314b6f8a10071074dc31daaa5392db79a37c1c71f5
|
7
|
+
data.tar.gz: 5ed9ee73a075531b2d58efd6de421d57e8516667576fa15f2926c6672b72f09d858782398059edefb69782cc71f8b724d5e8963bf2aaedc54481cc7b091db46b
|
@@ -1,56 +1,53 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
1
|
+
class DropboxClient
|
2
|
+
attr_accessor :date_string
|
3
|
+
|
4
|
+
def public_dest_path(filename)
|
5
|
+
File.join("quotidie", @date_string, filename)
|
6
|
+
end
|
7
|
+
|
8
|
+
def private_dest_path(filename)
|
9
|
+
File.join("zeitungen", filename)
|
10
|
+
end
|
11
|
+
|
12
|
+
def exist_in_public_dest?(filename)
|
13
|
+
exists?(public_dest_path(filename))
|
14
|
+
end
|
15
|
+
|
16
|
+
def exist_in_private_dest?(filename)
|
17
|
+
exists?(private_dest_path(filename))
|
18
|
+
end
|
19
|
+
|
20
|
+
def mv_file_in_public_dest(filename, file)
|
21
|
+
f = open(file)
|
22
|
+
put_file(public_dest_path(filename), f)
|
23
|
+
end
|
24
|
+
|
25
|
+
def mv_file_in_private_dest(filename, file)
|
26
|
+
f = open(file)
|
27
|
+
put_file(private_dest_path(filename), f)
|
28
|
+
end
|
29
|
+
|
30
|
+
def include?(dir, file)
|
31
|
+
r = metadata(dir)
|
32
|
+
r["contents"].map{|e| File.basename(e["path"])}.include?(file)
|
33
|
+
end
|
34
|
+
|
35
|
+
def dir?(path)
|
36
|
+
r = metadata(path)
|
37
|
+
r["is_dir"]
|
38
|
+
end
|
39
|
+
|
40
|
+
def create_folder(path)
|
41
|
+
file_create_folder(path)
|
42
|
+
rescue DropboxError => e
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
|
46
|
+
# path can be a dir or a file
|
47
|
+
def exists?(path)
|
48
|
+
r = metadata(path)
|
49
|
+
return !r["is_deleted"]
|
50
|
+
rescue DropboxError => e
|
51
|
+
false
|
52
|
+
end
|
56
53
|
end
|
data/lib/zeitungen/version.rb
CHANGED