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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61ff30b7b693c7e60aa9e15062090abaef9cdfcd
4
- data.tar.gz: 1ad15b7f9e0254c3ce5d8078f9f3b1f26ab6e2dc
3
+ metadata.gz: 55496c4d27ed68d4494f2d5ad6554d8b0c0671cc
4
+ data.tar.gz: 1a1a160dc3095df41d1e23a44f5d8b570a59d94a
5
5
  SHA512:
6
- metadata.gz: 9caf311c30c32228d665ca46918c749dfe5c276c5bbc4fc8ddce53059bec7e7d0b7fca3d5127aa16e6269b77280d688649a39a22f31f841a25c55aac186b5ffa
7
- data.tar.gz: 1854578ea04e03ebadae40e7f721a1df5b70f66e0ad869e1515168aeaf180425d180269f073bb82d2608c6ef512b7291773bd9e2feb8ce6a91b62eac4e8d7028
6
+ metadata.gz: 78a638902ad61202e8e517ea85e56798395bdd89f05d06fc266a451a3b8de95e524f9ebc1601a7573a8fb6314b6f8a10071074dc31daaa5392db79a37c1c71f5
7
+ data.tar.gz: 5ed9ee73a075531b2d58efd6de421d57e8516667576fa15f2926c6672b72f09d858782398059edefb69782cc71f8b724d5e8963bf2aaedc54481cc7b091db46b
@@ -1,56 +1,53 @@
1
- module Zeitungen
2
- class DropboxClient
3
- attr_accessor :date_string
4
-
5
- def public_dest_path(filename)
6
- File.join("quotidie", @date_string, filename)
7
- end
8
-
9
- def private_dest_path(filename)
10
- File.join("zeitungenen", filename)
11
- end
12
-
13
- def exist_in_public_dest?(filename)
14
- exists?(public_dest_path(filename))
15
- end
16
-
17
- def exist_in_private_dest?(filename)
18
- exists?(private_dest_path(filename))
19
- end
20
-
21
- def mv_file_in_public_dest(filename, file)
22
- f = open(file)
23
- put_file(public_dest_path(filename), f)
24
- end
25
-
26
- def mv_file_in_private_dest(filename, file)
27
- f = open(file)
28
- put_file(private_dest_path(filename), f)
29
- end
30
-
31
- def include?(dir, file)
32
- r = metadata(dir)
33
- r["contents"].map{|e| File.basename(e["path"])}.include?(file)
34
- end
35
-
36
- def dir?(path)
37
- r = metadata(path)
38
- r["is_dir"]
39
- end
40
-
41
- def create_folder(path)
42
- file_create_folder(path)
43
- rescue DropboxError => e
44
- nil
45
- end
46
-
47
- # path can be a dir or a file
48
- def exists?(path)
49
- r = metadata(path)
50
- return !r["is_deleted"]
51
- rescue DropboxError => e
52
- false
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
@@ -1,3 +1,3 @@
1
1
  module Zeitungen
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeitungen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iwan Buetti